about summary refs log tree commit diff
path: root/tvix/eval/src/lib.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-09-18 r/4911 refactor(tvix/eval): use Clap for arg+env parsingGriffin Smith1-1/+1
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-18 r/4901 test(tvix/eval): Add proof-of-concept test for ChunkGriffin Smith1-0/+2
This is pretty boring at the moment, but mostly serves as a foot in the door in the direction of writing more tests Change-Id: Id88eb4ec7e53ebb2d5b5c254c8f45ff750238811 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6637 Autosubmit: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-09-17 r/4894 test(tvix/eval): Add proptests covering trait impls for StringGriffin Smith1-0/+2
Add a suite of proptests covering the laws of the handwritten stdlib trait impls (Eq, Ord, and Hash) for String, generated from a new set of macros for generating those tests which can be applied to other types. Change-Id: Ib3276c9e96fca497aece094e5612707d3dc77ccd Reviewed-on: https://cl.tvl.fyi/c/depot/+/6626 Autosubmit: grfn <grfn@gws.fyi> Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-09 r/4780 chore(tvix/eval): clean up remains of previous disassembler implVincent Ambo1-1/+0
Change-Id: Ib402ea23a58dc52ed0c5a97178cb5d0e53d69300 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6454 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-09 r/4776 chore(tvix/eval): export some symbols from the crateVincent Ambo1-1/+5
These are required for tvixbolt to work. This interface is definitely not stable yet, though. Change-Id: I4076498e8f42311de74ee4f33c93a3ee0c5f8d3a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6450 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-09 r/4775 feat(tvix/eval): implement DisassemblingObserver for compilerVincent Ambo1-3/+1
This type implements an observer that is called whenever the compiler emits a chunk (after the toplevel, thunks, or lambdas) and prints the output of the disassembler to its internal writer. This replaces half of the uses of the `disassembler` feature, which has been removed from the Cargo configuration. Note that at this commit runtime tracing is not yet implemented as an observer. Change-Id: I7894ca1ba445761aba4ad51d98e4a7b6445f1aea Reviewed-on: https://cl.tvl.fyi/c/depot/+/6449 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-09 r/4774 feat(tvix/eval): implement (compilation) observer traitVincent Ambo1-0/+1
This trait will enable library users of tvix-eval to observe internal happenings of the compilation and runtime processes. The initial methods of the observer will be called whenever the compiler emits a chunk. Change-Id: I668f6c2cfe3d6f4c1a1612c0f293831011768437 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6448 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-06 r/4677 refactor(tvix/eval): introduce UpvalueCarrier traitVincent Ambo1-0/+1
This trait abstracts over the commonalities of upvalue handling between closures and thunks. It allows the VM to simplify the code used for setting up upvalues, without duplicating between the two different types. Note that this does not yet refactor the VM code to optimally make use of this. Change-Id: If8de5181f26ae1fa00d554f1ae6ea473ee4b6070 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6347 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-02 r/4588 feat(tvix/eval): introduce mechanism for defining builtinsVincent Ambo1-0/+1
Adds a new builtins module in which builtins can be constructed. The functions in this module should return a correctly structured value to be passed to the compiler's `globals`. This is wired up all the way to the compiler with an example `toString` builtin, available as a global. Note that this does not yet actually behave like the real toString, which has some differences from `Display`. Change-Id: Ibb5f6fbe6207782fdf2434435567fc1bd80039a5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6254 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-30 r/4533 feat(tvix/eval): implement optional runtime tracingVincent Ambo1-0/+3
This adds a `disassembler` feature to the crate configuration that traces the operations executed and the state of the stack at runtime. This can be enabled by compiling with `--feature disassembler`. This will also gain a more sensible layout of code slices eventually. Change-Id: I34c15e1cd346ecc4362b5afba6bf82dd49359d20 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6193 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-26 r/4507 feat(tvix/eval): add mechanism for emitting warnings from compilerVincent Ambo1-0/+1
These can be used predominantly to emit warnings about things that the compiler can infer, such as deprecated language features. Change-Id: I3649c625459d7f3f95cdf42d5c651d23d66569ec Reviewed-on: https://cl.tvl.fyi/c/depot/+/6174 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-25 r/4488 feat(tvix/eval): Expose interpret + related types from libGriffin Smith1-0/+14
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>