Hacker News new | ask | show | jobs
by logicchains 7 days ago
>Why not just improve lean and its libraries so that it becomes a standard big-software language like Go/Java/Rust ?

Lean wouldn't be able to match Rust in performance without a fundamental restructure of its core calculus.

1 comments

  > Lean wouldn't be able to match Rust in performance without a fundamental restructure of its core calculus.
Why so?
To support in-place mutation and avoid unnecessary memory allocation, it would need some form of linear/uniqueness types, so the language can know when no other references to a type exist so it can be updated in place via mutation. Right now Lean achieves decent performance via https://xnning.github.io/papers/perceus.pdf , but it can't match what Rust can achieve.
Two things

Lean is garbage collected and you don't control the layout of types in memory (and everything is boxed)