Hacker News new | past | comments | ask | show | jobs | submit login

Nice. Have been meaning to play around with ClojureScript but the tooling has always put me off.



What's wrong with the tooling?

My current CLJS setup is boot with boot-cljs, boot-reload and boot-cljs-repl. They're configured using normal Clojure code in a build.boot file and the entry points are configured in live-reloadable *.edn files.

That setup is simpler and far more powerful than anything else I've seen in other languages.

I was using leiningen previously but boot proved to be more powerful for less work in my case.

https://github.com/boot-clj/boot

https://github.com/boot-clj/boot-cljs

https://github.com/adzerk-oss/boot-reload

https://github.com/adzerk-oss/boot-cljs-repl


What are you using to edit? I don't think the any one piece of the tooling for Clojure or ClojureScript is a problem, but getting it all going together for people who aren't familiar with the ecosystem and terminology (possibly including Java, Lisp, Emacs, functional programming, and Clojure itself) can be an obstacle. Even by your choice of boot over lein, means a majority of beginner tutorials are going to have a gap because they tend to focus on Leiningen.


I highly recommend using Cursive https://cursive-ide.com/ for editing. It's an excellent IDE with lots of great features. For as simple editor Atom is a good choice as well http://yogthos.net/posts/2016-10-15-AtomWithLuminus.html

I maintain Luminus http://www.luminusweb.net/docs specifically to make it easier for people to get started. For example, if you wanted to make a new web app with Clojure you could do:

    lein new luminus myapp
    cd myapp
    lein run
That's all there is to it.

I would recommend using Leiningen, just because it is more popular. If you're starting out, then you don't really need to change that much stuff in the project file aside from adding dependencies.


But to my point about friction in Clojure tooling, you can't just download Cursive, run it, and try Clojure. You have to download and install Java, Leiningen, IntelliJ, get a Cursive license, then install the Cursive plug in, create a project configure a REPL (local or remote?). None of that is a big problem, but cumulatively, all these little points of friction deter beginners.

And thank you for your work in the community. Luminus is great, and I Macchiato looks really nice as well.


Thanks, always good to hear these things are useful.

As I pointed out in the original comment, you don't really have to use Cursive if you're starting out. Cursive is great for working on serious projects, but it's certainly not a requirement for trying Clojure.

Aside from Atom, you also have Light Table, VS Code, Vim, Emacs, and Eclipse. Chances are a lot of people would be using at least one of these tools. As far as having to download the JVM and Leiningen, it's not really different than what you'd have to do for Python, Ruby, or Node.js.

So, I don't think the situation for Clojure is really any worse than most languages. That said, I think that Nightcoders could remove any friction in starting with the language.


I think it is a little harder to set up (compare to Ruby and Python, which are preinstalled on Macs), plus throw in the functional concepts,Lisp syntax, and Java errors. Together it makes for a bunch of small initial pain points that I am certain causes some people to drop out, which is frustrating because Clojure is awesome. DrRacket might be a good comparison for a more similar language with an easier initial ramp up.


I still need to try boot. So for clojurescript, I don't need figwheel, I can just use boot-reload and coot-cljs-repl ?


Yeah, and their configuration is mostly automatic; running the tasks starts their respective server and injects the client-side code to connect to them in the build.

boot-reload will hot reload new code on file changes, and optionally run a client-side hook. I use it to remount my react views. boot-cljs-repl provides a REPL into the browser you can use from the cmd line or directly in your editor. I'm using it with emacs-cider, but there are clients for most major editors.


One thing to remember is that clojure (and most Lisp dialects) take the concept of code-as-data and vice-versa very seriously. Your configuration of a clojure/script project is not done via magical directories full of yaml and json files with an obtuse build description language: instead, you just use ordinary lisp code, ideally with utility macros and functions provided by your build tool. Likewise, everything from defining dependencies to configuring tasks is described by simple Clojure lists, maps, and literals: all of which can be generated by ordinary clojure functions and macros. Basically, if you understand the core concepts of clojure, you can configure you project to exacly the way you want it with little extra difficulty.


What I like best is that a single tool (lein or boot) drives the entire development pipeline and you get to choose between data-driven or code-driven approaches respectively.

Usually there's one place for dependencies, one for builds, one for configuration; each using their own tools and/or languages. That list grows quickly as well. A single tool to drive it all is bliss.

I recently had to take over a few Ruby projects and the tooling is so spread over its hell; bundle, gem, rake and others.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: