Commit graph

10 commits

Author SHA1 Message Date
Vincent Ambo
e3f81e8d3b feat(tvix/cli): add :d REPL-prefix to print explanations of values
Change-Id: I1dd8de8d996e07840f9b0aaebf932b812103a43a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7593
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2022-12-22 19:09:40 +00:00
Vincent Ambo
ea7d63e177 feat(tvix/cli): implement NixCompatIO helper type
This type allows for temporarily compatibility with the C++ Nix store,
specifically (for now) it gives us the store directory used by Nix and
imports files the same way.

Change-Id: I4767794ef2863eba49661315c63c4e17de946d60
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7587
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2022-12-22 19:09:40 +00:00
Vincent Ambo
29790147b6 fix(tvix/cli): use tvix_eval::StdIO in CLI
... until we have a store-I/O layer, or something that intercepts the
store-related stuff appropriately.

Change-Id: I22f63435b3f9e118e3faeb2924fda8373a23ea7f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7568
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2022-12-21 22:37:11 +00:00
Vincent Ambo
8b3d03db92 chore(tvix/cli): rename binary to just 'tvix'
Change-Id: If735c81a04f60dcd77f1c40b595b52ed88bbbe95
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7580
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Reviewed-by: flokli <flokli@flokli.de>
2022-12-21 21:48:08 +00:00
Vincent Ambo
f467df06dc chore(tvix/cli): re-add observer flags
Users can again pass flags for dumping the AST, bytecode, and runtime
trace.

With this commit the CLI is at feature-parity with what we had before,
but entirely through the new API.

Change-Id: I30fe26f243224b25d1e4f828fec607325ef88306
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7550
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
2022-12-21 13:23:38 +00:00
Vincent Ambo
60d9fba56d chore(tvix/cli): re-add NIX_PATH handling
Change-Id: I5595d6f5141ed4a533ca44a46264dc604fca6be1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7549
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
2022-12-21 13:23:38 +00:00
Vincent Ambo
36eaa9b3b3 chore(tvix/cli): re-add --raw argument
Change-Id: I82f469f7f186c754c40bd941587b30aa3fc48045
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7548
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2022-12-21 13:23:38 +00:00
Vincent Ambo
6d3d237923 refactor(tvix/eval): consume self in Evaluation::evaluate
This simplifies lifetime management for observers in callers of tvix_eval.

Change-Id: I2f47c8d89f22b1c766526e5d1483c0d026b500ae
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7546
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2022-12-21 13:23:38 +00:00
Vincent Ambo
257c67f204 chore(tvix): upgrade to clap 4.0
In //tvix/eval:

* criterion bumped to 4.0, which at least depends on clap 3.x instead
  of 2.x, which is less incompatible

In //tvix/cli:

* no changes required

In //tvix/nix_cli:

* some minor changes for compatibility with clap 4.0, no functionality
  changes

Change-Id: If793f64b59fcaa2402d3d483ddbab4092f32df03
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7588
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2022-12-21 13:23:38 +00:00
Vincent Ambo
d9e2bec953 refactor(tvix): split binary (REPL etc.) out from evaluator library
The tvix-eval project is independent from any *uses* of the evaluator,
such as the tvix-repl.

This functionality has been split out into a separate "tvix-cli"
crate. Note that this doesn't have to mean that this CLI crate is the
"final" CLI crate for tvix, the point of this is not "getting the CLI
structure right" but rather "getting the evaluator structure right".

This reshuffling is part of restructuring the way that functionality
like store communication is injected into language evaluation.

Note that at this commit the new CLI crate is not at feature-parity.

Change-Id: Id0af03dc8e07ef09a9f882a89612ad555eca8f93
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7541
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2022-12-21 13:09:29 +00:00