2 ms·
It's a good idea, 20 years too late. We should have had this in 1995. At this point, just getting programmers to write BEGIN and END will be a struggle. Memo
by Animats 11y ago
It's a good idea, 20 years too late. We should have had this in 1995. At this point, just getting programmers to write BEGIN and END will be a struggle.
Memory allocation needs to be addressed better. There seems to be a NEW, but no mechanism for deletion. (Wirth did that in Pascal. It didn't work out well.) Is this language garbage-collected?
For memory allocation, these are the known options:
- Garbage collection (scripting languages, Go, LISP, etc.) - safe, but causes stalls.
- Reference counting - (Python) safe, but can leak if you have loops. Usually adds overhead. May need a GC as a backup.
- Single-ownership without borrow checking (C++11) - partially safe, errors can be detected at run time, but this is not guaranteed.
- Single-ownership with borrow checking (Rust) - safe, complicated at compile time, but works.
- Region allocation (Ada) - used in some real-time systems. Rare.
- Manual deletion (C) - unsafe, leads to many bugs.
The manual option is probably unacceptable at this late date.
- cbd1984 11y ago> Region allocation (Ada) - used in some real-time systems. Rare. Equivalent to solving the halting problem unless you're writing toy software with extremely well-defined inputs and outputs. Good for device drivers, maybe, but not in the general case.