4 ms·
Clojure may be revolutionary, but the fact that it can't be compiled to run on other runtime systems (e.g. Go) is a bit of a disappointment.
by amelius 10y ago
Clojure may be revolutionary, but the fact that it can't be compiled to run on other runtime systems (e.g. Go) is a bit of a disappointment.
- sanxiyn 10y agoClojure can be compiled to run on other runtime systems. ClojureScript exists.
- amelius 10y agoYes, but all your tools and libraries break. You have to be prepared to exchange one ecosystem for another.
- harperlee 10y agoMmmh yeah but what is the alternative? To not have access to the JVM ecosystem? You could make an analogous argument for C not being portable, since it uses an ecosystem of tools and libraries that might not be portable to all systems.
- amelius 10y agoThe alternative is that the ecosystem itself is written in Clojure (or at least the most important parts of it). Of course, you will always have a set of points at which the language needs to call lower-level functionality, but you should keep that set as small as possible, to make the ecosystem easier to port. And in the modern "client/server" world, you really need this, because systems are often heterogeneous, and you often need to move one piece of code to another part of the system which runs on a different runtime.
- mapcars 10y agoCorrect me if I'm wrong, but ClojureScript is implemented from scratch and independently of "big" Clojure. If it is so - to run Clojure on other systems you have to implement everything, which makes no sense at all.
- kimi 10y agoI find it quite annoying that for a language that is meant to be "parasitic" there is no simple way to port it to any target. There are a few Clojures around that target e.g. C, but they are more "lookalikes" than the real thing. And ClJS is a separate codebase. It would be cool if Clojure was one and the same thing and then had a backend to support generic platforms - this way you would have ClojureJVM, ClojureNET, ClojureGO, whatever, with different levels of support and speed, but at least you could share the code. For example, maybe the Go version could have only :aot and write Golang sources.
- pjmlp 10y agoWell it only got reader conditionals in 1.7 and most libraries don't bother to use them yet, afaik.
- bad_user 10y agoClojure can compile to Javascript and .NET, so that's 3 major platforms, being among the most portable languages available. That it doesn't compile to Go, that's because Go isn't a good compilation target. Besides being a subpar language that ignored the last 30 years of research at least, it wasn't designed to be a platform for other languages. If you're looking for disappointments, you aren't looking in the right direction ;-)
- amelius 10y ago> Besides being a subpar language that ignored the last 30 years of research at least That is not really fair. As an example, Clojure itself is dynamically typed, which means it ignores a large chunk of research itself.
- pron 10y ago> Clojure itself is dynamically typed, which means it ignores a large chunk of research itself. It does not. PL research is about how to construct type systems if you choose to construct them. There's plenty of research in untyped languages, too (for a recent, pretty exciting example, see Dedalus, which is the language semantics at the core of Eve).
- StevePerkins 10y agoIn other words: (1) "I love functional programming! Therefore, newer languages that aren't following in the mold of Haskell are conceptually antiquated." ... yet... (2) "I don't care about static typing. Therefore, it's cool to ignore the trend of most major languages moving in that direction over the past decade." Then of course the Rust and Swift guys would tell you that Clojure is an anachronism for relying on garbage collection. Etc, etc... All of these trade-offs, at the level on which they're commonly discussed on HN and other forums, are matters of subjective preference. And that's okay. Disrespecting other communities for their subjective preferences, while trying to give it the objective veneer of "You've ignored the latest 'advances'!", is just pretentiousness.
- pjmlp 10y agoIt is a matter of implementation and tooling, not language. Anyone is free to create a native AOT compiler for Clojure. In fact many attempted to do so, but have given up due to the effort it means bringing a full eco-system up to speed to what Clojure already enjoys in JVM, .NET and JS runtimes, libraries and tooling. Specially in quality of generated native code and GC implementations.