tvl-depot/tvix/eval/src
sterni 0005737f11 fix(tvix/eval): make tvix display values like nix-instantiate(1)
In order for the test suite we have currently to be comparable to C++
Nix, we need to display values in the same way. This was largely the
case except in some weird cases.

* <CODE> for thunks and <CYCLE> for repeated thunks (?) are already in
  use. <CODE> formatting is tested by the oracle test suite already.

* Instead of lambda, we need to use <LAMBDA>

* <<primop>> and <<primop-app>> (a formatting C++ Nix uses nowhere)
  now are <PRIMOP> and <PRIMOP-APP>.

We'll probably want to have a fancier display of values (in a separate
trait) down the line. This could be used for interactive usage, e.g. the
REPL or a potential debugger.

There is a peculiarity with C++ Nix 2.3 formatting primops: import is
considered a <<PRIMOP-APP>>, since it is internally implemented by means
of scopedImport. This implementation detail no longer leaks in C++ Nix
2.13 nor in Tvix.

<CYCLE> display is untested at the moment, since we exhibit a
discrepancy to C++ Nix 2.3. Our current detection is more similar to C++
Nix 2.13—luckily it is also the more consistent of the two. See also
b/245.

Change-Id: I1d534434b02e470bf5475b3758920ea81e3420dc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8760
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2023-06-15 11:01:06 +00:00
..
builtins fix(tvix/eval): allow negative substring lengths 2023-06-12 08:38:49 +00:00
compiler fix(tvix/eval): don't thunk home relative paths 2023-06-14 10:57:28 +00:00
tests fix(tvix/eval): make tvix display values like nix-instantiate(1) 2023-06-15 11:01:06 +00:00
value fix(tvix/eval): make tvix display values like nix-instantiate(1) 2023-06-15 11:01:06 +00:00
vm fix(tvix/eval): emit only warnings on shadowed outputs 2023-06-11 20:59:34 +00:00
chunk.rs feat(tvix/eval): implement Chunk::extend method 2023-05-25 11:28:13 +00:00
errors.rs fix(tvix/eval): allow negative substring lengths 2023-06-12 08:38:49 +00:00
io.rs refactor(tvix/eval): stop borrowing &mut self 2023-05-25 11:11:59 +00:00
lib.rs feat(tvix/eval): add Evaluation::strict to toggle top-level deepseq 2023-03-22 13:44:20 +00:00
nix_search_path.rs refactor(tvix/eval): use &Path instead of PathBuf 2023-05-22 09:43:33 +00:00
observer.rs chore(tvix): Generator{Request|Response} -> VM{Request|Response} 2023-03-14 09:22:22 +00:00
opcode.rs fix(tvix/eval): type check function argument with set pattern 2023-06-07 15:17:20 +00:00
pretty_ast.rs fix(tvix/eval): fix current clippy warnings 2022-12-25 18:25:06 +00:00
properties.rs refactor(tvix/eval): Don't (ab)use PartialEq for Nix equality 2022-09-18 22:03:41 +00:00
source.rs chore(tvix/eval): implement std::error::Error for tvix_eval::Error 2023-01-02 22:24:43 +00:00
spans.rs refactor(tvix/eval): implement From<Span> for LightSpan 2023-03-04 15:18:37 +00:00
systems.rs fix(tvix/eval): fix current clippy warnings 2022-12-25 18:25:06 +00:00
test_utils.rs test(tvix/eval): Add proof-of-concept test for Chunk 2022-09-18 17:55:06 +00:00
upvalues.rs fix(tvix/eval): remove impl PartialEq for Value 2022-11-04 00:30:13 +00:00
warnings.rs fix(tvix/eval): emit only warnings on shadowed outputs 2023-06-11 20:59:34 +00:00