Hacker News new | ask | show | jobs
by pedrodelfino 1354 days ago
I kind of agree with you. I used to work with Common Lisp in a Desktop App (Nyxt browser). I had some fun playing with Racket. And I love Emacs. So, I am already into the Lisp idea. But, I was kind of disappointed with Clojure which is new in my life and has been used in my current job. Maybe you have a backend bias in your testimony?

I have been working with ClojureScript (re-frame and reagent) on front-end stuff and, unfortunately, the REPL does not seem to help me that much on my workflow. I miss the REPL driven development, by the way... The real "interactive programming" seems to happen on Chrome Dev Tools + Browser's reactions to Chrome Dev Tools tweaks on the UI + (lastly) changes on the source code via the editor (Emacs in my case).

Namespaces as prefix of invocations on the REPL are not that trustworthy on ClojureScript, apparently. It could also be that I am a noob and I missed something, so... How do you feel about ClojureScript?

4 comments

Don't know about your exact environment but I've structured my code so most of it is in .cljc files which can be evaluated in browser and on server. This allows me to evaluate/test/run things easily in the emacs repl.

For view code I think hot reloading has been a great thing with Clojure/Script too. Everything is reloaded properly and the state remains.

You can have a cljs repl as well, and you can open an alert in the browser from it like you'd do in the console
I have basically the same experience doing cljs dev that I do with clj dev, when it comes to being REPL-driven.

I know that the setup for cljs is a bit more involved and things will break sometimes (putting a browser in the loop will do that). I have dev tools open ... but I use it less and less, between hot-reloading and a data browser (portal or reveal) hooked up to the clojurescript repl I only use dev-tools stuff occasionally (the network tab is still very important of course).

It does sound like you are missing something, I'd try out one of the shadow-cljs example projects or walkthroughs to see what an example setup includes as features to see what you might be missing.

Have you tried Figwheel[0]? This is how I maintain a REPL into a browser-based CLJS application under development.

[0]: https://figwheel.org

I don't want to overstate my experience--I've used neither professionally. But I think it's true that the repl is better with Clojure than with Clojurescript. Cider with shadow-cljs is very nice but not quite as well-supported as vanilla. Plus, the very fact that you're producing code to be rendered by a browser pushes the work you do on the pure data level, where the repl really shines, towards the background.