Programming languages without garbage collection send us down a long path of design decisions that lead to slow compile times and fragile runtime performance cliffs.
-
-
Unfortunately, most languages missed this opportunity. The C family including C# and Java are overly imperative and lost variance due to wrongly-scoped mutability. And functional languages have generally chosen type systems lacking subtypes, covariance, and contravariance.
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
If you are happy with the cost of the indirect call, what stops you from creating this wrapper in a statically compiled language without GC on stack? I don't think these are related. The big issue *is* the indirect call, which can be prohibitively expensive.
-
If a subtyping relationship is implemented by a conversion like vector<t>(const vector<u>&) that works by holding a reference to its input, then the dangling reference issues will be explosive. This led C++ down the string_view path to distinguish epemeral things.
- 1 more reply
New conversation -
-
-
How is this different from Java etc (since we have no existing language to point to as an example)? And unless you have some impressive optimization in mind, this will end up ~10x slower than the highly specialized code C++/Rust emit, which is a high cost for "proper" subtyping.
-
And agree with
@Jonathan_Blow that specialization based typing is possible without excessive compilation cost or crazy errors (at least I am attempting so in http://strlen.com/lobster/ ). It can be super expressive without needing type classes etc. - 7 more replies
New conversation -
-
-
You're thinking in the context of a strict type system though. It's not entirely clear to me that we should bother, i.e. I am not persuaded (or more importantly, have seen strong empirical evidence) of the usefulness of overly strict enforcement of types in real-world code.
-
My experience with the value of strict typing is very different from yours!
- 2 more replies
New conversation -
-
-
I think that’s more a property of having a JIT than a GC. C++ and Rust can instantiate wrappers just fine, but they rely on monomorphization to get good performance. C# and Java can base everything on abstractions like IEnumerable because they can devirtualize hot paths on demand
-
it isn't a problem with 2020 Smalltalk and its VM, like in Pharo 8.0
End of conversation
New conversation -
-
-
You need gc for that? As opposed to managing reference to that wrapper?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.