Vaguery / klapaucius

A clean, tested, maintainable Push interpreter written in Clojure.
MIT License
31 stars 2 forks source link

Code blocks to :code stack #172

Closed Vaguery closed 6 years ago

Vaguery commented 6 years ago

Consider a new interpreter mode (off by default) in which every :code block that is "unwrapped" and pushed back onto :exec is also pushed to the :code stack at the same time.

lspector commented 6 years ago

Love this idea. Can't remember if you have tags or something similar, but tagging (or similar) on unwrapping also seems potentially interesting.

Vaguery commented 6 years ago

I don't have tags in the sense you originally described them. There is a :tagspace type, which is a data structure with sorted keys that are looked up with approximation. Open an issue to add tags as such! It will probably be feasible in the first post-integer release.

Vaguery commented 6 years ago

One problem here will be the (new) possibility of loops from the many instructions that push continuation code blocks to :exec. One would have to expect the :code stack to fill up with counter chaff.

lspector commented 6 years ago

Ooo... yes, maybe a guaranteed exponential explosion here...

Vaguery commented 6 years ago

/shrug I check for all instructions anyway

Vaguery commented 6 years ago

Consolidated by "promiscuous routing" in #175