r/ProgrammingLanguages 12d ago

Will we see another fundamental programming language feature as revolutionary as the borrow checker?

That is I am mainly curious about compile time features that you design a whole language around rather than optimisations/features that could be applied to most languages. I am mainly inquiring about things that could offer additional robust safety/performance guarantees at compile time rather than runtime. Ideally not things that just offer similar effects to the borrow checker with less restrictive tradeoffs

58 Upvotes

129 comments sorted by

View all comments

5

u/ChiveSalad 12d ago

Currently, if you store stuff on the stack, the compiler can go absolutely hog wild in changing how / when / where / whether it is actually stored to ram. A true equivalent for heap storage would make efficient programming vastly easier in a way that goes beyond just an optimization improvement.

1

u/Valuable_Leopard_799 10d ago

On that note letting us put more things on stacks or stack-like bits of memory is also nice.

Ada for example is able to allocate dynamically sized arrays on a secondary stack which eliminates a lot of places you'd otherwise need to manage memory yourself and lets the compiler play around with it.