Live data from Hacker News

Clojure Newbie Guide (2015)

clojurenewbieguide.com

1–10 of 43 posts

Re: Clojure Newbie Guide (2015)

#2
Here are the reasons I stopped using clojure (a phenomenal language) a year ago, in order of importance:

1. No C/C++ FFI.

2. Lack of a strong type system (clojure.spec almost solves this problem now, but when I quit this didn't exist yet).

3. Horrific startup times: although clojure itself is fast, its startup time isn't. This makes scripting in clojure unsatisfying. And you don't feel like a ninja when it takes 30 seconds to start a REPL. You can use clojurescript to target node to get around this, but then you cut yourself off to most of the powerhouse clojure libraries.

I now use Haskell (with C/C++ FFI). I do miss the homoiconicity (and slightly more concise syntax) of clojure. In my opinion Haskell and clojure are the two sexiest mainstream languages that you can get stuff done in.

Re: Clojure Newbie Guide (2015)

#3

Here are the reasons I stopped using clojure (a phenomenal language) a year ago, in order of importance: 1. No C/C++ FFI. 2. Lack of a strong type system (clojure.spec almost solves this problem now, but when I quit this didn't exist yet). 3. Horrific startup times: although clojure itself is fast, its startup time isn't. This makes scripting in clojure unsatisfying. And you don't feel like a ninja when it takes 30 s…

I guess for #2 you didn't get a chance to try out Schema? (Now at https://github.com/plumatic/schema) Or if so, I wonder what you found lacking in it? http://www.lispcast.com/clojure.spec-vs-schema does a good job highlighting some differences..

Re: Clojure Newbie Guide (2015)

#4

Here are the reasons I stopped using clojure (a phenomenal language) a year ago, in order of importance: 1. No C/C++ FFI. 2. Lack of a strong type system (clojure.spec almost solves this problem now, but when I quit this didn't exist yet). 3. Horrific startup times: although clojure itself is fast, its startup time isn't. This makes scripting in clojure unsatisfying. And you don't feel like a ninja when it takes 30 s…

Has anyone looked at grabbing the jnr-ffi libs from jruby for #1? This is an example of what the Java bits end up looking like: https://github.com/jnr/jnr-ffi-examples/blob/master/getpid/s...

Can't imagine that would be too hard to wrap.

Re: Clojure Newbie Guide (2015)

#5
post #3

Here are the reasons I stopped using clojure (a phenomenal language) a year ago, in order of importance: 1. No C/C++ FFI. 2. Lack of a strong type system (clojure.spec almost solves this problem now, but when I quit this didn't exist yet). 3. Horrific startup times: although clojure itself is fast, its startup time isn't. This makes scripting in clojure unsatisfying. And you don't feel like a ninja when it takes 30 s…

I guess for #2 you didn't get a chance to try out Schema? (Now at https://github.com/plumatic/schema ) Or if so, I wonder what you found lacking in it? http://www.lispcast.com/clojure.spec-vs-schema does a good job highlighting some differences..

Runtime type checking is useless. If a given function can't accept the data I plan to send into it, I want the compiler to tell me immediately.

Re: Clojure Newbie Guide (2015)

#6

Here are the reasons I stopped using clojure (a phenomenal language) a year ago, in order of importance: 1. No C/C++ FFI. 2. Lack of a strong type system (clojure.spec almost solves this problem now, but when I quit this didn't exist yet). 3. Horrific startup times: although clojure itself is fast, its startup time isn't. This makes scripting in clojure unsatisfying. And you don't feel like a ninja when it takes 30 s…

Why not use a proper Common Lisp instead, then?

Re: Clojure Newbie Guide (2015)

#7

Here are the reasons I stopped using clojure (a phenomenal language) a year ago, in order of importance: 1. No C/C++ FFI. 2. Lack of a strong type system (clojure.spec almost solves this problem now, but when I quit this didn't exist yet). 3. Horrific startup times: although clojure itself is fast, its startup time isn't. This makes scripting in clojure unsatisfying. And you don't feel like a ninja when it takes 30 s…

I've wrapped C and C++ code via the JNI and called it from Clojure. There are a good number of projects wrapping C code in Clojure. It's a little awkward (Clojure -> Java -> JNI -> C), but works well enough.

We get around the startup time by keeping our work either in the REPL, or just having large enough tasks that the loading is dwarfed by the time it takes to get started. Webdev might be a little crappy if you're used to the turn-around cycle of either node or PHP.

Re: Clojure Newbie Guide (2015)

#8
post #5
post #3

Earlier quoted context omitted.

I guess for #2 you didn't get a chance to try out Schema? (Now at https://github.com/plumatic/schema ) Or if so, I wonder what you found lacking in it? http://www.lispcast.com/clojure.spec-vs-schema does a good job highlighting some differences..

Runtime type checking is useless. If a given function can't accept the data I plan to send into it, I want the compiler to tell me immediately.

I think useless might be a stretch. While I certainly prefer compile time checks as well, spec is a huge step forward for folks that are committed to Clojure. If there was no merit to runtime checking, Haskell wouldn't have QuickCheck and would exclusively rely on compile time checking.

Re: Clojure Newbie Guide (2015)

#9
I have been a Clojure newbie for over 3 years now and here is why I am still using it:

1. Clojure code makes sense to me : I could go back to Clojure code someone wrote three years ago and I would have no problem in figuring out what the code was doing. With Java or Javascript, unless the code is documented with extreme diligence, the nuance are hard to decipher.

2. REPL based coding makes it easy to get code right before making it part of my namespace

3. lack of strong typing has not been a stopper for me yet. Spec is good enough for my needs

4. State and concurrency : Its hard to screw up concurrency and state mutation with Clojure

edit: formatting

Re: Clojure Newbie Guide (2015)

#10
post #5
post #3

Earlier quoted context omitted.

I guess for #2 you didn't get a chance to try out Schema? (Now at https://github.com/plumatic/schema ) Or if so, I wonder what you found lacking in it? http://www.lispcast.com/clojure.spec-vs-schema does a good job highlighting some differences..

Runtime type checking is useless. If a given function can't accept the data I plan to send into it, I want the compiler to tell me immediately.

That way lies SOAP, and it's not the compiler that tells the client it can't call an API some way but a broader build tool. And you still need some runtime verification somewhere on the server anyway since without it nothing stops any arbitrary stream of bytes.

My own related exaggeration is that type declarations without performance gains are useless. Get them out of my dynamic langs unless you can deliver the performance goods. (Like Common Lisp can. It can also tell you you're stupid locally trying to make an invalid call, at compile time, since COMPILE is built-in.)

Post reply on HN