Super cool to see a description of how Wolfram is compiled. I've used the Wolfram language for a long time but never really took a peak inside.
Some thoughts:
- The paper seems to suggest that compilation of scripting languages is not widely used outside academia. In fact, it's super common - all major browsers do it for JavaScript.
- What they call "soft failure mode" is what I would call "OSR exit" or what others would call "deoptimization". It's neat to know that Wolfram does this!
- I love that they designed a new IR rather than trying to reuse something else, or worse, trying to run optimizations over bytecode or AST. Also great that they go straight to SSA. The MExpr->WIR->TWIR->code pipeline is similar to what happens in JavaScriptCore's DFG compiler. We use the term "DFG IR" to refer to both the typed and untyped form, but it's exactly the same idea as what they're doing.
- They could use better benchmarks and more of them. Simple compilers do well on small benchmarks. Once workloads get very large and complex, you start to add even more crazy to the compiler. You learn a ton when your benchmark corpus goes to 1,000,000 LoC or beyond.
- The fact that there are thousands of tests makes me say "awww how cute". JavaScriptCore has close to 100,000 tests. But, thousands of tests is better than no tests, and of course different folks mean different things by "one test" - it's possible that one of their tests covers the equivalent of what 100s of our tests would cover.
Anyway, congratulations are in order - this is great work. It's always fun to see new compiler work for interesting languages, and Wolfram definitely qualifies as a particularly interesting language.
I wouldn't really classify "soft failure mode" as OSR; from my experimentation it reinvokes the entire function when there's a failure rather than migrating over the execution state.
In terms of tests, I get the impression that this compiler doesn't (yet) have to deal with much of the complexity a modern JavaScript one has to (OSR, GC info, inline caches, probably even most ISA-level details), so there are whole classes of tests that just don't need to exist.
since this post might attract people that are mathematica powerusers: how good are mathematicas optimization routines vs commercial solvers like gurobi or cplex? reason i ask is i'm spinning up project that'll require a good bit of MIP, MILP and i have a mathematica license but i'm considering getting a gurobi license. since i've never tried gurobi i can't compare.
I never heard about Mathematica being used to solve large-scale MIPs. The best solvers in the market are very difficult to beat, since this is such a unique market with very specialized domain knowledge. So, while I guess it is possible to solve small to medium sized problems with Mathematica, I don't believe they're able to compete with some of the best solvers like Gurobi.
pizlonator|4 years ago
Some thoughts:
- The paper seems to suggest that compilation of scripting languages is not widely used outside academia. In fact, it's super common - all major browsers do it for JavaScript.
- What they call "soft failure mode" is what I would call "OSR exit" or what others would call "deoptimization". It's neat to know that Wolfram does this!
- I love that they designed a new IR rather than trying to reuse something else, or worse, trying to run optimizations over bytecode or AST. Also great that they go straight to SSA. The MExpr->WIR->TWIR->code pipeline is similar to what happens in JavaScriptCore's DFG compiler. We use the term "DFG IR" to refer to both the typed and untyped form, but it's exactly the same idea as what they're doing.
- They could use better benchmarks and more of them. Simple compilers do well on small benchmarks. Once workloads get very large and complex, you start to add even more crazy to the compiler. You learn a ton when your benchmark corpus goes to 1,000,000 LoC or beyond.
- The fact that there are thousands of tests makes me say "awww how cute". JavaScriptCore has close to 100,000 tests. But, thousands of tests is better than no tests, and of course different folks mean different things by "one test" - it's possible that one of their tests covers the equivalent of what 100s of our tests would cover.
Anyway, congratulations are in order - this is great work. It's always fun to see new compiler work for interesting languages, and Wolfram definitely qualifies as a particularly interesting language.
carry_bit|4 years ago
In terms of tests, I get the impression that this compiler doesn't (yet) have to deal with much of the complexity a modern JavaScript one has to (OSR, GC info, inline caches, probably even most ISA-level details), so there are whole classes of tests that just don't need to exist.
frozenport|4 years ago
How many people worked on this thing?
daneelsan|4 years ago
jamesfinlayson|4 years ago
drunkenmagician|4 years ago
kanaffa12345|4 years ago
coliveira|4 years ago