3 ms·
>Providing a way of writing portable Clojure code is the motivation for reader conditionals.* Yes, this is a great idea. Reader conditionals are available in C
by flavio81 9y ago
>Providing a way of writing portable Clojure code is the motivation for reader conditionals.*
Yes, this is a great idea. Reader conditionals are available in Common Lisp as well, however in CL, unlike Clojure, there is a big (some would say huge) standard library available, so when you find reader conditionals in CL, it is usually because the code uses a very specific implementation-dependent feature like sockets or C interface. In Clojure, the language spec and 'standard lib' is small, thus Clojure libraries often rely on Java libs for many tasks. This often can prevent Clojure code from running straight away on ClojureCLR.
More than reader conditionals, Clojure needs a "batteries-included" standard library for successfully becoming a language that can produce portable code.
- grzm 9y agoCertainly having more portable libraries available is a good thing. With the adoption of reader conditionals, people are increasingly writing portable (granted, mostly clj/cljs) library code. I think it's fair to say that, in part, the many years the CL ecosystem has on Clojure contributes to the larger CL standard library, as well as different language goals. You acknowledge that CL also uses reader conditionals for implementation-dependent features: one difference between Clojure and CL is where the line is drawn as to what is considered implementation-dependent. Clojure is 10 years old. According to Wikipedia, work on CL started in 1981, 36 years ago. It's not my goal to convince you that Clojure is equivalent to Common Lisp. I do think you're being unnecessarily harsh in your characterization of Clojure with respect to Common Lisp and faulting it for features that the designer consciously chose to embrace, not through lack of thought. Having a preference for a language is great. Let's try to keep things in perspective, however. I'll sign off now as this looks increasing like a language war rather than a reasoned discussion.
- flavio81 9y agoNo, i'm not wanting to raise a language war; i just want to point out which direction Clojure should follow to keep improving.