Live data from Hacker News

Clojure Newbie Guide (2015)

clojurenewbieguide.com

41–43 of 43 posts

Re: Clojure Newbie Guide (2015)

#41
post #40
post #39

Earlier quoted context omitted.

What you say is true, yet false. While you can use Clojure for script, or performance heavy tasks, or embedded systems, I think it's pretty obvious it's not the right tool for those, at least not yet. If you want to mess around with scripts, performance heavy tasks or embedded systems, sure you can use Clojure, but if you are serious about any of them, it wouldn't make sense. You'd turn to languages that are better s…

I don't think you addressed any of the arguments here, so quite far from obvious...?

Ok, well, for scripts:

- You mention sub second load times. Based on https://dev.clojure.org/display/design/Improving+Clojure+Sta..., the surveyed timings are around 2 to 5 seconds, going to 60 seconds for some. That's a bit too much for scripts, you can live with it, but users are going to be annoyed about it for sure.

- Another issue is the difficulty in starting them. You need to invoke java with a class path setup. So you can't have self executing scripts. You can use inlein, but that brings us to my third point.

- The bigget issue is that Java and Clojure are not standard on any machine. While python and bash tend to be. To use Clojure for scripts require each machine to be imaged with java, Clojure and inlein setup.

About performance and low level tasks. I'm not sure which of my use case you're specifically talking about. But an OS and drivers need to be compiled to specific hardware, so Clojure isn't an option for low level code like that. Now the JVM isn't performant enough for major games, you can't control memory yourself, or target specific CPU instructions.

Finally, only a minority of embeded chips support running a JVM instance, I'm not sure I need to explain any further, if you work in embedded systems, it just doesn't make sense to restrict yourself only to the more powerful chip that can run an embedded JVM.

P.S.: I love Clojure, I wish it was great at all these use cases, but it currently isn't, and I think we do the community a diservice to make people believe it is, because they'll try it, and have a subpar experience, leaving them feeling like Clojure isn't that great afterall. I'd rather people try it for what it's good at.

Re: Clojure Newbie Guide (2015)

#42
post #41
post #40

Earlier quoted context omitted.

I don't think you addressed any of the arguments here, so quite far from obvious...?

Ok, well, for scripts: - You mention sub second load times. Based on https://dev.clojure.org/display/design/Improving+Clojure+Sta... , the surveyed timings are around 2 to 5 seconds, going to 60 seconds for some. That's a bit too much for scripts, you can live with it, but users are going to be annoyed about it for sure. - Another issue is the difficulty in starting them. You need to invoke java with a class path set…

That survey is unrepresentative for scripting, since it's a survey of all Clojure applications. Scripting tends to be one-off, custom high level logic. I'm sure any Clojure user will tell you that short programs start fast enough for scripting - and for development, you are live-reloading in the REPL with 0 startup time.

About deployment and distribution, I think the JVM story is much better than the competition (Python, Node, etc) - you can just package everything in a single .jar and you need only this along with the JVM.

Embedded systems, like I wrote above, are hardly restricted to this kind of tiny chip. Embedded systems these days are frequently powerful enough to run Clojure. There's a big market for developing embedded solutions that value memory-safety, fast turnaround times and on-devices development ability along with access to JVM libs.

To summarize, I still disagree that all these broad sectors would be weak for Clojure (like you argued in your original post). There are be smaller niches inside these sectors that Clojure is not well suited to (like operating systems, or low-powered embedded, or frequently executed end-user scripts that need sub-second startup times, or code inside operating system kernels) but this hardly excludes Clojure for all your listed broad application areas.

Re: Clojure Newbie Guide (2015)

#43
post #42
post #41

Earlier quoted context omitted.

Ok, well, for scripts: - You mention sub second load times. Based on https://dev.clojure.org/display/design/Improving+Clojure+Sta... , the surveyed timings are around 2 to 5 seconds, going to 60 seconds for some. That's a bit too much for scripts, you can live with it, but users are going to be annoyed about it for sure. - Another issue is the difficulty in starting them. You need to invoke java with a class path set…

That survey is unrepresentative for scripting, since it's a survey of all Clojure applications. Scripting tends to be one-off, custom high level logic. I'm sure any Clojure user will tell you that short programs start fast enough for scripting - and for development, you are live-reloading in the REPL with 0 startup time. About deployment and distribution, I think the JVM story is much better than the competition (Pyt…

I haven't worked those sectors personally, so I'm not going to pretend I know fully their requirements and if Clojure would be a smart choice. But from what I've heard and read, embedded systems is dominated by C. Very little chips support embedded java from my googling about it. Serious work still needs compact binaries, and to maximise the chips output. The exceptions are critical use cases, where they might use java and have a TLS proof with it which I don't think would work if using Clojure, or they'll go with Haskell or Agda, because they need to guarantee there's no bugs. Now I say this only from searching online and people I know who work in embedded systems.

Is there a sector for scripting? I was thinking of IT mostly, sys admin, that kind of stuff. In those cases, configuring java and clojure and inlein feel pretty heavy to me. I've never seen it in practice. It always adopts a language that is bundled with the OS like sh, perl, python, powershell, batch, etc.

It seems to me like the niche in these sectors would be Clojure being the right language. But I don't have real stats, so you might be 100% right. Personally, I didn't feel it is, I can think of more examples of use cases where bash is a better choice for scripting, or more examples where C is a better choice for embedded.

If you work in those sectors you probably know better, but I didn't get the impression you did, so I guess neither of us really knows.

Post reply on HN