News for hackers. Stuff that matters.
Re:Clojure Newbie Guide (2015) by georgewsinger on Thursday June 22, 2017 @08:56AM (#14611880)
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) by flavio81 on Thursday June 22, 2017 @10:20AM (#14612403)
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 Clojure and Java bring to the table, better exception handling, very explícit errors and nice stack traces, it can also compile to JVM if you want, etc.

If you like Lisp, try it. You already learned a Lisp so the jump is easy.

Re:Clojure Newbie Guide (2015) by peatmoss on Thursday June 22, 2017 @11:26AM (#14612889)
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.
Re:Clojure Newbie Guide (2015) by dTal on Thursday June 22, 2017 @07:09PM (#14615994)
>(soon to get even better) performance

Why? Are the rumours of porting the language to Chez Scheme true?

Re:Clojure Newbie Guide (2015) by peatmoss on Thursday June 22, 2017 @10:17PM (#14616735)
I hope it's not just a rumor! https://news.ycombinator.com/item?id=13656397
Re:Clojure Newbie Guide (2015) by flavio81 on Thursday June 22, 2017 @03:57PM (#14614849)
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) by jakebasile on Thursday June 22, 2017 @10:32AM (#14612485)
1. There is JNI. I made an example project[1] a while ago. I'll admit it's a little involved but it does exist.

2. Spec does solve the problem for me, but I don't really like static typing anyways.

3. I keep Clojure REPLs open for days. I restart if I need a new dependency and for other minor reasons, but startup time is almost a non issue for development. For scripting, you can try Planck, although yeah you lose the Java interop. I love Clojure, but I just don't use it for scripting.

Not trying to tell you you're wrong, just offering some insight into how Clojure could address (or not address) your points.

[1]: https://github.com/jakebasile/clojure-jni-example

Re:Clojure Newbie Guide (2015) by escherize on Thursday June 22, 2017 @10:55AM (#14612652)
With cider and clojure-refactor mode, you can hotload a dependency without restarting the repl. It is kind of brittle but when it's working hot damn is it good.
Re:Clojure Newbie Guide (2015) by Jach on Thursday June 22, 2017 @09:15AM (#14611979)
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) by fbonetti on Thursday June 22, 2017 @09:36AM (#14612103)
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) by Jach on Thursday June 22, 2017 @09:55AM (#14612235)
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.)

Re:Clojure Newbie Guide (2015) by tmountain on Thursday June 22, 2017 @09:46AM (#14612170)
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) by zintinio5 on Thursday June 22, 2017 @09:39AM (#14612124)
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) by zurn on Thursday June 22, 2017 @02:57PM (#14614431)
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) by zintinio5 on Thursday June 22, 2017 @05:08PM (#14615382)
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.
Re:Clojure Newbie Guide (2015) by pjmlp on Thursday June 22, 2017 @09:37AM (#14612113)
Why not use a proper Common Lisp instead, then?
Re:Clojure Newbie Guide (2015) by regularfry on Thursday June 22, 2017 @09:35AM (#14612099)
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) by justinhj on Thursday June 22, 2017 @11:30AM (#14612924)
I gave up on Clojure despite spending a lot of hobby time on it and moved to Scala because it's simply a much easier language to sell to other engineers and management.

For me the C/C++ was a minor issue since if you're going to the trouble to do it on the JVM you may as well build that part in Java.

Re:Clojure Newbie Guide (2015) by Jach on Friday June 23, 2017 @09:42AM (#14619065)
Any tips for how you sold Scala? I don't even like it but I picture the sell to be at least as hard as Clojure, at least if you're selling Scala honestly... Clojure can't hide its alienness anywhere but a Scala intro can. I'd like to find a way to push for Kotlin at the moment, which would be nicer day-to-day than plain Java plus open the door later for other JVM languages.
Re:Clojure Newbie Guide (2015) by justinhj on Friday June 23, 2017 @11:55AM (#14620064)
The major things are:

Show examples of large companies using Scala in production (Twitter, LinkedIn, Walmart etc)

Gradual low risk introduction of Scala using Gatling load test and ScalaCheck

Production ready frameworks like Play and Akka

Demonstrate that Scala can be introduced at various levels from "Java without semi colons" to "You need to learn category theory to understand this" and what we would do to make sure everyone on the team would be up to speed.

Build a prototype

What counted against Clojure and Common Lisp was the immediate reaction of people with no exposure to lisp languages was "those brackets" and the lack of a large stable framework one can pick up and use as a gateway to using the language.

Simply put there can be a gradual adoption of Scala in a company that's really not possible with Clojure.

Re:Clojure Newbie Guide (2015) by didibus on Thursday June 22, 2017 @11:48AM (#14613057)
What kind of programs do you normally write?