News for hackers. Stuff that matters.
Re:Java at 30: The Genius Behind the Code That Changed Tech by exabrial on Friday May 16, 2025 @11:00AM (#44006321)
I'm still trying to mentally grok the Clojure model and syntax hah. On my todo list. Clojure users seem to love it though. Do you have a tutorial that could sell it to me?
Re:Java at 30: The Genius Behind the Code That Changed Tech by dragandj on Friday May 16, 2025 @11:07AM (#44006401)
Many Clojure tutorials are free! It's difficult to say without knowing nothing about your preference and experience. Everyone's welcome to join Clojure Slack community (for example) which has several tens of thousands of members and dedicated beginners channel. I'm sure if you asked there, you'd get tons of recommendations tailored to you. https://clojurians.slack.com/

(BTW Clojure, as a Lisp dialect, has almost no syntax. You can learn THAT in 5 minutes. The challenge is in training your programming mind to think in totally new concepts)

Re:Java at 30: The Genius Behind the Code That Changed Tech by wry_discontent on Friday May 16, 2025 @12:03PM (#44007049)
Start doing any year of Advent of Code with Clojure and you'll get it.

They're really amenable to the REPL.

Re:Java at 30: The Genius Behind the Code That Changed Tech by mark_l_watson on Friday May 16, 2025 @12:55PM (#44007586)
My Clojure AI book won't teach you the language, but afterward you read through a tutorial my book contains interesting examples; read it online https://leanpub.com/clojureai/read
Re:Java at 30: The Genius Behind the Code That Changed Tech by dan_fornika on Friday May 16, 2025 @06:50PM (#44010498)
"Clojure for the Brave and True" is free online: https://www.braveclojure.com/clojure-for-the-brave-and-true/
Re:Java at 30: The Genius Behind the Code That Changed Tech by Zambyte on Friday May 16, 2025 @07:41PM (#44010785)
For syntax, maybe this general Lisp advice will help: consider a normal function call, like f(a, b). To make this into a Lisp function call, drop the unnecessary comma (whitespace is enough to separate tokens) like f(a b), and then move the function name inside the parentheses, like (f a b). Applying operators that are considered "primitive" in other languages are syntactically treated the same as functions. So imagine an add function like add(a, b), but instead of being named 'add', it's just named '+', like +(a, b). Applying the same transformation as before, this turns into (+ a b).

Using the function application syntax for primitives like + is nice because you get the same flexibility of normal functions, like variable argument length: (+ a b c).

Clojure is a little bit less uniform than other Lispy languages in that it has special brackets for lists (square brackets) and for maps (curly brackets), but that's pretty much it.

Re:Java at 30: The Genius Behind the Code That Changed Tech by fuzztester on Friday May 16, 2025 @09:55PM (#44011464)
it also has the threading operator or macro.

i am not a clojure or lisp expert, just saying.

Re:Java at 30: The Genius Behind the Code That Changed Tech by shawn_w on Friday May 16, 2025 @11:58PM (#44011942)
Clojure style threading macros are readily available for common lisp and scheme. Probably emacs lisp too.
Re:Java at 30: The Genius Behind the Code That Changed Tech by fuzztester on Monday May 19, 2025 @08:07PM (#44036351)
interesting, thanks.