5 ms·
Do any of the languages that are popular today have object systems that are as powerful and flexible as CLOS?
by pmoriarty 3y ago
Do any of the languages that are popular today have object systems that are as powerful and flexible as CLOS?
- messe 3y agoJulia, perhaps? Although calling it popular is a stretch maybe. Its multiple dispatch system is even more ingrained to the language than CLOS (all functions are generic by default). It's very much a Lisp in Matlab's clothing.
- cmrdporcupine 3y ago... ish? There's a lot of furniture that's bolted into Julia's runtime in terms of task management and so on, that isn't really like a Lisp runtime? It doesn't have that same "It's Turtles All the Way Down" self-consistent vibe that a Lisp has. On paper Julia looks like a great piece of kit. Once I worked in it professionally for a couple months, it started to leave a bad taste in my mouth.
- pjmlp 3y agoJulia, as answered on the sybling comment. Clojure has a subset, and I guess Racket is quite flexible with its language modeling framework. Going on an edge, C++ is also quite flexible when one looks beyond of plain classes, and combines them alongside type parameters in templates, and compile time reflexion via template metaprogramming and concepts (although it is quite clunky).
- deleted 3y ago[deleted]
- drnewman 3y agoRuby has a meta object protocol. The net effect of the language isn't as powerful as Common Lisp since you don't have code-as-data in method definitions, but Ruby's object system is comparably powerful as CLOS (though made in the image of Smalltalk) it comes with a meta protocol for methods, objects, classes, modules, even lexical variables. https://ruby-doc.org/3.2.2/Object.html https://ruby-doc.org/3.2.2/Object.html https://ruby-doc.org/3.2.2/Method.html https://ruby-doc.org/3.2.2/Method.html https://ruby-doc.org/3.2.2/Class.html https://ruby-doc.org/3.2.2/Class.html https://ruby-doc.org/3.2.2/Module.html https://ruby-doc.org/3.2.2/Module.html https://ruby-doc.org/3.2.2/Binding.html https://ruby-doc.org/3.2.2/Binding.html