4 ms·
The main reason using the JVM for clojure seems a bit weird to me as an outsider is that from what I understand, the JVM will never use tail recursion, and pref
by saghm 4y ago
The main reason using the JVM for clojure seems a bit weird to me as an outsider is that from what I understand, the JVM will never use tail recursion, and preferring iteration over recursions is a bit strange for a lisp, and doubly so for one that values immutability so highly.
- jakebasile 4y agoOften recursion is fine and doesn't cause any problems. I just use 'reduce' or 'loop' if it becomes an issue. I've used Clojure for close to a decade. It's been an issue maybe once. The JVM is absolutely a plus for Clojure.
- medo-bear 4y agoits not that strange. common lisp also prefers iteration over recursion
- capableweb 4y agoThe main reasons for Clojure to use the JVM was (IIRC) twofold: Access to a large ecosystem where basically every idea has a library available already and being immediately productive because not needing to learn a new runtime (+ previous point of libraries already being available). With those two reasons in mind, at the time Clojure was created, it made a lot of sense to use the JVM.