about summary refs log tree commit diff
path: root/tvix/eval/src/opcode.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-08-13 r/4439 feat(tvix/eval): construct internal attribute path representationVincent Ambo1-0/+1
This is required for constructing nested attribute sets at runtime. There'll be quite a lot of optimisation potential with this solution eventually, if it should turn out to be a bottleneck. This introduces a conceptual change, in that the `Value` enum is now an enum representing "all runtime values" instead of "all Nix language types". This makes sense in general, as this type will also contain Chunk representations etc. which are not exposed to users. Change-Id: Ic5f72b2a0965b146c6a451efad34c6a81ca1aad8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6103 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-13 r/4434 feat(tvix): implement string interpolationVincent Ambo1-0/+3
This adds a new instruction which assembles an interpolated string from a specified number of fragments, which are already going to be located on the stack in the right position. This will raise a type error if any of the fragments do not evaluate to a string. Change-Id: I5756248fa3e9fcc3d063c14db40b332f7e20a588 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6098 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4430 feat(tvix/vm): implement list constructionVincent Ambo1-0/+3
Change-Id: Iec2b4910800ab29daae6d71b58a8acd14ccb1cc1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6094 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Autosubmit: tazjin <tazjin@tvl.su>
2022-08-13 r/4427 feat(tvix/eval): implement trivial attribute set literalsVincent Ambo1-0/+3
Implements attribute set literals without nesting. Technically this already supports dynamic key fragments (evaluating to strings), though the only way to create these (interpolation) is not yet implemented. However, creating simple attribute sets like `{ }`, or `{ a = 15; }` or `{ a = 10 * 2; }` works. Recursive attribute sets are not yet implemented as we do not have any kind of scope access yet anyways. This is implemented using a new instruction that creates an attribute set with a given number of elements by popping key/value pairs off the stack. Change-Id: I0f9aac7a131a112d3f66b131297686b38aaeddf2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6091 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4414 feat(tvix/eval): implement equality operatorVincent Ambo1-3/+6
Change-Id: I9dd54aed72cd7e67593dc76f5a046ebbda40c26f Reviewed-on: https://cl.tvl.fyi/c/depot/+/6078 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4411 feat(tvix/eval): implement unary negation operatorVincent Ambo1-1/+5
Change-Id: I5d012cc073e55d79d7b34b88283aab3164864293 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6075 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4410 feat(tvix/eval): implement simple arithmetic binary operationsVincent Ambo1-0/+6
Implements simple arithmetic operations (+, -, *, /). There is some scaffolding included to pop and coerce pairs of numbers, as the Nix language will let arithmetic operators apply to arbitrary pairs of number types (always resulting in floats if the types are mixed). Change-Id: I5f62c363bdea8baa6ef812cc64c5406759d257cf Reviewed-on: https://cl.tvl.fyi/c/depot/+/6074 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4404 feat(tvix/eval): add initial opcode representationVincent Ambo1-0/+19
Change-Id: Ibc7685a6b0b92e08f0b6c82cf7d9b04fbb593a4e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6068 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>