←back to thread

177 points chhum | 9 comments | | HN request time: 1.147s | source | bottom
Show context
exabrial ◴[] No.44006194[source]
Java performance isn't the fastest, that's ok, a close 3rd place behind C/CPP ain't bad. And you're still ahead of Go, and 10x or more ahead of Python and Ruby.

Java syntax isn't perfect, but it is consistent, and predictable. And hey, if you're using an Idea or Eclipse (and not notepad, atom, etc), it's just pressing control-space all day and you're fine.

Java memory management seems weird from a Unix Philosophy POV, till you understand whats happening. Again, not perfect, but a good tradeoff.

What do you get for all of these tradeoffs? Speed, memory safety. But with that you still still have dynamic invocation capabilities (making things like interception possible) and hotswap/live redefinition (things that C/CPP cannot do).

Perfect? No, but very practical for the real world use case.

replies(14): >>44006269 #>>44006358 #>>44006411 #>>44006567 #>>44006570 #>>44006865 #>>44007100 #>>44007464 #>>44007662 #>>44007666 #>>44009121 #>>44009861 #>>44011219 #>>44011642 #
1. dragandj ◴[] No.44006269[source]
Throw in Clojure into the mix, and you get superpowers!
replies(1): >>44006321 #
2. exabrial ◴[] No.44006321[source]
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?
replies(5): >>44006401 #>>44007049 #>>44007586 #>>44010498 #>>44010785 #
3. dragandj ◴[] No.44006401[source]
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)

4. wry_discontent ◴[] No.44007049[source]
Start doing any year of Advent of Code with Clojure and you'll get it.

They're really amenable to the REPL.

5. mark_l_watson ◴[] No.44007586[source]
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
6. dan_fornika ◴[] No.44010498[source]
"Clojure for the Brave and True" is free online: https://www.braveclojure.com/clojure-for-the-brave-and-true/
7. Zambyte ◴[] No.44010785[source]
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.

replies(1): >>44011464 #
8. fuzztester ◴[] No.44011464{3}[source]
it also has the threading operator or macro.

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

replies(1): >>44011942 #
9. shawn_w ◴[] No.44011942{4}[source]
Clojure style threading macros are readily available for common lisp and scheme. Probably emacs lisp too.