tsoding / porth

It's like Forth but in Python
629 stars 50 forks source link

Handle intrinsics with a lookup table #59

Closed ap29600 closed 3 years ago

ap29600 commented 3 years ago

This makes it easier to have exhaustive handling of operations by combaring the length of the lookup table with the length of the dataclass, and should also be a bit faster to compile (I assume the dictionary indexed with enums should have O(1) lookup.)

ap29600 commented 3 years ago

Closing because implementing the "here" operation would require some lambda fuckery that I am not emotionally prepared to undergo.

rexim commented 3 years ago

@ap29600 it's ok! You don't owe anything to anyone!