about summary refs log tree commit diff
path: root/tvix/eval/src/compiler (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2022-09-11 r/4813 fix(tvix/eval): reduce scope depth in scope moduleVincent Ambo2-2/+2
Change-Id: If32f9e4c9212f20a39baa15d479ff1387c17570d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6500 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4812 feat(tvix/eval): add Chunk::pop_op methodVincent Ambo1-0/+22
This is used to drop an already emitted operation from a chunk again and clean up its span tracking. This is required in cases where the compiler has to backtrack. Change-Id: I8112da9427688bb2dec96a2ddd12390f6e9734c3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6499 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4811 refactor(tvix/eval): refactor methods for parsing static identsVincent Ambo1-22/+39
Refactors the methods used for determining whether an identifier in a binding (i.e. an `rnix::Attr` node) is a static string, and extracting it. Previously all uses of this logic were for `let`-expressions, where dynamic attributes are always an error. However, we need the same logic to properly implement the phase separation of attribute set compilation. To facilitate this, the actual core logic of these methods now return `Option`, and are only converted to errors in cases where the errors are actually required. Change-Id: Iad7826eff2cb428182521c6f92276310edeae1eb Reviewed-on: https://cl.tvl.fyi/c/depot/+/6498 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4810 refactor(tvix/eval): move attrset-related code to compiler::attrsVincent Ambo2-202/+209
There's about to be a lot more code for attrsets (hopefully temporarily as part of an expand&contract cycle), while nested attribute logic is being refactored in preparation for recursive attribute sets. This does not change any functionality. Change-Id: I667565cd810ca7d9046120d1721c2ceb9095550b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6497 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4809 fix(tvix/eval): place plain inherits in correct stack slotssterni3-27/+62
We need to make sure that we compile all plain inherits in a let expression before declaring any other locals. Plain inherits are special in the sense that they can never be recursive, instead resolving to a higher scope. Thus we need to compile their value, before declaring them. If we don't do that, before any other local can be declared, we cause a situation where the plain inherits' values are placed into other locals' stack slots. Note that we can't integrate the plain inherit compilation into the regular 2-3 phase model where we defer the compilation of the value or we'd compile `let inherit x; in …` as `let x = x; in …`. Change-Id: I951d5df3c9661a054e12401546875f4685b5bf08 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6496 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4808 test(tvix/eval): add test for mutually recursive let bindingssterni2-0/+15
This test shows that let bindings' dependencies can form a cyclical graph, so we need to use thunking to break this cycle. Change-Id: I2a4de71fd7024f3d3d1166154784139a82f39411 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6495 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4807 fix(tvix/eval): wrap asserts in a thunksterni3-1/+12
As the new test case demonstrates, asserts need to be evaluated lazily. Change-Id: I808046722c5a504e9497855ca5026d255c7a4c34 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6494 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4806 test(tvix/eval): test “useful” plain inheritssterni2-0/+10
Change-Id: Ic4700f0618a393e45a2ee7c70045edff97e30c49 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6493 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4805 fix(tvix/eval): declare let in