r/ProgrammingLanguages • • Jul 23 '26

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

61 Upvotes

127 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jul 23 '26

[removed] — view removed comment

1

u/faiface Jul 23 '26

I don’t think I fully understand it. Your type `A -> b -> c -> d` reads to be like “receive a, receive b, receive c, send b”. So then sure, if I call it, I have a proof that I am in the next stage of the protocol. But if I don’t call it? The other side never gets to see my A. Or am I missing something?

Linearity, as far as I understand, has to be a fundamental property of the type system. The type checker needs to complain “you haven’t called f, but it was required!”

2

u/[deleted] Jul 23 '26

[removed] — view removed comment

1

u/faiface Jul 23 '26

I see. But still, what if I just drop the whole object and never use it. That’s not accounted for here, or is it? Afaik, your approach tells a lot about what I can do, but not what I must do. Linear types tell what you must do.

1

u/[deleted] Jul 23 '26

[removed] — view removed comment

1

u/faiface Jul 23 '26

I don’t understand :D Is it supposed to address the “I never even touch the object” problem?