Live data from Hacker News

How to Use Clojure for Scripting

asimjalis.github.io

21–29 of 29 posts

Re: How to Use Clojure for Scripting

#21
post #18
post #13

"This turns Clojure into a scripting language much like Python, Ruby, Perl, or Bash" would be if you added a sleep(45) to the beginning of every script you wrote with them. All the latency of a compiled language with all the bugs of dynamic one. :) I'm (mostly) kidding... I want to like clojure. I've always had a soft spot in my heart for lisp, and clojure seems to be the best contender for hitting the right balance…

> I want to like clojure. I've always had a soft spot in my heart for lisp Have you tried Racket?

As a racket user I wouldn't say racket is a good scripting language unless you use racket/base and manually require the extra cruft. Startup is quite darn noticeable even on my relatively fast ssd-equipped laptop. For small scripts the startup time is often by far the largest part of the total run time.

But yeah, racket is fun.

Re: How to Use Clojure for Scripting

#22
post #13

"This turns Clojure into a scripting language much like Python, Ruby, Perl, or Bash" would be if you added a sleep(45) to the beginning of every script you wrote with them. All the latency of a compiled language with all the bugs of dynamic one. :) I'm (mostly) kidding... I want to like clojure. I've always had a soft spot in my heart for lisp, and clojure seems to be the best contender for hitting the right balance…

For me, Racket is the sweet spot. It has a surprisingly good story for a lot of use cases, good included batteries, truly great documentation, static typing when you want it, the ability to make a redistributable native(-looking?) GUI app, better-than-python/ruby/other interpreted languages performance, etc.

I do like some of Clojure's syntactic sugaring, but I haven't yet decided whether it's worth it to me to use Rackjure (Clojure-isms ported to Racket).

Re: How to Use Clojure for Scripting

#23
post #13

"This turns Clojure into a scripting language much like Python, Ruby, Perl, or Bash" would be if you added a sleep(45) to the beginning of every script you wrote with them. All the latency of a compiled language with all the bugs of dynamic one. :) I'm (mostly) kidding... I want to like clojure. I've always had a soft spot in my heart for lisp, and clojure seems to be the best contender for hitting the right balance…

What bothers me most about clojure is the abstraction leak when it comes to errors. When something goes wrong (say you passed a value of wrong datatype to a function), it just spits a java error stack. I'd like to have feedback closer to the conceptual level of the language, than to the intricacies of the run-time.

I am curious is this true for all other JVM-hosted languages as well?

I've only ever been exposed to Clojure. Does Scala and JRuby have this as well?

Re: How to Use Clojure for Scripting

#24
post #18

Earlier quoted context omitted.

> I want to like clojure. I've always had a soft spot in my heart for lisp Have you tried Racket?

As a racket user I wouldn't say racket is a good scripting language unless you use racket/base and manually require the extra cruft. Startup is quite darn noticeable even on my relatively fast ssd-equipped laptop. For small scripts the startup time is often by far the largest part of the total run time. But yeah, racket is fun.

As a scripting language the startup is a pain (It has been getting much needed attention just this past month and they are seeing a big improvement on that)

In terms of having a soft spot for lisp and clojure I find that Racket is the best thing ever for scratching that itch. I really am excited by clojure for scripting though.

Racket Scripting https://docs.racket-lang.org/guide/scripts.html

Certainly many little tricks to help with speed.

Re: How to Use Clojure for Scripting

#26
post #13

"This turns Clojure into a scripting language much like Python, Ruby, Perl, or Bash" would be if you added a sleep(45) to the beginning of every script you wrote with them. All the latency of a compiled language with all the bugs of dynamic one. :) I'm (mostly) kidding... I want to like clojure. I've always had a soft spot in my heart for lisp, and clojure seems to be the best contender for hitting the right balance…

For me, Racket is the sweet spot. It has a surprisingly good story for a lot of use cases, good included batteries, truly great documentation, static typing when you want it, the ability to make a redistributable native(-looking?) GUI app, better-than-python/ruby/other interpreted languages performance, etc. I do like some of Clojure's syntactic sugaring, but I haven't yet decided whether it's worth it to me to use R…

i always feel like racket just ultimately fails at self promotion

Re: How to Use Clojure for Scripting

#27
post #13

"This turns Clojure into a scripting language much like Python, Ruby, Perl, or Bash" would be if you added a sleep(45) to the beginning of every script you wrote with them. All the latency of a compiled language with all the bugs of dynamic one. :) I'm (mostly) kidding... I want to like clojure. I've always had a soft spot in my heart for lisp, and clojure seems to be the best contender for hitting the right balance…

If you think Clojure has too much startup overhead for scripting, maybe Pixie[1] will pique your interest. [1] https://github.com/pixie-lang/pixie

Thanks, hadn't seen that, but am going to check it out.

Re: How to Use Clojure for Scripting

#28
post #18
post #13

"This turns Clojure into a scripting language much like Python, Ruby, Perl, or Bash" would be if you added a sleep(45) to the beginning of every script you wrote with them. All the latency of a compiled language with all the bugs of dynamic one. :) I'm (mostly) kidding... I want to like clojure. I've always had a soft spot in my heart for lisp, and clojure seems to be the best contender for hitting the right balance…

> I want to like clojure. I've always had a soft spot in my heart for lisp Have you tried Racket?

Not recently, but did a lot with mzscheme back in the day.

I've had racket, and particularly the plt redex stuff, on my list for someday when I have time for a while now.

Post reply on HN