Skip to content

Comment on Contexts and Capabilities in Rust

Comments

A few thoughts:

* I strongly recommend to comparing against Racket's parameters which approach the same problem.

* It's a little weird that the solution to needing to repetitively pass arguments requires you to write a declaration that is just as much work as declaring a regular argument. You still have at the call sites, but meh.

* "Has zero runtime overhead; it compiles down to the code you would write anyway." My code would use global variables to avoid wasting registers to pass arguments that are used everywhere. But I'm guessing the code assumed here is the kind bloating every function call with more arguments? How does this look when Rust exposes a C ABI function with a with clause?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.