about summary refs log tree commit diff
path: root/tvix/eval/src/main.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-10-04 r/5032 feat(tvix/eval): use fancy error formatting in REPLVincent Ambo1-1/+1
Change-Id: I8d5652d797b012bc3d5248ca2b2d0c87572dbf2e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6851 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com>
2022-09-18 r/4911 refactor(tvix/eval): use Clap for arg+env parsingGriffin Smith1-14/+19
Refactor the environment variable and argument parsing for the tvix repl to use Clap instead of doing things ad-hoc, and thread through options obtained from environment variables via explicit arguments rather than obtaining them from the environment as they're needed. This makes adding more flags more sustainable, and also makes the binary fully self-documenting, including supported env vars, via `--help`. Change-Id: Ib1f6a0cd20056e8c9196760ff755fa5729667760 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6653 Autosubmit: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-09-10 r/4788 fix(tvix/eval): always add history entries in REPLVincent Ambo1-1/+1
... even if the code is broken. Change-Id: I5898bceaebf201b97e8988c94c90e7fafff82529 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6462 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-03 r/4617 refactor(tvix/eval): explicitly discard uninteresting resultsVincent Ambo1-2/+2
Change-Id: I95a2ad61d9512b91017c801f325d0193b4da9c7d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6280 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-31 r/4547 fix(tvix/eval): gently attempt to create state dirVincent Ambo1-1/+3
If the directory in which REPL history is stored does not exist, gently try to create it, but do not raise an error if it doesn't work. We may want to warn about it, but in general this sort of non-essential feature should not cause a hard failure. Change-Id: If4fe8db0c7893c39627efe72c9cd9ebf7ed63f04 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6213 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-30 r/4537 fix(tvix/eval): address various clippy lintsVincent Ambo1-1/+3
Change-Id: I3ea0f51475e80948adfeb5d1620c1f2665cc39bc Reviewed-on: https://cl.tvl.fyi/c/depot/+/6201 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-28 r/4519 feat(tvix/eval): resolve relative path literalsVincent Ambo1-3/+8
Resolves relative paths (e.g. `./foo`) either relative to the location of the Nix file, or relative to the working directory if none is supplied. Change-Id: I70ec574657b221b458015117a004b6e4a9c25a30 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6185 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-26 r/4505 feat(tvix/eval): use rustyline crate for REPLVincent Ambo1-19/+49
This is a substantially nicer experience, immediately granting us history, proper exiting and so on. Change-Id: Iba4cb1713b9ac53d0799722bdbe2cd0e94a2f527 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6171 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-25 r/4488 feat(tvix/eval): Expose interpret + related types from libGriffin Smith1-12/+1
Add a new `lib.rs` to tvix/eval, which `pub use`s the `interpret` function, and all types mentioned in its return type, and then uses *this* instead of direct `mod` statements in the `main.rs` to implement the entrypoints to the interpreter. This is in preparation for calling these functions from integrated benchmarking infrastructure using Criterion, though other things (like integration tests) might want to do that as well. Change-Id: I7b585134a96b1c56a2ac64d2036b0e51d321bd27 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6155 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: grfn <grfn@gws.fyi>
2022-08-24 r/4461 feat(tvix/tests): check in Nix' language test suiteVincent Ambo1-2/+5
This adds scaffolding code for running the Nix language test suite. The majority of eval-okay-* tests should eventually be runnable as-is by Tvix, however the eval-fail-* tests might not as we intend to have more useful error messages than upstream Nix. Change-Id: I4f3227f0889c55e4274b804a3072850fb78dd1bd Reviewed-on: https://cl.tvl.fyi/c/depot/+/6126 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4408 chore(tvix/eval): wire things up for development flowVincent Ambo1-1/+1
This creates a REPL which outputs compiled bytecode, constants, and VM results for code snippets. Change-Id: If63f79a961456afd6a4cdf59b994107ff7ab8b47 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6072 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Autosubmit: tazjin <tazjin@tvl.su>
2022-08-12 r/4407 feat(tvix/eval): add initial stack-based VMVincent Ambo1-0/+1
This can't do anything other than compute a single literal, for now Change-Id: Ia28f9da51c906b590a198e77a4ca5d45a871106b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6071 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4406 feat(tvix/eval): add initial barebones compilerVincent Ambo1-0/+1
This compiler can only take care of very trivial literals so far. Change-Id: I9dfac75a801b7235f868061a979ae24159fe1425 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6070 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4405 feat(tvix/eval): add initial chunk representationVincent Ambo1-0/+1
Change-Id: I53202e93938bede421c8f1c98901e4c67544e257 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6069 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4404 feat(tvix/eval): add initial opcode representationVincent Ambo1-0/+1
Change-Id: Ibc7685a6b0b92e08f0b6c82cf7d9b04fbb593a4e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6068 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4403 feat(tvix/eval): add initial value representationVincent Ambo1-0/+1
Change-Id: I427a04e89994662df2750dffe21991bad48aab15 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6066 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4401 chore(tvix/eval): bootstrap some evaluator boilerplateVincent Ambo1-1/+47
Change-Id: I7770a20948d18a8506c2418dea21202aa21a6ddc Reviewed-on: https://cl.tvl.fyi/c/depot/+/6064 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-12 r/4398 feat(tvix/eval): check in generated project skeletonVincent Ambo1-0/+3
Change-Id: Iecc8283abb289de71f22076fd88892f6ded99cb3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6062 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>