masak / alma

ALgoloid with MAcros -- a language with Algol-family syntax where macros take center stage
Artistic License 2.0
139 stars 15 forks source link

Add an optimization step (our first): function inlining #542

Open masak opened 5 years ago

masak commented 5 years ago

I was happy to be able to produce a SEND + MORE = MONEY solver in 007 that tube runs in less than 5 seconds.

But it would look much better, and maybe even be shorter overall, if we could introduce functions and call them without incurring the calling overhead at runtime.

Therefore: I suggest a static optimization step that sees if conditions hold for inlining a function at its callsite.