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

Optimize empty sequential combinator (>>) #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
An empty sequential combinator (>>) is currently represented as a sequential 
combinator with a temp variable that is never used in the body. When traversing 
>>, a binding is still added to the environment, even though that binding 
cannot ever be used.

By flagging such combinators as empty, and adjusting the indices of other 
variables in the scope accordingly, it is possible to skip the binding step, 
saving space on the heap and time on lookups. This would require an extra flag 
on the nameless AST sequential node (set to false by default), a pre-execution 
pass over the nameless AST to set the flags and rewrite the appropriate 
indices, and a test on the flag when executing a sequential.

Original issue reported on code.google.com by dkitc...@gmail.com on 16 Nov 2011 at 11:21

GoogleCodeExporter commented 9 years ago
(just cleaning up -- accepting "New" issues)

Original comment by jthywissen on 6 Jul 2012 at 9:59

arthurp commented 7 years ago

This is almost certainly not worth it in light of the Orctimizer branch. That will supersede this. I will close this when Orctimizer is merged.