3 ms·
This is obviously a bit of a rant, and intended as such, but it’s really well thought through and well-argued too. I haven’t seen this distinction laid out so
by iainmerrick 2y ago
This is obviously a bit of a rant, and intended as such, but it’s really well thought through and well-argued too.
I haven’t seen this distinction laid out so clearly before:
Every other language worth being so much as spit on either employs deep garbage collection (Go, D, Java, Lua, C#, etc.) or automatic reference counting (Objective-C, Objective-C++, Swift, etc.), uses RAII (Rust with Drop, C++, etc.), or does absolutely nothing while saying to Go Fuck Yourself™ and kicking the developer in the shins for good measure (C, etc.).
GC, ARC, RAII or GTFO, those are the options. That’s right!
I always come away from these discussions with more respect for Objective-C -- such a powerful yet simple language. I suppose Swift is the successor but it feels very different.
Although, Obj-C only really came into its own once it finally gained automatic reference counting, after briefly flirting with GC. At that point it was already being displaced by younger and more fashionable languages.
- OskarS 2y agoI would say there are two more esoteric options: "no memory allocation at all outside of the program stack" (like... i dunno... lambda calculus?) and fancy-pants computer sciency things like linear types. No sane language does either of those, though.
- iainmerrick 2y agoGood points! I tend to think of linear types as a more general kind of RAII -- like there's a spectrum that goes RAII -> borrow checker -> linear types -- but maybe it does warrant its own category.