3 ms·
It's hard to want to choose Clojure when it's hard to know where to start. I saw "CojureScript" followed by "ColjureCLR" and just blacked out... I'd like to lea
by rubyn00bie 7y ago
It's hard to want to choose Clojure when it's hard to know where to start. I saw "CojureScript" followed by "ColjureCLR" and just blacked out... I'd like to learn a lisp and I hear clojure is the jam, but seeing that ecosystem exists, while flexible, makes it seem like 90% of it will be learning the tooling and not the language... It just makes me think "hmmm. I need the JVM, might as well use Java... at least it'll be predicatable straightforward, and EXTREMELY well documented, in it's convoluted-ness[1]"
Can someone please sell me, or assure me, otherwise?
[1] Which is also high... I can barely get a JVM project running these days with the plethora highly foreign of build tools, IDE dependencies/configurations, and language settings. Maybe that's just par for the course in 2020 on the JVM, with great power comes great complexit?
- emmanueloga_ 7y agoThere are all sorts of bells and whistles you can choose when it comes to Clojure, but I would recommend you focus in one thing for a start, just plain Clojure with the JVM. Download a Clojure jar [0], the following command opens the REPL: $ java -jar clojure-1.10.1.jar ... you can also run the file you are editing: $ java -jar clojure-1.10.1.jar file.clj ... that's it! You can go a long way just like that, the start up time of running scripts is not that bad. Gradual improvements: * Perhaps install a clojure package [1] instead of using the jar. The jar is nice to understand the main Clojure compiler is at its core just that, a Java program... but the package installed with brew or apt will probably (depending on your OS and how up to date the packages are) also give you a global `clojure` or `clj` command that you will see around in tutorials. Just makes it easier to follow the tutorials! * Use rebel-readline [2]. Just follow the readme!. It gives you a nice coloured command line REPL with all sorts of cool features, but you don't need to make use of all of them at once. Take your time! * Choose an editor with good integrations. Obvious choices: VSCode+Calva extension, IntelliJ+Cursive, or Emacs+Cider. The main thing about having a good integration is the instantaneous feedback of sending chunks of code to the REPL, although for a slow start you can do the same just copying and pasting code from the editor to the REPL! About books: I read 3 or 4 different ones... most books I read were pretty good, some of them are available online for free! Confidence comes from writing lots of code mostly, though, not just reading. I'm not proficient enough yet that I remember the APIs yet so books help to gimme a cohesive roadmap of things to learn. Suggested little "project": I also found this library [3] that is cool to play a bit with random things to produce some graphical output. It is a wrapper around Processing. Good luck! Caveat: there are many ways to do teh same thing. This comes from a focus on libraries over frameworks. Also, the whole JVM API is available to you so for a lot of things you are supposed to just use the Java APIs. Don't bother about wrappers or clojars for a start, just call Java from your clojure. Is fast, fun and easy! :-) Pick one way of doing things and do it for a while... even if it doesn't give you the "fullest of the performance" for any given task, it will be an OK vehicle for you to learn and get familiar with the ecosystem. Classical example: http servers. 0: https://repo1.maven.org/maven2/org/clojure/clojure/1.10.1/ https://repo1.maven.org/maven2/org/clojure/clojure/1.10.1/ 1: https://clojure.org/guides/getting_started https://clojure.org/guides/getting_started 2: https://github.com/bhauman/rebel-readline https://github.com/bhauman/rebel-readline 3: http://quil.info/ http://quil.info/
- puredanger 7y agoYou can't actually use the Clojure jar like this with java -jar as it has a couple of dependent libs (spec.alpha and core.specs.alpha). But getting started with the `clj` tool is just as easy.
- emmanueloga_ 7y agoMy bad! I tested it my system and it worked, but I'm sure I have the jars in the classpath already because I had already installed Clojure through a packet manager. So! Clojure 1.8 still works without dependencies for trying the jar [1]. Otherwise, I'd skip to installing 1.10 through the system installer. 1: https://repo1.maven.org/maven2/org/clojure/clojure/1.8.0/ https://repo1.maven.org/maven2/org/clojure/clojure/1.8.0/
- bmillare 7y agoSee my post above, just build the clojure jar yourself using the ant instructions, and it will be portable again.
- bmillare 7y agoYou can if you build the clojure jar yourself. Just follow the ant part of the clojure README to generate your own jar. Then you have a super portable clojure jar again. https://github.com/clojure/clojure/ https://github.com/clojure/clojure/
- emmanueloga_ 7y agoThis is cool, though for lowering the barrier of entry downloading a single jar is great. If ppl is first coming to Clojure w/o too much knowledge of java, having to install Ant first, clone a repo and build it manually could be a bit daunting.
- seancorfield 7y agoOn macOS: brew install clojure Linux can use brew as well, or just download an installer shell script and run it. Windows can use an (alpha) installer for Powershell or use Scoop via this bucket https://github.com/littleli/scoop-clojure https://github.com/littleli/scoop-clojure That's for the official CLI that works with deps.edn files for dependencies. You can also download Leiningen -- a single shell script (macOS/Linux) or batch script (Windows). If you use brew/scoop, I don't think you even need a JVM installed as they will do that automatically.
- arc-in-space 7y agoThis has been exactly my experience. Great language, but ended up spending far too much time fiddling with the tooling and trying to comprehend the interactions between Clojure and the Java ecosystem.