Live data from Hacker News

How to Use Clojure for Scripting

asimjalis.github.io

11–20 of 29 posts

Re: How to Use Clojure for Scripting

#11
Only sort of related, does anyone have any insight into whether Slamhound will eventually support ClojureScript? Namespace declarations were probably my least favorite part about Clojure until I happened on Slamhound, now I pretty much don't have to think about them. Working with ClojureScript without Slamhound is rather annoying...

Re: How to Use Clojure for Scripting

#12
I thought Boot's scripting features were removed in the 2.0 release? If I remember correctly, there was a major overhaul in both its API and feature set. I'll have to revisit the changelog/docs.

Anyways, running a clj file using the provided shebang does indeed work! Albeit _much_ more slowly than a comparable Perl|Python|Ruby script.

Re: How to Use Clojure for Scripting

#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 between the classic "no syntax at all, just more parens" and various more modern takes on "It's lisp, but with our own weird syntax bits layered on." Unfortunately the JVM'ness of it has shown through so much as to kind of turn me off. (Not least of all the overhead of starting a JVM to do anything.)

Re: How to Use Clojure for Scripting

#14
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

Re: How to Use Clojure for Scripting

#15
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

Here's a wonderful talk to introduce its design and value https://www.youtube.com/watch?v=1AjhFZVfB9c

Re: How to Use Clojure for Scripting

#16
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

If I could simply `apt-get install pixi-lang` or `brew install pixi-lang` I'd be using it.

Re: How to Use Clojure for Scripting

#17
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 the JVM or the startup time bother you you can try using ClojureScript with node.js.

Re: How to Use Clojure for Scripting

#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?

Re: How to Use Clojure for Scripting

#19
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.

Re: How to Use Clojure for Scripting

#20
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.

Spec instrumentation solves this perfectly for Clojure and ClojureScript. There's a price to pay, sure. Namely speccing your functions, but specs are defined for the functions in clojure.core.
Post reply on HN