MzScheme is surprisingly complicated

I first played around with scheme a few years ago -- enough to get the hang of things like macros and continuations -- and it struck me as a very small, elegant language. But for the last couple weeks I've gotten deep into MzScheme, and I'm coming to realize that it's actually quite complicated.1

The first thing I noticed is that once you go beyond syntax-rules, macros start getting quite involved. There's syntax objects (because s-exps can't store all the info you want to keep track of), certificates (which address subtle interactions between macros and modules), rename transformers, the ability to overload function application, the ability to inspect the lexical scope of the call site, and more.

Then I came across continuation marks, which I don't really understand the need for, other than taking the documentation's word for it that they're important for error reporting and debugging.

Next up was custodians. The nearest analogue that I know of from other programming languages is Java's SecurityManager, except that MzScheme already has "security guards" for that. A custodian is more like a cross between a subshell and the unix quota command -- it can kill a whole batch of things all at once, and it can restrict their total memory usage, as well.

[1]: My motivation for digging into MzScheme is that I'm trying to get familiar with the FrTime code, which implements a scheme-like language with data-driven dataflow semantics. Because it's based on MzScheme, and because the language it implements is more or less a superset of scheme, understanding FrTime requires understanding many of the nitty-gritty details of how MzScheme works.

Posted on September 23, 2005 12:57 PM
More languages articles

Comments

If you're interested I can elaborate some of the need and use of continuation marks and custodians. The paper by Clements on the Stepper talks about the marks. The paper on the web server talks about custodians, and they are remarkably similar to the idea of Resource Containers by Druschel at Rice.

Also, FrTime is made by a Brown student, Greg Cooper, you should stop by his office if you're interested. And it is heavily influenced by Haskell's FRP module

Jay

Posted by: Jay McCarthy at September 24, 2005 04:56 PM
Post a comment









Remember info?




Prove you're human. Type "human":