about summary refs log tree commit diff
path: root/tvix/eval/src/value/builtin.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-24T12·37+0300
committertazjin <tazjin@tvl.su>2022-09-02T12·59+0000
commitca90c0f45ad9892c35a2a0402939b857a6fca08e (patch)
treeb3568fd120d02af4e156712f89b131006098588f /tvix/eval/src/value/builtin.rs
parentc48aa058a79f1fd08bb98fc6eba80bf4e438a983 (diff)
refactor(tvix/eval): handle scope poisoning & globals dynamically r/4587
Previously, the tokens that could poison a scope (`true`, `false`,
`null`) had individual fields in the scope to track whether or not
they were poisoned.

This commit sets up new machinery that instead tracks scope poisoning
dynamically using a HashMap, and which makes it possible to introduce
additional tokens to the top-level ("global") scope that are directly
resolved by the compiler by passing a map of runtime values to be
used.

With this solution, the compiler now contains all machinery required
for wiring up builtins resolution.

The set of builtins to be exposed at runtime must, however, be
constructed *outside* of the compiler and passed in. Everything is
prepared for this, but it is not yet wired up (so the only existing
builtins are the ones we already had before).

Note that this technically opens up an optimisation potential when
compiling selection operations, where the attribute set being selected
from is `builtins`. The compiler could directly resolve the builtins
and place the right values on the stack.

Change-Id: Ia7dad3c2a98703e7ea0c6ace1a722d57cc70a65c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6253
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src/value/builtin.rs')
0 files changed, 0 insertions, 0 deletions