2 ms·
I remember reading about this project first in 2014-ish, how long has this been going? Seems like this is a ton of work, only to be able to encode constraints t
by jstimpfle 4y ago
I remember reading about this project first in 2014-ish, how long has this been going? Seems like this is a ton of work, only to be able to encode constraints to maintain correctness and performance like you can in a memory unsafe language. The latter has always allowed to "postulate" dropping identity by value copy and to encode 1 to 1 relationships by direct embedding.
I think I've been corrected in the past, where someone pointed out that managed languages don't have to be like that? What are existing approaches that allow for better control than traditional Java offers while retaining a convenient syntax?
Concerning the languages I know -- memory managed, reference only models always come with the possibility of indirection at every turn due to not having the distinction between dereference and member access (not in the syntax and not in the semantics). It's very hard to infer from the code if a dot operation is an injection, mathematically speaking. I believe that is the reason why I've always felt "safer" and more precise in memory unsafe languages.
I also think that some of the newer languages are misguided to hide the distinction by using dot syntax for both.
- kaba0 4y ago> come with the possibility of indirection at every turn due to not having the distinction between dereference and member access Most managed languages don’t expose the location of an object, only its semantics. With optimizations (escape analysis), an object can be allocated on the stack and thus only effectively make member accesses. This optimization can be done much more deterministically with value types — if an object looses identity then the runtime/compile time doesn’t have to reason about whether it leaves the function/loop, it is free to copy it in/out of functions as often as needed. As for preferences, it makes sense in low-level languages, but imo hiding it is the correct choice on a higher level — this is a core benefit of GCs, e.g. your public APIs will be much more maintainable/won’t need refactors because they don’t expose low-level implementation details (where should that argument be stored), only its semantics.
- pjmlp 4y agoNote that using dot syntax across records and pointers is as old as Mesa and Ada.