Live data from Hacker News

Clojure Newbie Guide (2015)

clojurenewbieguide.com

21–30 of 43 posts

Re: Clojure Newbie Guide (2015)

#21

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 b…

What're you using it for? I really like the language, but it seems geared to replace Java for heavy enterprise enterprise applications. A lot of the benefits I hear people talk about sound like they require a large project to be properly noticed. I've used Clojurescript for a couple toy projects, but it seems awkward to me.

if you could elaborate on awkward part, i'd love to give you a hand. i have 1 react native app built with cljs and 1 chrome extension. using cljs is the best technical decision i've ever made.

Re: Clojure Newbie Guide (2015)

#24

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 b…

What're you using it for? I really like the language, but it seems geared to replace Java for heavy enterprise enterprise applications. A lot of the benefits I hear people talk about sound like they require a large project to be properly noticed. I've used Clojurescript for a couple toy projects, but it seems awkward to me.

Clojure is good for everything you'd use Java for. So pretty much anything that's going to be long running, like services, or big apps meant to be open for a while. Yes, that fits the enterprise use case perfectly. A backend for any service oriented architecture, ETL jobs, data processing pipelines, backend for websites, rest/rpc/graphql services, client/server applications, big data analysis, machine learning, etc.

Clojure is not good for quick scripts, use bash, python, perl, hy, clojurescript, etc. for that.

Clojure is not good for low level code, like drivers, embedded systems, os, etc. Use rust, c, c++, D, etc. instead.

Clojure isn't good for squeezing every ounce of power out of hardware, such as games, use C++, assembly, etc. for that.

Clojure isn't good for mobile app development, use Java, swift, c#, objective-c, etc. for that.

Clojure isn't good as an embedded scripting language, use LUA, python, javascript, tcl, scheme, etc. instead for that.

Therefore Clojure competes mostly against Java, Scala, C#, F#, GO, NIM, Haskell, etc. Now as an astute reader, you've noticed how none of the competing languages I've listed are dynamic or of the lisp family. This makes Clojure unique in its space and the most controversial.

Re: Clojure Newbie Guide (2015)

#25

Earlier quoted context omitted.

What're you using it for? I really like the language, but it seems geared to replace Java for heavy enterprise enterprise applications. A lot of the benefits I hear people talk about sound like they require a large project to be properly noticed. I've used Clojurescript for a couple toy projects, but it seems awkward to me.

if you could elaborate on awkward part, i'd love to give you a hand. i have 1 react native app built with cljs and 1 chrome extension. using cljs is the best technical decision i've ever made.

I'm still a n00b, but I found the errors to be obscure. Often times, I couldn't even get an error to display when I _knew_ something was wrong. After I fixed that error, the app would show up again.

For the most part, everything was incredible while it worked, but every so often very technical errors would come up and that makes me hesitate to advocate for its use at my job.

Re: Clojure Newbie Guide (2015)

#26
post #24

Earlier quoted context omitted.

What're you using it for? I really like the language, but it seems geared to replace Java for heavy enterprise enterprise applications. A lot of the benefits I hear people talk about sound like they require a large project to be properly noticed. I've used Clojurescript for a couple toy projects, but it seems awkward to me.

Clojure is good for everything you'd use Java for. So pretty much anything that's going to be long running, like services, or big apps meant to be open for a while. Yes, that fits the enterprise use case perfectly. A backend for any service oriented architecture, ETL jobs, data processing pipelines, backend for websites, rest/rpc/graphql services, client/server applications, big data analysis, machine learning, etc.…

I think Clojure fits well to quick scripts and exploraory programming, because of the rapid turnaround in interactive development. The finished tool, if compiled, will start fast enough (~1 second for hello world) even though it loses a bit to Python scripts.

Clojure also lets you drop down to the most basic JVM primitives, like unboxed types and atomics/volatile, so you can do lower level stuff than in other dynamic languages. You can even follow the asm code generated by the JIT. Combined with macros and other DSL building capabilities, I'd say doing low level or performance oriented work can be pretty productive with Clojure.

DSL building blocks and dynamic nature also make it a pretty good embedded scripting language.

Many embedded systems are plenty powerful enough to run Clojure (or Python or Java), so it works there too.

Re: Clojure Newbie Guide (2015)

#27
post #24

Earlier quoted context omitted.

What're you using it for? I really like the language, but it seems geared to replace Java for heavy enterprise enterprise applications. A lot of the benefits I hear people talk about sound like they require a large project to be properly noticed. I've used Clojurescript for a couple toy projects, but it seems awkward to me.

Clojure is good for everything you'd use Java for. So pretty much anything that's going to be long running, like services, or big apps meant to be open for a while. Yes, that fits the enterprise use case perfectly. A backend for any service oriented architecture, ETL jobs, data processing pipelines, backend for websites, rest/rpc/graphql services, client/server applications, big data analysis, machine learning, etc.…

I agreed with most of your comment, but not the end.

I don't think Clojure competes with Go or Nim. And Clojure seems to be the antithesis of Haskell. Clojure competes with Java, Kotlin, Scala, and C# if you're on an MS platform.

I used Clojure for pet projects for a while (it's a gorgeous language) but eventually went back to Python because I wanted something with:

* easier interop with C/native libraries,

* faster startup (though for scripts, [inlein](http://inlein.org/) mitigates this issue)

* no requirement of the JVM

* better error messages / more help finding my bugs

* smaller memory and cpu footprint

Looked at some Schemes (Chicken), but couldn't stomach the car/cdr/dotted-pair stuff after having nice data structures like in Clojure, Python, et al. Not interested in ClojureScript, as I don't want JS underneath. Still prefer Clojure-the-language to Python-the-language, but here we are.

Re: Clojure Newbie Guide (2015)

#28

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…

In web development you live-reload code in the running Clojure app, so turn-around time is excellent.

(ClojureScript has very good live reload support as well)

Re: Clojure Newbie Guide (2015)

#29

Earlier quoted context omitted.

If in any case you still feel the same about Clojure, you should try Common Lisp, it has the three things you want: 1. Easy calls to C with CFFI. No Clojure->Java->JNI->C, just straght CL->C. 2. Useful, optional, type system (which can also catch mistakes at compile time with SBCL and other compilers) 3. Very fast startup times. and many more features like for example an object system that is massively above what Clo…

Chiming in to give Racket a shout out. Good FFI, good libraries, good tooling, good community, good (soon to get even better) performance, subjectively more modern feel than CL, great type story via Typed Racket.

Thanks, i use CL and will take a deeper look at Racket as well, i have this pending for a long time...

Re: Clojure Newbie Guide (2015)

#30
post #28

Earlier quoted context omitted.

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…

In web development you live-reload code in the running Clojure app, so turn-around time is excellent. (ClojureScript has very good live reload support as well)

There can be problems with state management, which I've only seen with our web application. Sometimes a hard stop / start is what you need unless you designed the application for reload-ability. We're working towards that for our web application. Frameworks especially seem to exacerbate this problem, since you have limited control over the execution of your program.
Post reply on HN