4 ms·
> it would not have been possible without these languages What critical features Clojure has, which don't exist in other platforms/languages?
by riku_iki 6y ago
> it would not have been possible without these languages
What critical features Clojure has, which don't exist in other platforms/languages?
- dustingetz 6y agoLisp + immutability is the right foundation for symbolic/logic programming, datalog, declarative programming, graph programming. None of this is really feasible in other langs due to bad ergonomics and no coordinated ecosystem buyin. Haskell lacks platform portability and Scala 2 is just too complicated to think clearly about anything high level.
- sitkack 6y agoTake a look at Elixir, it has metaprogramming and immutability while gaining the robustness and distribution that the Beam (Erlang VM) gives you.
- andrenth 6y agoFor the Beam there’s also Clojerl https://github.com/clojerl/clojerl https://github.com/clojerl/clojerl
- sitkack 6y agoI am astounded by the abundance of languages on the Beam, Gleam, LFE, Purerl, Lua and possibly many more. Have you seen Lumen, a Beam implementation in Rust that targets Wasm? https://github.com/lumen/lumen https://github.com/lumen/lumen
- andrenth 6y agoI had heard of it but never tried to use it. I hope at least some of those languages get enough adoption to become viable production choices. I feel, apart from Elixir, Gleam has the most “popularity potential” right now.
- sitkack 6y agoThe nice thing is that they all speak Erlang terms so you can mix and match them. Beam is such a wonderful VM!
- tome 6y agoWhat is "platform portability"?
- eigenhombre 6y agoMost things in Clojure can be found in other languages. However, Clojure has an especially stable and coherent design story, and is quite a bit better thought out than the other languages I've programmed in professionally. The pieces just work together really well, and there isn't a lot of "extra stuff" that only a die-hard specialist would know, or need to. (I currently work at a financial institution, not Nubank, that uses Clojure heavily.) A few other high points: - macro-based metaprogramming, familiar to any Lisp-er; macros are essentially functions which write code for you, which allow one to create extremely concise constructs to reduce repetition in code; - functional programming: probably the hardest thing to get one's head around if coming from a more mainstream language, FP reduces mutable state to a minimum, eliminating one of the biggest source of programming defects and making programs significantly easier to reason about. Additional concurrency-safe state primitives in Clojure makes concurrency a trivial addition to many programs; - hosted on the JVM, giving interoperability with Java libraries and significant ease of deployment compared to other dynamic languages (I recently went back to Python to roll out a small web service and was amazed at how much more painful the deployment/devops story was compared to our Clojure services). These are some of the benefits we leverage; other people here more qualified than me have enumerated others. (Plus Datomic, whose philosophy aligns fully with Clojure, though I have yet to use it in production.) On a personal note, one final attribute I appreciate is structural editing: as a Lisp, Clojure code is data, a feature which one's editor can make use of to allow operations that would be alien to non-Lispers, such as: absorbing nearby expressions or expelling them; splitting them; sorting and reordering; and writing your own automated refactorings without having to write parsers for the language in question. Treating code as data structures rather than strings of characters allows for speed in writing and refactoring code that is hard to give up once you get used to it.
- Nihilartikel 6y agoFrom my standpoint as a one man show, it's invaluable to be able to write the web client and backend in the same language, to share code between them... and have that one language NOT be JS. Clojurescript with Rum/Citrus or Reagent/Reframe deliver on the promise of React/Redux with much less fuss and overhead. Editing JSX is a pain in comparison to the Hiccup syntax used more often in CLJS, e.g. [:div {:class shiny} "some stuff" [:button "OK"]] - with the structural editing in any good Clojure editor you can cut, paste, entire blocks of tags, or slurp a tag from outside your div into it, or spit one out, all with a few keystrokes, never stopping to find some closing </div> tag.. I guess some JSX IDEs might do this, but it's really nice that the HTML is represented as just another piece of data, not some weird chimerical syntax bolt on. With Figwheel or ShadowCLJS hot reloading is instantaneous and doesn't even interrupt your webapp. If they're written properly, functions and the app state are not conflated at all, so you can modify any function in your app's rendering or behavior and as long as they aren't incompatible with the runtime state, it will just pop right into your browser. Illustrated well in this video where the author is interactively re-implementing Flappy Bird: https://youtu.be/KZjFVdU8VLI?t=277 https://youtu.be/KZjFVdU8VLI?t=277 I feel particularly strongly about this having started out doing front end work primarily in cljs but recently being falling into using React/Redux for a contract and being REALLY strung out by the tedium of working with them.
- mping 6y agoMy opinion is that clojure has a confluence of just right abstractions and language choices that allows you to be very very succint while still very readable which in turn makes the language very expressive. I can name a few features: immutability, multimethods, protocols, transducers, lazy sequences, macros, and a very small and sturdy core. All of these features exist in some other language, but the combination of them together is what makes clojure great IMHO. Besides, experienced clojure devs just see things differently and end up writing lots of nice libs that capture the essence of the feature the lib is providing. Think datomic (immutable database), reagent (interface to react), honeysql (data-as-sql), "dependency injection" (mount/component & others), pull/query-based UIs (om.next and its spiritual successor, fulcro) and so on.
- jwr 6y agoIn video compression, the advantage of a new standard over an old one is never a single "critical feature". It's a combination of small gains, single percentage points that accumulate to make a huge difference. If you look at H.264 vs MPEG-2, there is no single defining "critical feature", and yet you can get roughly twice as much video into the same bandwidth. It's similar with Clojure. Are transducers "critical" or revolutionary? Not at all. And yet they facilitate building composable and reusable pipelines, which helps me with modeling a complex problem domain. Is core.async "critical"? Hardly. And yet it allows me to build reliable asynchronous data flows. Clojure is a practical language, designed by someone with decades of experience in building complex systems.