ArneBachmann / awful

The stack-based programming language AWFUL, written in Python
2 stars 0 forks source link

Parse function definitions only once #7

Open ArneBachmann opened 5 years ago

ArneBachmann commented 5 years ago

Always parse (nested) function definitions only once, keeping them in a static immutable table. This could also be the starting point for a clean way to avoid or allow function override in a controlled manner, and lead to a speed-up.

Related is the handling of function references, that currently only contain the function's name, but could point to a table index instead for different override versions of the same function name.

ArneBachmann commented 5 years ago

Requires a new runtime token for compiled function references (vs. reference on stack with apply).

ArneBachmann commented 5 years ago

Same could be used for static lists (currently there are no dynamic "literal" lists)