Age | Commit message (Collapse) | Author | Files | Lines |
|
This uses the JSON serialisation of the AST introduced earlier to
display a text box with the serialised AST to users. Useful for
debugging.
Change-Id: Ibc400eaf5ca87fa5072d5c044942505331c3bb40
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7005
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: Adam Joseph <adam@westernsemico.com>
Reviewed-by: tazjin <tazjin@tvl.su>
|
|
This commit implements (lazy) resolution of `<...>` paths via either the
NIX_PATH environment variable, or the -I command-line flag - both
handled via EvalOptions. As a result, EvalOptions can no longer derive
Copy, meaning we have to clone it at each line of the repl - this is
probably not a huge deal as repl performance is not exactly an inner
loop and we're not cloning very much.
Internally, this works by creating a thunk which pushes a constant
containing the string inside the brackets to the stack, then a new
opcode to resolve that path via the `NixPath`. To get that opcode to
work, we now have to pass in the NixPath when constructing the VM.
This (intentionally) leaves out proper implementation of path resolution
via `findFile` (cppnix just calls whatever identifier called findFile is
in scope!!!) as that's widely considered a bit of a misfeature, but if
we do decide to implement that down the road it likely wouldn't be more
than a few extra ops within the thunk introduced here.
Change-Id: Ibc979b7e425b65cbe88599940520239a4a10cee2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6918
Autosubmit: grfn <grfn@gws.fyi>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
|
|
This lets the VM emit warnings when it encounters situations that
should only be warned about at runtime.
For starters, this is used to pass through compilation warnings that
come up when `import` is used.
Change-Id: I0c4bc8c534d699999887c430d93629fadfa662c4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6868
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
|
|
Adding `import` to builtins causes causes a bootstrap cycle because
the `import` builtin needs to be initialised with the set of globals
before being inserted into the globals, which also must contain
itself.
To break out of the cycle this hack wraps the builtins passed to the
compiler in an `Rc` (probably sensible anyways, as they will end up
getting cloned a bunch), containing a RefCell which gives us mutable
access to the builtins.
This opens up a potentially dangerous footgun in which we could mutate
the builtins at runtime leading to different compiler invocations
seeing different builtins, so it'd be nice to have some kind of
"finalised" status for them or some such, but I'm not sure how to
represent that atm.
Change-Id: I25f8d4d2a7e8472d401c8ba2f4bbf9d86ab2abcb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6867
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
|
|
This type hides away the lower-level handling of most codemap data
structures, especially to library consumers (see corresponding changes
in tvixbolt).
This will help with implement `import` by giving us central control
over how the codemap works.
Change-Id: Ifcea36776879725871b30c518aeb96ab5fda035a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6855
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
|
|
There's basically nothing that needs *ownership* of an AST
node (which is just a little box full of references to other things
anyways), so we can thread this through as references all the way.
Change-Id: I35a1348a50c0e8e07d51dfc18847829379166fbf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6853
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
|
|
This disconnects ownership of the `File` reference in a compiler from
the calling scope, which is required for when we implement `import`.
`import` will need to carry an `Rc<RefCell<CodeMap>>` (or maybe, in
the future, Arc) to give us the ability to add new detected code
files at runtime.
Note that the choice of `Arc` over `Rc` here is not ours - it's the
codemap crate's.
Change-Id: I3aeca4ffc167acbd1701846a332d93550b56ba7d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6630
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
|
|
This makes it possible to enter something into tvixbolt and then share
the link with someone else.
Suggested by Profpatsch originally.
Change-Id: I9886e76a7b821070f13ea7005df09188821e091d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6636
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
|
|
Change-Id: I633154f3a2ae2b1789992a1137c944e897c56b2c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6535
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
|
|
As previously mentioned on IRC, this is why tvixbolt is under //corp.
The majority of people in our community probably block ads anyways,
but might as well ...
The ad account is linked to the TVL legal entity.
The ad is configured not to use any personalised data. In testing it's
showing me lamps and shoes. This is the same kind of ad as on my
grammar page, predlozhnik.ru
Change-Id: I172881ed5d5ceb1fdeb2298b8f822d0c2a6518a8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6558
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
|
|
Unfortunately the codemap-diagnostic crate doesn't provide a way to
get colour control characters written to an arbitrary writer, so this
is black & white only, but we can look at this later if we introduce
something even fancier. For now it's reasonable.
Change-Id: I1c7655cc4b254f77768b5931bc95fa13b3bd7e12
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6533
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
|
|
It looks like this was intended, but typoed.
Change-Id: I830d6f0488b75b859bcf4175531c35d79cd40985
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6335
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
|
|
Most expressions people enter will probably have a fairly small
result. It's useful to see *that* it did the correct thing before
looking at *how* it did that.
Change-Id: I50d7d4c07e41f11b71a16c00c49b9553ae9e90a5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6334
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
|
|
Uses Tvix's new `TracingObserver` to optionally produce a runtime
trace, which the user can toggle via a checkbox.
Runtime traces can be quite long, so they're only produced if asked
for.
Change-Id: Id0f27dc8ef6e9d81a31ecf22c81757b066815320
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6331
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
|
|
A little bit easier to grasp what's going on then just a blank page
with a textbox ...
Change-Id: I16f456035173813d60d88ff7e5ebd14712f77ec3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6330
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
|
|
Instead of the previous hack which painfully threaded through
a structure that the disassembler could write to, Tvix's evaluator is
gaining a new "Observer" API which lets library clients observe
compilation output (and, soon!, runtime tracing).
This adapts tvixbolt to use this observer interface (with the default
`DisassemblingObserver`) to populate the `bytecode` field of its
output.
This is purely a mechanical change, no functionality is impacted.
Change-Id: I22bd2218629f30fd7351d4cc5ddcf639c12fea14
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6316
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
|
|
This is the code backing the small site currently deployed at
https://tazj.in/blobs/nixbolt/index.html
This relies on a newer version of Tvix than is available in depot and
a bunch of other stuff that isn't public yet, so for now no build file
is provided as this is heavily work-in-progress.
Change-Id: I7a8e4dbf4e11d1c70175f929e65f40ff69acbbd9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6315
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
|