What does HackerNews think of stalin?
stalin brutally optimizing Scheme compiler, with Debianization patches
Strange, I thought I have seen compilers for languages like BASIC for a long time. The first LISP compiler is from the early 60s: http://www.bitsavers.org/pdf/mit/ai/aim/AIM-039.pdf
Scheme compilers are from the 70s. Rabbit for Scheme: https://dspace.mit.edu/handle/1721.1/6913
> We conclude that ahead-of-time compilation is a viable alternative to interpretation of dynamic languages
Especially when the AOT compiler can be used incremental and the program can be extended/modified incrementally. See sbcl.
> The project then showed that it is possible to compile this dynamic language ahead-of-time to a native binary, using a statically typed language as an inter- mediate step.
This has been known for a long time.
For example Kyoto Common Lisp from 1985: http://www.softwarepreservation.org/projects/LISP/kcl/doc/kc...
Design and Implementation of KCL:
http://www.softwarepreservation.org/projects/LISP/kcl/paper/...
KCL has been morphed into newer implementations like ECL and CLASP (addresses LLVM) over the years.
Or CLICC:
http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=522...
Or Stalin for an attempt on a highly optimizing whole-program compiler for Scheme: https://github.com/barak/stalin
> Overall the project found that compiling a dynamic language ahead-of-time is a viable alternative to interpreting the language
See SBCL: http://www.sbcl.org
Many modern schemes (and similar languages like Racket and Clojure) have many optimization, use bytecode and jit compiling, so the abstraction overhead is not as big as in the naive versions. And you get nice code and powerful macros in exchange.
IIRC Stalin is faster than C in some benchmarks, but the compiling time is very big. "Stalin: a global optimizing compiler for Scheme" https://github.com/barak/stalin HN discussion: https://news.ycombinator.com/item?id=8214343 (85 points, 220 days ago, 70 comments)
"Running that image has equivalent semantics to loading the Scheme source file into a virgin Scheme interpreter and then terminating its execution. The chief limitation is that it is not possible to LOAD or EVAL new expressions or procedure definitions into a running program after compilation. In return for this limitation, Stalin does substantial global compile-time analysis of the source program under this closed-world assumption and produces executable images that are small, stand-alone, and fast."