22

J.M. Siskind's research statement states:

Stalin is an optimizing compiler for Scheme that performs whole-program static analysis and uses the results of that analysis to generate extremely efficient code. Stalin utilizes a large collection of static-analysis techniques. It performs a novel form of polyvariant flow analysis that uses iterated monovariant flow analysis to perform flow-directed splitting: cloning of specialized copies of procedures and per-call-site assignment of targets to such clones. It uses the results of flow analysis to perform life-time analysis, escape analysis, points-to analysis, and must-alias analysis. These analyses support a novel form of lightweight closure conversion that eliminates most closure slots, using techniques such as variable globalization and localization, compresses the static backchain, and usually eliminates most closures from programs. It also uses the above analyses to support flow-directed region-based storage management, where run-time garbage collection is replaced with static allocation and deallocation on a per-abstract-value and per-program-point basis. It also performs flow-directed lightweight CPS conversion, using extensions of the techniques pioneered with Screamer, to support extremely efficient first-class continuations. Finally, it supports flow-directed inlining and low-level representation selection to choose the implementation (or nonimplementation) of tags, tag checking, and tag dispatching on a per-abstract-value and per-program-point basis. This eliminates most run-time tags, tag checking, tagging, tag stripping, tag dispatching, boxing, and unboxing from programs. These analyses and optimizations allow Stalin to generate extremely efficient code that outperforms all other Scheme compilers by factors ranging between two and one hundred, particularly for numerically intensive code. Stalin often generates code that outperforms handwritten c and Fortran code.

I was able to find the following very interesting paper on closures/function calls implementation: Flow-Directed Lightweight Closure Conversion. I've also emailed the author to ask about the papers on the other topics, which are mentioned as to be written in the closure conversion paper:

Siskind, J. M. 2000a. Flow-directed lightweight CPS conversion. In preparation.

Siskind, J. M. 2000b. Flow-directed polyvariance. In preparation.

Siskind, J. M. 2000c. Flow-directed representation selection. In preparation.

Siskind, J. M. 2000d. Flow-directed storage management. In preparation

Unfortunately, he never got around to writing those papers. My question to you is: are there any alternative or related papers that cover these topics? I'm very interested to learn how Stalin (or other compilers) can compile such a high level language as Scheme that is garbage collected, dynamically typed, supports first class functions, and even first class continuations, can be statically compiled to such efficient code.

Community
  • 1
  • 1
Jules
  • 6,318
  • 2
  • 29
  • 40
  • 10
    I wonder, why the close votes here? – SK-logic Jan 14 '12 at 09:54
  • Maybe some people think it's a joke because of the title? More likely, they think it's too theoretical. I disagree. – Tikhon Jelvis Jan 14 '12 at 09:57
  • Probably because the question is better suited for the cstheory stackexchange. – erjiang Jan 14 '12 at 21:23
  • 3
    I considered posting it to cstheory, but decided against it because cstheory is generally more focused on theory. Also, compilers questions are uncommon there (10 questions under the compiler tag, and some of them are closed as off topic). Though if the consensus is that this question is better suited for cstheory, then I will happily move it there. – Jules Jan 14 '12 at 21:41
  • Half the close votes are to move to programmers.SE. Seems like it better fits here. – derobert Jan 15 '12 at 07:52
  • 3
    @derobert: well, I don't quite see why programmers.SE. At least cstheory seems more likely to be a good fit... *if SO is not*. – Matthieu M. Jan 15 '12 at 12:25
  • @MatthieuM. I can't figure out why, either. – derobert Jan 15 '12 at 18:33
  • I wonder if the closers can explain why this question is off topic for Stack Overflow? Especially given that the amount of upvotes greatly exceeds the amount of close votes. I know that this is not a "How do I connect to a database in PHP"-type question, but compilers seem perfectly on topic for SO? – Jules Jan 16 '12 at 11:32
  • 2
    @Jules - popularity is not a measure of whether the post is on topic or not. Where's the code? What's the problem you are facing here? – ChrisF Jan 17 '12 at 13:58
  • 2
    @ChrisF: For a community-*run* site, popularity should be the only metric for a topical post. – Paul Nathan Jan 17 '12 at 18:28
  • 1
    @ChrisF: The code for the Stalin scheme compiler is here: ftp://ftp.ecn.purdue.edu/qobi/stalin.tar.Z Unfortunately, understanding something as complicated as such an advanced compiler from the code alone without the background knowledge from the papers is almost impossible (the fact that you can publish a paper on such a description in means that understanding it at all is non-trivial). I honestly don't understand why somebody would consider this area (compiler development) off-topic for SO, hence why I asked people to explain. Then perhaps in the future I can better avoid off topic posts. – Jules Jan 17 '12 at 19:59

1 Answers1

4

R. Kent Dybvig's publications list.

Edit: A good introduction to Chez Scheme is his ICFP presentation and the paper that went along with that. Some of the papers relate to Scheme specifically (macros, multiple-values, continuations) and some are more broadly applicable (Register Allocation Using Lazy Saves, Eager Restores, and Greedy Shuffling).

erjiang
  • 44,417
  • 10
  • 64
  • 100
  • 1
    Anything in particular that applies to optimizing Scheme compilers? – okonomichiyaki Jan 14 '12 at 21:11
  • 2
    Yeah I did, and some titles are obviously not related to optimizing compilers while others might be but I'm not sure where a good place to start is. I wasn't trying to be snarky, I was genuinely curious. Is there a single paper that you think would be a good start? – okonomichiyaki Jan 14 '12 at 21:43
  • He's behind Chez Scheme, which is actively developed, and most of his papers relate to optimization or macros. I've updated the answer with some links. – erjiang Jan 14 '12 at 21:59
  • 4
    The optimizations in Stalin go far beyond what Chez is doing, or anything else. The main trick starts with it being a *whole*-program optimizer -- as such, it can do things that sane compilers can't. (But also the resulting language is severely restricted, since you can't compile different parts of the code separately.) – Eli Barzilay Jan 14 '12 at 22:39
  • 1
    Here's one of the newer optimization papers: http://www.cs.indiana.edu/~adamsmd/papers/fast_flow_sensitive_cfa/ – erjiang Jan 15 '12 at 18:21