News for hackers. Stuff that matters.
Re:Modula-2 Reloaded – A Modern Typesafe and Literate Progra... by Animats on Monday December 28, 2015 @04:11PM (#10803417)
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.

Re:Modula-2 Reloaded – A Modern Typesafe and Literate Progra... by cbd1984 on Monday December 28, 2015 @05:14PM (#10803717)
> 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.