4 ms·
I found setting up Leiningen and the JVM and deps.edn so difficult and confusing on my old Mac that I gave up on learning Clojure because of it.
by leobg 4y ago
I found setting up Leiningen and the JVM and deps.edn so difficult and confusing on my old Mac that I gave up on learning Clojure because of it.
- slotrans 4y agoYou can also just... $ clojure some_code_you_wrote.clj It's a shame that this is either missing or well-hidden in the official docs, common intro guides, etc. It's not how you make a "real" application or whatever, but if you're just trying to play with it, this way works great. I hate having to make a "project" just to even Hello World. I much prefer the bash/Python/Groovy/etc approach of "drop some code in a file and run it".
- LesZedCB 4y agoyou can even just shebang it. if the startup time sucks too much, babashka has you covered! just s/clojure/bb.
- JoshCole 4y agoThis might be less painful. brew install openjdk brew install leiningen lein new project cd project lein run Ditto for the linked article.
- cutler 4y agoExcept you now need an extra JVM instance just for Leiningen.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- JoshCole 4y ago> Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%. - Donald Knuth This small inefficiency is not something worth creating complications over. The thing about baby steps is that when you use that sort of language you're already making things sound easier than they are. The first baby step is the hardest step to take. It takes months of work and many falls. My hope is that they manage to write (+ 2 2) or something similar; I'm not trying to make learning the language hard.
- leobg 4y agoThank you. Will try that!
- didibus 4y agoYou can also do: brew install openjdk brew install clojure/tools/clojure brew install babashka/brew/neil neil new app myapp cd myapp clojure -M:run-m If you're interested in trying out what the article is about (which I would say is more likely to become the new standard way as things evolve).