Show HN: Micro-mitten – Research language with compile-time memory management
&gt; This means that it maintains the ability to insert freeing code at appropriate program points, without putting restrictions on how you write your code.<p>How does the approach in mitten compare to Automatic Reference Counting in Objective-C (and I think Swift too)? From my experience, ARC can still add a surprising amount of memory management overhead to a program and needs a lot of hand-holding to keep that overhead down to an acceptable level (e.g. low single-digit percentage of overall execution time in programs that talk to Obj-C APIs a lot). I would be surprised if a &quot;traditional GC&quot; can do any worse in that regard (maybe reference counting smears the overhead over a wider area, e.g. no obvious spikes, but instead &quot;death by a thousand cuts&quot;).<p>One thing I&#x27;d like to see in modern languages is to encourage and simplify working with an (almost) entirely static memory layout, and make manipulations inside this static memory layout safe. This static memory layout doesn&#x27;t need to be magically derived by the compiler as long as the language offers features to easily describe this memory layout upfront.<p>A lot of data structures in applications don&#x27;t need to live in &quot;short-lived&quot; memory regions, but they often do because that&#x27;s what today&#x27;s languages either encourage (e.g. when built on the OOP philosophy), or what happens under the hood without much control from the code (e.g. in &quot;reference-heavy&quot; languages like Javascript, Java or C# - or even &quot;modern C++&quot; if you do memory management via smart pointers).<p>Minimizing data with dynamic lifetime, and maximing data with static lifetime could mean less complexity in the language and runtime (e.g. lifetime tracking by the compiler, or runtime memory management mechanisms like refcounting or GCs).