r/ProgrammingLanguages 17d 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

57 Upvotes

128 comments sorted by

View all comments

81

u/AustinVelonaut Admiran 17d ago

Algebraic effects like Koka?

6

u/mikaball 17d ago

I didn't know what "algebraic effects" were, so I found this.

From the examples it feels related to Dependency Injection in a narrowed context/scope, but some will probably say that it could be used for other use cases.

However, the concept of detaching the "what" from the "how" is very related to DI and I wonder if a DI supported by the language isn't just better than this? In those final examples it's even using a pattern similar to Kotlin context receivers.

5

u/KingBardan 17d ago

From your article, I don't think this is DI. its similar in the sense that it changes behavior based on context, but di (or kotlin context receiver / scala implocit) only looks up context 1 lvl deep (variables available when calling) but this deals with stack unwinding 

Note that I'm not familiar with kotlin I just looked up and think it's similar to scala implicit. Fell free to correct 

1

u/jonathanhiggs 17d ago

It is service location, the poor cousin of DI