Hacker News new | past | comments | ask | show | jobs | submit login
Lightmod – A beginner-friendly, all-in-one tool for full stack Clojure (sekao.net)
152 points by malloryerik on Nov 5, 2017 | hide | past | favorite | 25 comments



Five years after Bret Victor's Inventing on Principle[1], it's crazy that there are not more coding environments that give new users a great out of the box experience with live reloading like this.

I started learning Clojure recently and had a bad experience configuring a development environment on the Mac. Leiningen threw “illegal reflective access” and “Unable to open cgroup memory limit” warnings that appeared to be related to an incompatible version of the JRE. I ended up fixing it (JRE downgrade, then upgrade after it was patched in Leiningen), but it was still a less than smooth introduction to a functional language compared with Elm, Elixir, or even Haskell.

The advice from many Clojurians to use Emacs is fine if you happen to use it anyway, but also seems particularly hostile to beginners.

Lightmod compiled all the demo examples without error for me.

I really want to explore Clojure and ClojureScript to build game servers and web games, and this project looks like a great way to get people using the language faster.

[1]: https://vimeo.com/36579366


I ran into that bug too. It's the first bug that I've encountered with Leiningen after using it for more than five years. Sorry that that was your first experience with the toolset, but it's far from the normal experience.

Also, if you're happy using an editor other than Emacs, then go for it. I use it but only because I've been using it for quite some time, and other than the fact that I like the way emacs indents Clojure source there's nothing special about it in the way that I use it. Visual Code has nice support for the language so that's a good option if it's more up your alley.

One area where I see Lightmod being really helpful is setting up the initial project. Learning what's going on w/cljsbuild, figwheel and then how to combine that with Clojure in the same project file isn't the simplest thing in the world to say the least.


Thanks for the tips and reassurance – it's good to hear that using Visual Code is acceptable; it's what I'm more comfortable in, and I'll persevere with it!


It would be really useful if VSC supported the Emacs indentation style: it’s what most people use in real Clojure code.

Paredit would be brilliant too (http://bit.ly/paredit if you’re not familiar)


It looks like there's an extension for paredit, but not sure how it compares to Emacs:

https://marketplace.visualstudio.com/items?itemName=clptn.co...

For formatting, I've been using this, which supports cljfmt:

https://marketplace.visualstudio.com/items?itemName=avli.clo...

And the rainbow brackets extension has made code more legible while I've been learning:

https://marketplace.visualstudio.com/items?itemName=2gua.rai...


You might also try Cursive[0], a full-featured plug-in for IntelliJ. You can use it free until you so something pro, after which it's about a hundred bucks. Many of the more well-known Clojurists seem to use it.

I believe that with Clojure, you owe it to yourself to have a first-class REPL.

I mostly use Emacs, but yeah, rabbit hole...

[0] https://cursive-ide.com/


FWIW, if you're on a Mac, the absolute fastest way to get Clojure/script going for exploration purposes is to use Planck, which is a CLJS REPL with a few batteries included, built on JavaScriptCore. (There's also Lumo, built on top of Node, and I think there might be a Linux port of Planck, FWIW.) It's seamless, and I actually use it for a lot of the same scripting tasks that one might use Python for.


I hadn't heard of Planck (I know it as an ortholinear keyboard!) or Lumo. Thank you for taking the time to mention them both – downloading to play with now…


There's a good cognicast[1] (podcast) with the author of this editor, he talks about the motivation of making such editors.

[1] http://blog.cognitect.com/cognicast/130


Difficulty with setup certainly is a huge pain point with me using Clojure, the amount of time I've spent wrestling with different libraries were just not working is way too high, and is probably the number one reason I don't use Clojure today. Clojure desperately needs something like Anaconda to simplify setup, this looks like it might help.


Really? Which libraries? Did you try using leinengen? One of the strengths of Clojure imo is how well everything JUST works as opposed to python, ruby, etc.


I tried using leinengen and boot, each had it's own issues. I remember spending many frustrating hours trying to get the live reloading to work.

I feel like a lot of the Clojure ecosystem is quite hacky, and if you can hack around in clojure you can work around many of the problems, but if you're a clojure novice each tiny hiccup is minutes to hours spent trying to figure just what is the problem.


I have had the opposite experience. Leinengen was trouble on it's own.


I have had the opposite experience. Clojure has been dead simple for me to set up on mac/linux.


On Mac, for me, even the process of getting java was more difficult than the entire setup process for some languages.

"Ok here's the download page for Java, ok, but I need the JRE too, right? Ok here's the JRE, but it's a different version than Java, is that a problem? Also didn't I remember there being some issue with the newest Java--can I use that yet or will it screw everything up again? Now that I've downloaded everything, do I, like, need to put them somewhere so they're in my path? Ugh and now I have autoupdaters for Java bugging me every few weeks?"

Python: "Download anaconda, install done"

Rust (which I just tried for the first time this week): "Download rust, done."


I agree installing Java is not fun, but if you use homebrew then the easiest way to install it on the Mac is: `brew cask install java`.


Thank you for telling me that, much easier than using oracles installer. It's still not exactly that easy since clojurescript does not work with the latest java so you have to do some finagling to get it to install java8 but still much easier.

I still maintain that java is the closest to malware a reasonable developer will put on their system.


Not to be confused with LightTable[1], an editor with Clojure live coding support.

[1] http://lighttable.com/


Is this still actively maintained? I haven't kept up with the project but my impression was the original creator moved on and left the project in the cold


http://witheve.com/deepdives/lighttable.html

The maintainer decided that a more fundamental change to programming was required to improve the experience as radically as they hoped.

They're writing a new language and literate programming environment called Eve:

http://witheve.com/

It's early days, but the language has some very interesting ideas so far.


Eve is - was, when I last checked - a poor reiteration of Smalltalk with a bit of CWEB bolted on top. You can get much more mature implementation if you just download Pharo, with the added benefit of Pharo being native, not browser-based.

Chris is one of very few people in tech that I genuinely dislike, because he managed to get me to believe in him and in LighTable, only to dump LT and make me feel stupid. LT was an ambitious project, promising to finally deliver something better than Emacs for working with dynamic languages and there was a chance of it being completed in this decade. Eve is a moving target and after two years it's not any closer to being a practical tool.

Personally, I need a modern, powerful editor, preferably polyglot, with tight integration with languages runtimes and Emacs-level scriptability - and that's what LT promised. It could have been a real, immediate improvement in how I work with code. Switching to Eve development is adding a gorilla and a whole jungle in fire to the banana we (LT backers) originally needed. Not to mention, Chris failed to complete a simpler project, I see no reason to believe he'll do a good job on Eve.

/rant


> A number of folks were upset by our decision to work on Eve in lieu of Light Table, but in reality, we were working on Eve to finally arrive at the LT we always hoped to have.

I must admit I was one of those upset that they "left" light table. Thank you for sharing the link to Eve


I love Light Table and used it all the time for teaching Clojure. Unfortunately the instarepl feature was moved into a separate plugin which increased the barrier to entry for new adopters: https://github.com/LightTable/LightTable/issues/2283

Happy to see any movement in this space because as far as I can tell, Clojure(Script)/DataScript/Datomic are the killer long-term web stack.


Highly appreciate Zach's Nightlight editor - it's one of the best Clojure editors around in terms of design, simplicity and ease on usage. https://sekao.net/nightlight/


For those looking for an out-of-the-box web app platform for Clojure you can checkout Solvent:

http://www.codesolvent.com/static-assets/gif-studio/lang-tes...




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

Search: