Hello Clojurians,
Brief introduction:
I am Ravi, primarily a backend engineer from the Java/JVM verse. Primary language is Java and have dabbled in other JVM languages like Groovy, Kotlin, Scala. New to Clojure, like brand spanking new, like ran into it this week new. And so far, I love it, even though the syntax made my head hurt for first few hours and still does from time to time :D. I have spent some time (like say 10-20 hours) going over Richard Hick’s videos, tutorial, Clojure for the Brave and True book. I primarily got interested because I am working on NodeJS / Javascript / Typescript project(s) and sometimes I can’t find my own code readable. Clojure though on the other hand, looks simpler.
Here’s my very nooby questions (so please be gentle):
a. I have a pet front-end project (JS, TypeScript, NodeJS, Firebase, Quasar/Vue). I am thinking about starting to write new code in Clojure JS, and so to integrate it I started with https://github.com/thheller/shadow-cljs. I followed the instructions there but found the JS file spit by the project to be huge just with a hello world function in it. I was expecting it to be a simple small JS file. I have read that that’s because CLJS (100K + line of code is) is packed in? If we are compiling to JS, then why do we need CLJS?
b. Would you advise writing some (helper) functions in ClosureJS and using it in JS? I am afraid the size of the JS file will be too big and it might not be advisable/smart to intermix JS code and CLJS code vs writing everything in CLJS and compiling to JS.
c. I am using Quasar (https://quasar.dev/) and love it. Are there similar frameworks in Clojure JS? I came across Reagent / Reframe but not sure if they have already provided components that look as beautiful / well laid out. I am a newbie to the front end so I don’t have mad CSS skills like other folks to beautify Reframe/Reagent.
d. I understand there are lot of benefits from functional paradigm and immutability etc. But purely from a performance point of view, does CLJS end up being slower / equal / faster than vanilla JS?
e. I am reading Clojure for the Brave and True book and find it to be excellent. Any other resources you would like to share to learn Clojure. Should I learn Clojure first and then ClojureJS?
I understand these are a lot of questions. So I don’t mind asking them individually via individual posts.
Thank you in advance for your time and effort in helping me.
Regards,
Ravi Hasija