Remix.run Logo
xoxolian 3 hours ago

Thanks for the link!

What would you say is missing from Clojure for large-scale OOP design? As I understand, Clojure gives you OOP a la carte. Objects (via maps/records/structs), polymorphic dispatch (via multimethods/protocols/case), types (via Malli/TypedClojure), inheritance (via derived, isa?, etc), some encapsulation (via defn-/^:private)...

chamomeal 3 hours ago | parent | next [-]

Not the person you're replying to, but have you tried TypedClojure? I've always thought clojure-with-types would literally be the perfect language, but I also read TypedClojure is more of a research project than a real language that you should use in prod.

xoxolian 2 hours ago | parent [-]

No sorry, of the things I've listed, I'd never seen nor heard of a project that uses Typed Clojure, nor probably inheritance via dervied/isa?.

For static (partial) typing, I instead use Malli schemas. I do this for every larger Clojure program I make, because there's always something that needs paranoia, or it's handy to generate example data.

gertlabs 3 hours ago | parent | prev [-]

I might just be a simpleton -- I never had the resolve to try an ambitious project in Clojure. I was not aware that you could get full OOP though, what you are describing feels like yes technically possible but kind of a hack to get inheritance / no type hierarchy enforcement. I'm no expert on the language though

bcrosby95 3 hours ago | parent [-]

I actually disagree. Once you remove the cruft and crap of the involved syntax, good OOP design tends to look damn close to FP design. So I flip your point of view - class based OOP is the hack - despite not really using Clojure or FP in my dayjob or hobby projects anymore. Most fun I had with OOP was definitely Common Lisp though.