Hacker News new | past | comments | ask | show | jobs | submit login

It's hard for me to tease apart the differences between Rye "first class context", deprecated JS "with" statement, Scala/Idris/Agda implicit arguments, and I guess also just effect systems generally?

it feels like there're all features for ergonomic dependency injection, but maybe that's a lot of programming




There are differences in the details. JS with is much less powerful than implicit arguments or effect systems. The basic concept is similar; all deal with dynamic scoping in some way.

Effect systems can change control flow (that's the point of many effects, such as exceptions) so they require capturing continuations.

Implicit arguments usually have compile-time search / composition.

Rye contexts seems like they have neither of the above, but I've only skimmed through the description.


A "with" statement can't redefine control structures in JS or any of those languages.

See SICP 4.1 definition of "eval", this is more like reifying "env" to the function being evaluated.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: