Hacker News new | ask | show | jobs
by St_Alfonzo 2957 days ago
I think I can understand the struggle of the author. I experienced JS as a non-robust / fast-moving programming environment. Frameworks, Buildsystems and Language Features that change every few month. So when I first heard, that React is the new thing and everyone should use it, I did not want to use it. I use React now everyday and I really like it. But instead of writing it with JavaScript I use ClojureScript with a library called reagent(https://reagent-project.github.io/). So changes in JS or React aren't really my problem and CLJS seems to be a reasonably finished language. But I do not want to rate whether it makes sense to trade the weird React syntax for a Lisp.
2 comments

> and Language Features that change every few month

On the other hand, there was a period where JS devs could use one new language feature in a decade. And when it did come, it was ActiveX. (I'm exaggerating, but not by much.) From this perspective, it was kind of inevitable that at some point JS will overdo this and become a kitchen sink.

I tried using ClojureScript in its early days, but the JVM ecosystem was painful. I don't see a point in having very similar, but not 100% compatible languages on backend and frontend. Either you use the same language, or two different languages, in which case you can as well use something you like more on the backend.

Some time ago (a year or two, I think?) CLJS got bootstrapped - is it finally possible (and practical) to use with node only?

> I don't see a point in having very similar, but not 100% compatible languages on backend and frontend.

I have an applications consisting of frontend cljs code, backend clj code and some code that will be compiled to both ends (called cljc). Even if its not 100% compatible, I think its helpful that I only have to write data validation (e.g. clojure.spec) once and can use it in every part of the system. Also if you wrote pure algorithms for complex data structures, its nice to use it in cljs and clj. The parts that are missing to 100%, can often be bypassed with a simple reader conditional (https://clojure.org/guides/reader_conditionals).

> Some time ago (a year or two, I think?) CLJS got bootstrapped - is it finally possible (and practical) to use with node only?

I dont have much experience with this, but I think that shadow-cljs (http://shadow-cljs.org/) will make this mostly possible.

I tried a handful of times to get the same setup going but every part of the stack, from viable editor options, to the final output, is completely foreign to me. It's so much at once, I keep getting burned out after a day. Your comment has given me the urge again though :) It's going to click this time, I can feel it.
I'm glad that my comment gave you some motivation. CLJS also had a steep learning curve for me. There are a thousand different aspects to learn, but just start with a template or example app and try to understand everything step by step. Maybe the re-frame template (https://github.com/Day8/re-frame-template) will give you a good framework for building your first webapp. And if you get stuck, just visit http://clojurians.net/ - very helpful community. Good luck!