4 ms·
What is the most advanced compiler, across all high-level (not C/C++) languages? The GHC?
by ced 16y ago
What is the most advanced compiler, across all high-level (not C/C++) languages? The GHC?
- ori_b 16y agoFrom what I've heard, probably MLton.
- ced 16y agoCan you explain why? Neither their webpage nor Wikipedia goes much beyond "produces fast executables".
- jules 16y agoI found this description of the passes and intermediate languages used in mlton: http://mlton.org/CompilerOverview http://mlton.org/CompilerOverview Another candidate for the most advanced compiler is Stalin.
- beza1e1 16y agoWhat do you mean by "most advanced"? * LLVM is probably the Open-Source compiler which fits your intention most. * GCC has man-years of efforts for little bit/byte tweaks, which no other compiler does. This is not advanced, but tedious. * libFirm is the only compiler which does not deconstruct SSA form. This is advanced in a mostly academic sense. * GHC is probably the best functional (CPS) compiler. * Sun JVM is probably the best Hotspot (online) compiler. * I'm not sure which compiler is "most advanced" for dynamically typed code. Some Smalltalk or Javascript compiler? PyPy?
- jules 16y agoThe most advanced dynamically typed code compiler is either Self or Stalin.
- ced 16y agoThe question was intentionally vague. I'm looking for interesting threads of thought. Thanks for your post. libFirm is the only compiler which does not deconstruct SSA form I thought that continuation-passing-style compilers didn't use SSA, and that most Scheme implementations were CPS. No?
- beza1e1 16y agoSSA and CPS is equivalent: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.3.6773 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.3.67... In SSA form most operations (add,sub,...) are side-effect free and the rest (load,store,call,...) can be understood as using something like a "Memory Monad".
- sb 16y agoI think at least worth mentioning in this list is the milepost project: * http://ctuning.org/wiki/index.php/CTools:MilepostGCC http://ctuning.org/wiki/index.php/CTools:MilepostGCC Smalltalk JITs are pretty darn good, e.g., the Strongtalk project is known to be pretty fast. As of 2006, Sun released the Strongtalk source code. Its publication record is relatively weak (aside of type system related publications), but it contains a wealth of relevant optimizations and I am sure the interested reader/programmer will find something valuable in there. (http://www.strongtalk.org http://www.strongtalk.org) Eliot Miranda has been implementing Smalltalk VMs for quite a while, and I think his recent addition ("Cog") to the Squeak implementation is probably the most recent addition to JIT compilers for Smalltalk VMs. Given his in-depth experience and expertise (particularly with inline caching), this could probably serve as a blueprint for other (Smalltalk) JITs. V8 for Javascript is supposedly very fast (interesting side information: Robert Griesemer is working on V8, but worked on the Strongtalk interpreter before), but I don't know about the involved benchmarks, and how they stack up against each other--particularly since the TraceMonkey trace-based JITs came along. Mike Pall's LuaJIT is a very interesting project (only one-man JIT project I know of), too. PS: I am sorry for the overly long post...
- beza1e1 16y agoMilepost Gcc is interesting. Regehr does not believe in it, though: "machine learning in compilers will not end up being fundamental." His argumentation is flawed though. He says "I could always get a good optimization result by running all of my optimization passes until a fixpoint is reached," but unfortunately there is no such fixpoint. Many optimizations reverse each other (e.g. loop fusion vs loop spitting) or just arbitrarily choose some normalization (e.g. 2*x vs x+x vs x<<1). You can build a superoptimizer, which constructs all variations (e.g. equality saturation http://portal.acm.org/citation.cfm?doid=1480881.1480915 http://portal.acm.org/citation.cfm?doid=1480881.1480915), though this is no fixpoint search, but an optimization problem to choose the least cost alternative. You can not construct all variations anyway. For a simple example consider loop unrolling an infinite loop. Hence, unlike Regehr I would not devalue machine learning. I would not bet on it either, though. ;)