tvl-depot/tvix/cli/Cargo.toml
Aspen Smith fc63594631 feat(tvix/repl): Allow binding variables at the top-level
Allow binding variables at the REPL's toplevel in the same way the Nix
REPL does, using the syntax <ident> = <expr>. This fully, strictly
evaluates the value and sets it in the repl's "env", which gets passed
in at the toplevel when evaluating expressions.

The laziness behavior differs from Nix's, but I think this is good:

    ❯ nix repl
    Welcome to Nix version 2.3.18. Type :? for help.

    nix-repl> x = builtins.trace "x" 1

    nix-repl> x
    trace: x
    1

    nix-repl> x
    1

vs tvix:

    tvix-repl> x = builtins.trace "x" 1
    trace: "x" :: string
    tvix-repl> x
    => 1 :: int
    tvix-repl> x
    => 1 :: int

Bug: https://b.tvl.fyi/issues/371
Change-Id: Ieb2d626b7195fa87be638c9a4dae2eee45eb9ab1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11954
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Autosubmit: aspen <root@gws.fyi>
2024-07-05 16:40:35 +00:00

38 lines
869 B
TOML

[package]
name = "tvix-cli"
version = "0.1.0"
edition = "2021"
[[bin]]
name = "tvix"
path = "src/main.rs"
[dependencies]
nix-compat = { path = "../nix-compat" }
tvix-build = { path = "../build" }
tvix-castore = { path = "../castore" }
tvix-store = { path = "../store", default-features = false, features = []}
tvix-eval = { path = "../eval" }
tvix-glue = { path = "../glue" }
tvix-tracing = { path = "../tracing" }
bytes = "1.4.0"
clap = { version = "4.0", features = ["derive", "env"] }
dirs = "4.0.0"
rustyline = "10.0.0"
rnix = "0.11.0"
rowan = "*"
smol_str = "0.2.0"
thiserror = "1.0.38"
tokio = "1.28.0"
tracing = "0.1.40"
tracing-indicatif = "0.3.6"
[dependencies.wu-manber]
git = "https://github.com/tvlfyi/wu-manber.git"
[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator = "0.5"
[features]
default = []
tracy = ["tvix-tracing/tracy"]