about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorFilesLines
2022-08-24 r/4458 fix(tvix/value): implement PartialOrd/PartialEq for stringsVincent Ambo1-1/+13
Instead of comparing the enum variants (which does not yield useful behaviour), compare &str representations of the string instead. Change-Id: I5e94b5f6c91b4561e1bc7c36d586f3d23c243764 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6112 Tested-by: BuildkiteCI Reviewed-by: eta <tvl@eta.st>
2022-08-24 r/4457 feat(tvix/value): introduce string representation with &'static strVincent Ambo4-26/+44
For cases where the strings are statically known (such as the oft-occuring name/value), this can be a useful optimisation. It's also much more convenient in tests. Change-Id: Ie462b684805bd4986ea5e85ca4bff663bc2d3c3c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6111 Tested-by: BuildkiteCI Reviewed-by: eta <tvl@eta.st>
2022-08-24 r/4456 test(tvix/value): add simple attrset construction testsVincent Ambo3-0/+62
These do not yet test nested attribute sets; we need to add some more inspection primitives first. Change-Id: Icfc99bf17c73ebefc0d882a84f0ca73ec688a54d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6110 Reviewed-by: eta <tvl@eta.st> Tested-by: BuildkiteCI
2022-08-24 r/4455 feat(tvix/value): implement nested attribute set literalsVincent Ambo1-14/+44
With this change, nested attribute sets can now be created from literals. This required some logic for dealing with cases where at a deeper nesting point a literal attribute set was constructed from an optimised representation. For example, this is valid Nix code: ```nix { a = {}; # creates optimised empty representation a.b = 1; # wants to add a `b = 1` to it b = { name = "foo"; value = "bar"; }; # creates optimised K/V repr b.foo = 42; # wants to add an additional `foo = 42` } ``` In these cases, the attribute set must be coerced to a map representation first which is achieved by the new internal NixAttr::map_mut helper. Change-Id: Ia61d3d9d14c4e0f5e207c00f6a2f4daa3265afb2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6109 Reviewed-by: eta <tvl@eta.st> Tested-by: BuildkiteCI
2022-08-24 r/4454 refactor(tvix/value): encapsulate attrset logic within value::attrsVincent Ambo3-191/+194
The internal optimisations of the set representation were previously leaking into the VM, which is highly undesirable. Keeping it encapsulated allows us to do additional optimisations within value::attrs without being concerned about its use in the VM. Change-Id: I7e7020bb0983b9d355d3db747b049b2faa60131f Reviewed-on: https://cl.tvl.fyi/c/depot/+/6108 Reviewed-by: eta <tvl@eta.st> Tested-by: BuildkiteCI
2022-08-22 r/4453 chore(paroxysm): bump cargo dependenciesVincent Ambo1-89/+183
Change-Id: Ibf82bf6b9a10274fe6928db7a6a2beb74da92b13 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6122 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-08-22 r/4452 chore(web/atward): bump cargo dependenciesVincent Ambo1-64/+210
Change-Id: I691e87c6b596fcc7028717a5a22d5619bd87a089 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6121 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-08-22 r/4451 chore(tools/cheddar): bump cargo dependenciesVincent Ambo1-125/+248
Change-Id: I41e26046a67635ec3dba2ac955e31e6ca7451cc6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6120 Reviewed-by: sterni <sternenseemann@systemli.org> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-08-22 r/4450 chore(tazjin/tgsa): bump cargo dependenciesVincent Ambo1-98/+195
Change-Id: Id52ab2937e32385324ba93f4df7e1da17a1f4eec Reviewed-on: https://cl.tvl.fyi/c/depot/+/6119 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-08-22 r/4449 chore(3p/sources): Bump channels & overlayssterni5-66/+76
* //users/tazjin/predlozhnik: bump wasm-bindgen & run `cargo update` * //users/Profpatsch/writers: use proper keyword syntax to make make flake8 happy. * //third_party/nixpkgs: pick binaryen from stable channel Change-Id: Ia711d8c396aa09b78413d80f35eedf63fa315596 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6118 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: Profpatsch <mail@profpatsch.de>
2022-08-22 r/4448 feat(users/Profpatsch): init haskell arglib-netencodeProfpatsch3-0/+64
Mirrors the rust exec-helpers Change-Id: I96f211d6545e228b8ae0c1dce4e60e6f6867690c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6117 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2022-08-22 r/4447 feat(users/Profpatsch): init haskell exec-helpersProfpatsch3-0/+80
Mirrors the rust exec-helpers Change-Id: I8fba49525949a8f38ca8c215e2ec7ba9d97d3bf9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6116 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2022-08-22 r/4446 fix(users/Profpatsch/my-prelude): use exactSourceProfpatsch1-1/+4
Change-Id: I1b797fb69f69e09f2dda99fce2f12adef0ac2ad2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6115 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2022-08-22 r/4445 feat(users/Profpatsch): init netencode-hsProfpatsch3-0/+445
Haskell implementation of the netncode parser & generators. Change-Id: I904df752e78641110af2857e71d8206bf432d427 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6114 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2022-08-16 r/4444 chore(sterni/emacs): weed out subscriptionssterni1-26/+2
Change-Id: Ie5f57300c380874a83d1cbd25a61eb595760bbf4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6113 Reviewed-by: sterni <sternenseemann@systemli.org> Autosubmit: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-08-14 r/4443 refactor(tvix/rm): introduce helper for AttrSet Entry APIVincent Ambo1-20/+27
There are multiple points where an insertion needs to be done into an attribute set, but copying the key or checking for presence before insertion should be avoided As that is a little bit noisy, it's been factored out into a helper function in this commit. Change-Id: Ibcb054ebeb25a1236c06c812f47c8e74180d4fc9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6107 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-14 r/4442 feat(tvix/vm): implement first nested attribute set constructionVincent Ambo2-39/+134
This can construct non-overlapping nested attribute sets (i.e. `{ a.b = 1; b.c = 2; }`, but not `{ a.b = 1; a.c = 2; }`). In order to do the latter, it's necessary to gain the ability to manipulate the in-progress attribute set construction. There's multiple different options for this ... Change-Id: If1a762a720b175e8eb4216cbf96a7434d22640fb Reviewed-on: https://cl.tvl.fyi/c/depot/+/6106 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4441 refactor(tvix/value): explicitly implement PartialEq for valueVincent Ambo1-1/+26
There are some notions of equality (due to e.g. different backing variants for types, or Nix particularities) that don't work correctly when deriving PartialEq. Change-Id: Ide83ae67d051cc0b3ca89cefb283f17d0207acce Reviewed-on: https://cl.tvl.fyi/c/depot/+/6105 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4440 fix(tvix/eval): Fail on duplicate attribute set keysVincent Ambo2-1/+9
Change-Id: I57373ca76d0e25a5d08a8dfce9d5949099326fc0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6104 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4439 feat(tvix/eval): construct internal attribute path representationVincent Ambo4-1/+30
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/4438 feat(tvix/vm): implement construction of optimised KV attrsetsVincent Ambo1-0/+77
For name/value pairs (which occur extremely often in Nix and make up a significant chunk of the runtime cost of evaluating nixpkgs) we substitute an optimised representation. For now this will only be used if the name/value pair keys were specified as literal identifiers or strings (i.e. if chunks are encountered as keys they are not forced and a normal attribute set backed by a map will be constructed). Change-Id: Ic79746c323e627528bd58b1a6024ee8d0aff7858 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6102 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-13 r/4437 fix(tvix/value): KV struct needs to carry name as Value, tooVincent Ambo1-1/+2
Users may construct a pair that falls into the name/value optimisation but where `name` is not actually a string, as from the language perspective there is nothing special about this attribute set. We also can not conditionally apply this by forcing the key at this point, as this would change the language semantics. Therefore, the name in the optimised representation is also carried as `Value`. Change-Id: I5be8a4c98ba19ebdfb7203a929f714a04492512e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6101 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-13 r/4436 feat(tvix/value): implement Display properly for listsVincent Ambo1-2/+8
Change-Id: I991d235cf52fbd42eb839b384f9c55ee64fa86c4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6100 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4435 fix(tvix/errors): display a useful intermediate error representationVincent Ambo1-1/+1
Change-Id: If979a2aa21444320427f54e6530a55cab873856b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6099 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4434 feat(tvix): implement string interpolationVincent Ambo3-1/+25
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/4433 feat(tvix/compiler): compile non-interpolated string literalsVincent Ambo1-0/+35
This sets up the scaffolding for compiling interpolation, but those instructions do not yet exist. Change-Id: Ife41bbbf432d9661abe566c92437409dd0da44e7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6097 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4432 style(tvix/eval): display `Display` representation of runtime valuesVincent Ambo1-1/+1
Change-Id: Ifbe05c2da9493c9e132a2d2e94a451d6091542a5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6096 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4431 feat(tvix/compiler): compile list literalsVincent Ambo1-0/+23
Change-Id: I2c6fedc3dbb7d449d700f3972c3fbd4a7d147f6c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6095 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Autosubmit: tazjin <tazjin@tvl.su>
2022-08-13 r/4430 feat(tvix/vm): implement list constructionVincent Ambo2-1/+20
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/4429 feat(tvix/value): add runtime representation of simple listsVincent Ambo2-0/+19
There might be more logic in the future to encapsulate different backing implementations of lists as well. Change-Id: Ib7064fab48bf88b0c8913b0ecfa2108177c7c9fd Reviewed-on: https://cl.tvl.fyi/c/depot/+/6093 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Autosubmit: tazjin <tazjin@tvl.su>
2022-08-13 r/4428 docs(tvix/eval): add design documentation for attrset opcodesVincent Ambo1-0/+122
Change-Id: I303b57e035543f4597c6247983d1d533e4014638 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6092 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4427 feat(tvix/eval): implement trivial attribute set literalsVincent Ambo3-3/+88
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-13 r/4426 chore(3p/sources): Bump channels & overlaysVincent Ambo2-19/+19
* tvl-slapd: move database to subdirectory (somehow now required) Change-Id: I1792b856cf68b11959c0cc9caab4135e556f8c58 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6090 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4425 feat(tvix/value): add some necessary helpers for stringsVincent Ambo2-4/+14
Deriving Ord/Eq is required for the ordered BTreeMaps. Once interning is implemented this will require some extra magic for the sort order, but that's fine. Change-Id: I0c654648eb3609a4a01d84868c25f43a4d35bc2e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6089 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4424 fix(tvix/eval): print code even if runtime failsVincent Ambo1-6/+2
Change-Id: I357c9adf939cb6001afa73ad02282d94ee22d0ba Reviewed-on: https://cl.tvl.fyi/c/depot/+/6088 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4423 feat(tvix/eval): add Value variants for strings & attrsetsVincent Ambo4-6/+21
Change-Id: Idebf663ab7fde3955aae50f635320f7eb6c353e8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6087 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4422 feat(tvix/eval): add module for attribute set implementationsVincent Ambo2-0/+37
Change-Id: I6002bd5e5596b93325dea6c862370ba5235c0f08 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6086 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4421 feat(tvix/eval): add module for string type implementationVincent Ambo2-1/+15
Change-Id: I5e4465acc4a676c10d7374b14f7a09240202b466 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6085 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-13 r/4420 feat(tvl.el): add magit-gerrit-push-privateVincent Ambo1-0/+13
This adds a new function (intentionally bound to a rare key (Q)) in the push menu which can push a *private* change to Gerrit. A private change is one that, until submitted, is only visible to its owner and all explicitly added people (reviewers, CC). Change-Id: I6ee13dbbad099584475d3efac96e5d9b86efbc26 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6061 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Autosubmit: tazjin <tazjin@tvl.su>
2022-08-12 r/4419 chore(tvix): move nix-store CLI scaffolding to subfolderVincent Ambo6-9/+9
For some reason a top-level Rust project ended up in this location, which is incompatible with the actual project structure that's being prepared for merge right now. Change-Id: I9d919ad72fc7e4e4d8cbb9899e7f8d90fa7ca87a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6060 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> Autosubmit: tazjin <tazjin@tvl.su>
2022-08-12 r/4418 feat(tvix/eval): implement Display trait for Value enumVincent Ambo1-0/+14
This representation should match what the Nix REPL shows for result values. Change-Id: If3143d969fcdc123a6029e2aeb7bbd6ae51aeb71 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6082 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4417 refactor(tvix/eval): move NumberPair struct definition to vm moduleVincent Ambo3-8/+8
This isn't relevant to the value type itself. Change-Id: I678bc92a8a530b1081ed498bf3ff7925217bcc01 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6081 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4416 feat(tvix/compiler): incompletely handle true/false/null literalsVincent Ambo2-4/+31
These are a bit tricky to implement because Nix technically treats them as identifiers, and only if the identifier is not explicitly overridden within the scope does it yield the expected literal values. Note that weirdness even occurs with scopedImport. Change-Id: Ie55723405ccfcc25da37c5a08fa3332f37cf9ae5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6080 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4415 feat(tvix/eval): implement boolean inversion operatorVincent Ambo2-1/+17
Change-Id: Icb1d449fdee4d67b5f1eefdbc01baa1584ea0a67 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6079 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4414 feat(tvix/eval): implement equality operatorVincent Ambo3-8/+25
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/4413 refactor(tvix/compiler): use rnix's typed AST for literal valuesVincent Ambo1-7/+5
Change-Id: Ic56ab64ad82343c7cdf8168ef41ee0a97f7e1dd9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6077 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4412 feat(tvix/compiler): implement parens precedenceVincent Ambo1-1/+6
Change-Id: I8944354b3690d7504e4fe4254f14be5b849b9bcf Reviewed-on: https://cl.tvl.fyi/c/depot/+/6076 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4411 feat(tvix/eval): implement unary negation operatorVincent Ambo3-1/+35
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 Ambo5-5/+110
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/4409 feat(tvix/eval): add error variant for runtime type errorsVincent Ambo1-1/+6
Change-Id: I74155cf01766b7a991a69522945bff67fbca5a16 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6073 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>