orc-lang / orc

Orc programming language implementation
https://orc.csres.utexas.edu/
BSD 3-Clause "New" or "Revised" License
40 stars 3 forks source link

Update library sites to make use of Invoker system #204

Open arthurp opened 6 years ago

arthurp commented 6 years ago

The new Invoker system enables sites to separate dispatch (on types or values) from the actual execution of the call. This will be a very important performance feature for the PorcE backend and potentially even the Token interpreter. Sites should be changed to use the new features. Any site which performs complex dispatch based on the argument types or values could gain from it.

The most obvious sites that would gain from this are the numeric computation sites (Add, Mult, UMinus, etc) since the returned invoker could be specialized to the argument types. In fact, Add is by far the most important of these because it also handles strings.

arthurp commented 6 years ago

Another set of sites that will gain from this will be Tuples and related sites.

arthurp commented 6 years ago

I just realized that, probably the most important sites to convert are Ift and Iff (and any other low-level primitive sites) and the Flag sites used in Porc. These sites are used in almost all code even if the code doesn't explicitly reference them (since they are used in pattern matching and other generated elements). In addition they will compile down very efficiently if Truffle can inline them.

For some of these sites it might even be worth providing special PorcE implementations which can be fully partially evaluated.

jthywiss commented 6 years ago

I look forward to the elimination of the 1200 compile warnings commit ce7db072fee0af640888a69a5ef8eadeaff82f0f caused. :)

arthurp commented 6 years ago

Sadly for you that's not this issue. The one that will good that is #206.