2 ms·
Modular Interpreters and Visitors in Rust with Extensible Variants and CGP
- gavinray 1y agoThe idea of "Context-Oriented Programming" is really interesting. Recently, Kotlin has added this in the name of "Context Parameters", and Scala 3 has them as "given"/"using" traits. https://blog.jetbrains.com/kotlin/2025/04/update-on-context-parameters/ https://blog.jetbrains.com/kotlin/2025/04/update-on-context-... https://docs.scala-lang.org/scala3/reference/contextual/using-clauses.html https://docs.scala-lang.org/scala3/reference/contextual/usin... There are a bunch of practical applications for this sort of pattern, but the most generally useful ones are for framework-less Dependency Injection and for decoupling implementation-site details IMO. Happy to see this idea gaining popularity recently.