logoalt Hacker News

zozbot234yesterday at 4:33 PM2 repliesview on HN

> infer or constrain the amount of copies and allocations a piece of code has

That's exactly what substructural logic/type systems allows you to do. Affine and linear types are one example of substructural type systems, but you can also go further in limiting moves, exchanges/swaps etc. which helps model scenarios where allocation and deallocation must be made explicit.


Replies

NeutralForestyesterday at 5:37 PM

I don't think it's been integrated in any mainstream language though.

show 2 replies
boltzmann-brainyesterday at 7:06 PM

do they allow the following? https://news.ycombinator.com/item?id=46859860