Live data from Hacker News

My thoughts after using Clojure for about a month

acdw.net

81–90 of 204 posts

Re: My thoughts after using Clojure for about a month

#81

I wonder if the author is familiar with Smalltalk - it has a very small syntax. In some ways so does Lisp, in other ways it has more than every other language, depending on what you think about operators versus functions.

I have heard of Smalltalk and it is intriguing but honestly I don't even know how to get started with it lol

Re: My thoughts after using Clojure for about a month

#82
post #12

> The seq abstraction, for example, means I usually don’t have to worry about what kind of sequence I’m dealing with Eh? That's completely lifted from CL ( https://www.lispworks.com/documentation/HyperSpec/Body/t_seq... ). Same for AREF/NTH, there's ELT. Other than that, I agree, CL is baroque yet needs some hole filling here and there. > Lisp: everything is a list But that's wrong. Not even a little. Unless you mean…

I haven’t used clojure in quite a while but what’s the issue with (let [a b] …)? Is (let (a b) …) even valid clojure?

In CL and Scheme, it's (let ((var1 val) (var2 val)) body...). So parentheses are used for grouping and function/macro application. In Clojure, parens are just used for application, so you have e.g. (let [var1 val var2 val] body...), or (defn foo [x] ..) or (cond testa 1 testb 2 ...).

It takes some getting used to, and I do wish Clojure would do something more like (let [[var1 val] [var2 val]] ... .. though of course then you'd have to figure something else out for destructuring.

Re: My thoughts after using Clojure for about a month

#83
post #4

> I do wish there were an easier way to move in the ]}]})))}-ness of block ends though. I’m not quite sure what this means. How is it different/worse than all parens..? fyi I use paredit and just hit ) and it moves me past any kind of paren/bracket. But even without that you can just hit left and right..?

They are a pain if they get unbalanced if you aren’t using paredit. Like if I vi delete the last line of a function out of habit it’s a pain to get them back in the right order.

It’s easier if everything is parens, just hit paren til the errors are gone.

Re: My thoughts after using Clojure for about a month

#84
post #38

Once you learn Clojure's syntax and semantics, you're no longer bound to the JVM. There's ClojureScript (JS), ClojureCLR, ClojureDart, jank (C++), Basilisp (Python), babashka (SCI), and many others. This means that, if you don't know Java or don't like the JVM, you can likely use Clojure wherever you already feel most comfortable. For the most part, any Clojure code which doesn't use host interop will work on all dia…

for JS there is also Squint which is a light-weight ClojureScript dialect without the Google Closure Compiler

Re: My thoughts after using Clojure for about a month

#85

Earlier quoted context omitted.

What can the Erlang / Golang runtimes do that the JVM can’t?

Thousands of share-nothing actors (fibers / green-threads) with first-class support for communication between them, for a start. Erlang/Elixir -- immutability as well.

Virtual threads can do that too.

Re: My thoughts after using Clojure for about a month

#86

Earlier quoted context omitted.

Are JVM virtual threads not on par with golangs's concurrency? I think core.async even uses virtual threads now

If they are, I have not heard about it (which does not mean much, I check Java once a year). And if they really are then I'd give Java a serious look again because it's a mature ecosystem that was gimped by ancient runtime decisions for literal decades.

Your knowledge is outdated. Go check again.

Re: My thoughts after using Clojure for about a month

#87

Earlier quoted context omitted.

What can the Erlang / Golang runtimes do that the JVM can’t?

Thousands of share-nothing actors (fibers / green-threads) with first-class support for communication between them, for a start. Erlang/Elixir -- immutability as well.

[deleted]

Re: My thoughts after using Clojure for about a month

#89
post #68

Earlier quoted context omitted.

Thousands of share-nothing actors (fibers / green-threads) with first-class support for communication between them, for a start. Erlang/Elixir -- immutability as well.

What kind of software actually requires this? Honest question. Anything I can think of would probably be written by C++ devs

"requires" is of course subjective, there are always multiple ways to do something. But sometimes it is convenient to model a system as concurrent execution streams, for example: multiple sessions (servers), multiple entities (games, robotics), multiple in-flight transactions (any kind of i/o or concurrent compute). Agreed these are often C++ use-cases but there are obvious benefits to using Erlang or other virtual machines: memory safety, isolation, fault tolerance.
Post reply on HN