Fork me on GitHub
James Amberger14:05:21

anyone know how to get rebel functionality in my shadow-cljs repl?


I have some queries. I have a huge react, typescript frontend and node,express,typescript based backend app. Thinking and attracted to convert that to clojure. Dreamed of smallest and smartest codebase as primary reason. Where can I discuss this?


This seems to be a huge undertaking. A good idea would probably be to first attack the backend and then the state management and backend communication/plumbing of the frontend, while keeping the react components as is (cljs libraries are good at using react components).


so first convert the nodejs side? so this won't be a javascript app anymore. why not just write the backend in pure clojure and not clojurescript then? the front and back only would have one thing in commont "json".


Yes, Clojure on the JVM.


So backend can be clojurescript but it can also be clojure. I wonder what might be the difference? I mean what could I do in clojure that cannnot be done in clojurescript or viceversa


You get the most bang for your buck if you focus on the parts that are about domain logic, information processing and plumbing out of Clojure.


what would be the fate and what are the recommended ways of doing this?


The recommended way is to use Clojure (JVM) on the backend. The libraries there are more mature and it's a paved way. ClojureScript on Nodejs is more of a niche thing and not the primary use case for ClojureScript. It can be done, I have done it too and many others. But not the recommended way.

👍 1

I see there are not many resources out that that explain these aspects.


I see. ok. so is there nutshell that would tell the brief difference? I know cljs runs on JSVM and cannot have what clojure can do.. What might be those things ?


why its not recommended to use clojurescript


I have many questions. What about query langauge. I use and didn't found clojure alternative for postgresql


also, json converstion etc..


There are two options you might like


one is Hugsql and the other is honeysql


they attack it from different perspectives - try them out a bit and see which one works for you.


You'll also need a server and a routing library. For the server I can recommend ring, for routing people use compojure or reitit.


There are other options but those I can recommend, especially if you're doing this the first time around.


I see. that was informative!


what are the limitations of clojurescript that are not in clojure and vice versa?


It's really more a library/ecosystem/tooling thing


There are little bits and pieces that are different but I wouldn't worry about it at this point.


The focus of ClojureScript is definitely frontend


So I can't run macros and advanced functions in clojurescript that belong to clojure?


so clojurescript is just like typescript to js? just a compiler?


what are other hickups that web developers face while using clojurescript and clojure respectively?


The main difference is really how they treat and interop with the host language and the tooling and libraries around that. Yes you can think of ClojureScript as something similar to Typescript.


any examples that clojure can do and clojurescript cannot or vice versa?


JS dont have types, I used Typescript for that. Is it likely to get into same issues with clojure/clojurescript? I know there are a couple of ways to handle this but is it needed? whats your point of view? types in clojure


I don't know how much you would agree with this


Ok, I guess I asked too much 🙂


It's more of a time thing! Some of these questions are really open ended and a bit vague. I suggest you start digging/playing/learning - then your questions become more crystallised, start a thread for a specific one and focus on one discussion at a time 😄


I can say something on types in Clojure though: I don't miss them in Clojure. There are languages that really make use of type systems and hinting and that's a good thing, but Clojure has a different focus and that is also a good thing. If you care about structural integrity and invariants of your data you can always write specs, they are more expressive than type systems, because they are arbitrary predicates, and you can do more with them than with types - but you don't get the same guarantees as with a type system.


Also they cover different use-cases, so it's better to think of them as their own thing.


This was informative again


Any comments about the video links I gave 🙂 ?


I meant the video about super powers of clojure/lisp


Eric Normand is well respected within the community. I haven't seen the video though.


The Norman video is 25 minutes to say Lisp is incredibly powerful, and that there are no libraries because you do not need them because Lisps are so powerful. Is our head spinning yet? His proposed solution is for everyone to stop leveraging the power, slow down, and work on libraries we do not need. Meanwhile, I have been writing Common Lisp and Clojure apps for twenty-five years, and in the rare case where I could not find a library I needed and did not want to write (OpenGL, GraphicsMagick, FreeType), I wrote the CFFI bindings to a C library, or worked out the interop with a Java library. Too easy?

🙌 2

@U0PUGPSFR I see. So which parts and notions you do agree with him and what not?


Is clojure as powerful as any other langauge like java or C++ ? You have been doing it for 25 years. There must be some reason for this consistency? I am really all the ears.


I agree that Lisp is super powerful, and that we can get by without libraries for things like parsing because we do not need Antlr; we can parse our own little DSL faster than we can download Antlr. I agree we lack the ability to work amicably with a herd of code camp graduates programming because they heard the money was good, and that Lispers squirm a lot in mindless daily standups. Btw, I once joked (a little) that first thing newcomers do when they discover Lisp is go write their own in C. Look at the subtitle of the video: "What happens when your language is so powerful that small, independent teams can solve their problems without libraries? Does everyone flock to it? Or do you just get a lack of libraries?" Where is the problem? That we have the language all to ourselves? Have you read Paul Graham's "Beating the Averages"?


"There must be some reason for this consistency?" Sorry, which consistency?


btw, this is fun, but I really do have to get on with pushing ReactJS into the sea today.


Ok, understood! thank you for the comments. as a side note, I landed to clojure in pursuit of a best or one of the best ROI (return on investment) language. Smartest, cleanest etc. I had to pick one... People often say there is no such thing. Just choose best tool for the job. Well was trying to see if a tool fits most jobs if not all. Hence a further ROI improvement.


btw, no libraries? Java has no libraries? Well, this is true if someone cannot be bothered to sort out Clojure/Java interop. They are not the Clojure audience. And if an entire company is looking at Clojure, do they not have one sharp developer who can be the interop whiz? #SeeTheMistake?


ya.. understood..


having you see my intentions, any information/ guidance from you would be highly valuable


I'll keep my eye out, but you'll get better support from the real Clojure developers. I am on loan from Common Lisp. Best of luck with the massive re-write.


Ok wonderful. If you do common lisp, what interest you have with Clojure? "Massive re-write"? what notions is behind that?


@U0PUGPSFR What difference did you found between common lisp and clojure? Any brief or detailed comments?


@U03E8B3CCTV "If you do common lisp, what interest you have with Clojure?" I look for jobs using Common Lisp or Clojure. Clojure has more. "What difference did you found between common lisp and clojure? " In both, every expression returns a value, we can write homoiconic macros, and the parentheses are in the right place. Otherwise, Clojure is a lisp-1 that runs atop Java, JS, or Dart. CL is a vastly bigger lisp-2 that compiles to metal so runs only on metal.


I see. @U0PUGPSFR it would be of great value if you compare clojure/lisp with other languages like java, javascript, C, C++ or any of your choice. With you years and years of experience of coding, culture, etc, it would be a lot different than what knowledge can be extracted from a blog or something on internet. I mean your words will be uncomparable.


And of higher value


Bu gangdang, @U03E8B3CCTV! 🙂 I found CL when C++ came out and looked ridiculous. Java is a syntax disaster, String tatic typing is a show-stopper. JS is getting better. I do not mind it.


ok, makes sense but what in the world is getting better in JS? The await/async? or OOP as wrapper for prototypcial inheritence or Typscript


TypeScript?! Remember what we said about strong static typing? I like Very sophisticated. And it is a lisp-1. btw, "what is getting better?" How long have you followed it? So how is your Clojure coding going?


While running mvn clean install on Clojurscript project getting error as Could not transfer artifact lein-cljsbuild:lein-cljsbuild:jar:1.1.7 from/to Internal nexus PKIX path building failed


what is the full error? could be that your java install is out of date and it can't verify the necessary ssl certs