2 ms·
I believe automatically inferring lifetimes in the general case is equivalent to solving the halting problem (for every sub-program, determine if a given refer
by KMag 4y ago
I believe automatically inferring lifetimes in the general case is equivalent to solving the halting problem (for every sub-program, determine if a given reference is stored to the heap before the sub-program terminates), so transipiling JS to Rust would presumably need manual lifetime annotation or else require significant limitations to simplify lifetime analysis.
- kaba0 4y agoRust’s lifetimes can’t express arbitrary lifetimes, only “stack-like” ones. Other kinds are very frequent in managed languages and are only possible to deal with due to the GC.