Live data from Hacker News

ClojureScript 1.10.844

clojurescript.org

21–30 of 74 posts

Re: ClojureScript 1.10.844

#21

Since this thread/Clojurescript is getting some love I'd like to express something to a hopefully receptive audience: There was a point where Clojurescript and Javascript sort of walked hand-in-hand during the advent of when React started to make sense in the minds of the community[0]. It felt really exciting because of the cross pollination that was happening between the two languages, Redux felt very familiar, and…

My impression is that CLJS, while an amazing way to write frontends with react, suffered from an incomplete/fractured tooling ecosystem, with the official maintainers leaning on the community to develop the 'batteries' and several good but incomplete and unofficial solutions being offered (lein-cljsbuild, figwheel, boot, etc).

I'm not actively involved with CLJS development anymore but last I checked that still continued, with tools like figwheel/deps.edn/shadow-cljs all sort of doing similar things differently, and there being good-but-not-as-good-as-clojure support in different editors like emacs, intellij and vscode. Similarly, there were a number of different, but still alpha quality ways, to use cljs with react native, all suffering from some major pain points.

Re: ClojureScript 1.10.844

#22

Since this thread/Clojurescript is getting some love I'd like to express something to a hopefully receptive audience: There was a point where Clojurescript and Javascript sort of walked hand-in-hand during the advent of when React started to make sense in the minds of the community[0]. It felt really exciting because of the cross pollination that was happening between the two languages, Redux felt very familiar, and…

My impression is that CLJS, while an amazing way to write frontends with react, suffered from an incomplete/fractured tooling ecosystem, with the official maintainers leaning on the community to develop the 'batteries' and several good but incomplete and unofficial solutions being offered (lein-cljsbuild, figwheel, boot, etc). I'm not actively involved with CLJS development anymore but last I checked that still conti…

I shared a similar opinion a while ago, but lately (last two years perhaps?) the general consensus is pretty much shadow-cljs which has stellar support for node modules. shadow-expo also integrates with RN effortlessly.

Cursive is really good at handling cljs too, with jump-to-definition and refactoring without using a REPL

Re: ClojureScript 1.10.844

#23
post #2

A bit of an obvious question Elm, Typescript and Purescript all offer Javascript + Types Clojurescript is dynamic, beside the lisp syntax which is arguably cleaner, and offer some nice advantages like homoiconicity What is the real advantage of Clojurescript (?)

The benefits of using Clojurescript over JS/TS in 2021 are superficial and not worth it IMO. Typescript is great, has good tooling and plays nice with the JS ecosystem. With Clojurescript you spent more time fighting integration with the JS ecosystem than getting any real work done. The mismatch between JS objects and Clojurescript data structures is annoying and tedious and riddle with performance issues, and Clojurescript in general has many performance issues.

Re: ClojureScript 1.10.844

#24
post #17

Earlier quoted context omitted.

The question is funny because on the the list of advantages that Clojurescript offers the syntax / language is quite low on the list imo. Clojurescript has the best client-side build tool I have used in https://shadow-cljs.github.io/docs/UsersGuide.html and everyone uses it. Clojurescript targets/outputs Google Closure compatible code which is easily the most sophisticated JS compiler out there. The reason no one use…

Sorry for what might be an obvious answer, but when you say >because the standard clojurescript library has everything+ do you mean bc it has all those libraries incorporated, or bc it's able to emit the equivalent to native javascript?

Immutability is baked into ClojureScript, so there’s no need for libraries like Immutable.js. Likewise, ClojureScript is all about manipulating a small set of code data structures (lists, vectors, maps, etc), and as such it has an extensive (!) set of functions built into the core language for doing just that, which eliminates the need for libraries like Ramada and Lodash.

Behind the scenes ClojureScript is transpiled to pure JavaScript with Google’s Closure compiler, so there’s no external dependencies on libraries like the ones mentioned above. It’s all just built into the language.

Re: ClojureScript 1.10.844

#25
post #16
post #6

For those with experience, would you say that ClojureScript for frontend stands on its own without a Clojure backend?

It depends on what kind of project you are using it for. Hobbyist/toy project - sure, using shadow-cljs you can do your front end entirely in ClojureScript and make calls out to whatever backend you want Professional project with ClojureScript backend - sure, you can use shadow-cljs to target both node (using :node target) and the browser which will allow you to utilize ClojureScript for full stack and not have to re…

> Professional Project with non-clojure(script) backend - no.

Allow me to offer a contradicting point of view. On my last project we used Elixir on the backend and Clojurescript (with re-frame) on the frontend.

Best decision we've ever took. We were orders of magnitude more productive than we would've been with Javascript. And we were all beginners to Clojure at the time.

Re-frame is a beast. Not having to deal with Javascript and its ecosystem is an absolute relief. Once you use Hiccup for the first time, you'll never want to use JSX ever again.

So yeah, if it's a new project in my opinion it is worth exploring Clojurescript, even if you don't plan on using Clojure.

Re: ClojureScript 1.10.844

#27

Since this thread/Clojurescript is getting some love I'd like to express something to a hopefully receptive audience: There was a point where Clojurescript and Javascript sort of walked hand-in-hand during the advent of when React started to make sense in the minds of the community[0]. It felt really exciting because of the cross pollination that was happening between the two languages, Redux felt very familiar, and…

Also: cross pollination is still happening as libraries like Recoil implement some of the ideas sitting in Reframe for vanilla React. On the ClojureScript side, I would like to see more projects integrating with platforms like Nextjs and Gatsby.

There is nothing that says ClojureScript can’t be used on the server side and integrate with the platforms you mentioned. It’s likely just a matter of writing wrapper libraries similar to what was done for many Java libraries.

The hard part is that most Clojure devs default to using the JVM server side so there’s not much appetite there to do the work to embrace JS server side frameworks.

Re: ClojureScript 1.10.844

#28
post #7
post #2

A bit of an obvious question Elm, Typescript and Purescript all offer Javascript + Types Clojurescript is dynamic, beside the lisp syntax which is arguably cleaner, and offer some nice advantages like homoiconicity What is the real advantage of Clojurescript (?)

For me, the primary advantage has been the ecosystem. Reagent and re-frame have been awesome since Day 1, even as react has tried to play catch-up with hooks etc.

Very interesting take from re-frame's author regarding React Hooks (and why it ultimately doesn't matter that hook-based components are not very popular on CLJS): https://github.com/day8/re-frame/issues/590#issuecomment-624...

Re: ClojureScript 1.10.844

#29
post #2

A bit of an obvious question Elm, Typescript and Purescript all offer Javascript + Types Clojurescript is dynamic, beside the lisp syntax which is arguably cleaner, and offer some nice advantages like homoiconicity What is the real advantage of Clojurescript (?)

For me the real advantage is the shared information model with the backend that is trivial to serialize/de-serialize with something like transit-clj(s). It's like the benefit of js/node but with richer data structures: keywords, symbols, sets, maps with arbitrary keys, instants, uuids and extensibility via tagging. JSON is great, but EDN is so much better!

Re: ClojureScript 1.10.844

#30
post #6

For those with experience, would you say that ClojureScript for frontend stands on its own without a Clojure backend?

On a related vein, is cljs viable for PWAs and purely static front end only apps?

I would say so, I have implemented a pwa https://djblue.github.io/portal/ hosted via github pages for people to browse through their data-structures. You can also connect the ui to a live host and send it data directly with tap> (kinda like console.log in js).
Post reply on HN