Commit graph

12 commits

Author SHA1 Message Date
Vincent Ambo
0a27344953 chore(3p/sources): bump nixpkgs & overlays (2023-02-07)
Included fixes:

* //3p/overlays: tdlib override no longer needed (bump has landed upstream)
* //corp/{predlozhnik,tvixbolt}: bump wasm-bindgen to match nixpkgs

Home-manager has not been bumped as it has introduced an
incompatibility with Nix 2.3

Change-Id: I96ac3462b82c73db1ba23be03d7968f10abc9b53
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8033
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Reviewed-by: sterni <sternenseemann@systemli.org>
2023-02-07 13:46:35 +00:00
Vincent Ambo
5d73c06b1a refactor(tvix/eval): use im::Vector for NixList representation
This is a persistent, structurally sharing data structure which is
more efficient in some of our use-cases. I have verified the
efficiency improvement using `hyperfine` repeatedly over expressions
on nixpkgs.

Lists are not the most performance-critical structure in Nix (that
would be attribute sets), but we can already see a small (~5-10%)
improvement.

Note that there are a handful of cases where we still go via `Vec`
that need to be fixed, most notable for `builtins.sort` which can not
currently be implemented directly using `im::Vector` because of a
restrictive type bound.

Change-Id: I237cc50cbd7629a046e5a5e4601fbb40355e551d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7670
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-12-29 12:27:59 +00:00
Vincent Ambo
f282984c25 fix(tvix/eval): use rnix-parser from crates.io
A few weeks ago, oberblastmeister did a release to crates.io so we can
stop importing it via GitHub.

Change-Id: I9d5fa5cd281685779c71b12fed45ed201a1db17e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7532
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-12-06 18:29:50 +00:00
Vincent Ambo
a8f7383fcb refactor(tvixbolt): use details elements for toggling outputs
For optional outputs (runtime trace & AST) this has a slightly nicer
user experience.

Note that the code of this is a bit verbose because doing a naive
implementation hits dumb behaviours of browsers that result in
infinite loops.

Thanks Profpatsch for the suggestion.

Change-Id: I8945a8e722f0ad8735829807fb5e39e2101f378c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7006
Reviewed-by: j4m3s <james.landrein@gmail.com>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2022-10-16 12:26:56 +00:00
sterni
059dea0e32 chore(3p/sources): Bump channels & overlays
* //3p/overlays: kill electrum override applied upstream

* //corp/tvixbolt,
  //users/tazjin/predlozhnik:
  update wasm-bindgen to match nixpkgs and run `cargo update`

Change-Id: If4327112832fd0c7938962dd8d3888d4730b7532
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6874
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
2022-10-06 23:23:42 +00:00
Vincent Ambo
c46025d520 fix(tvix/eval): support string identifiers in inherits
This updates rnix-parser to a version where inherits provide an
iterator over `ast::Attr` instead of `ast::Ident`, which mirrors the
behaviour of Nix (inherits can have (statically known) strings as
their identifiers).

This actually required some fairly significant code reshuffling in the
compiler, as there was an implicit assumption in many places that we
would have an `ast::Ident` node available when dealing with variable
access (which is then explicitly only not true in this case).

Change-Id: I12f1e786c0030c85107b1aa409bd49adb5465546
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6747
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-22 23:07:14 +00:00
Vincent Ambo
bb47baf638 feat(corp/tvixbolt): persist state in tvixbolt's URL
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>
2022-09-18 16:40:23 +00:00
Vincent Ambo
993c22de59 chore(corp/tvixbolt): add yew-router dependency
This will be used to set/get query parameters for making shareable links.

Change-Id: I05ccf8cab2521564710523ccd3b25ec26f435dd5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6633
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2022-09-18 16:40:23 +00:00
Vincent Ambo
b3cc4c8c2c chore(tvix/eval): bump rnix-parser to latest HEAD
This bumps rnix-parser to a commit that should be unaffected by the
Nix >= 2.4 bug that prevents it from cloning repositories with filters.

Change-Id: Ie01da95245ec6740fa889eb710819e512202f665
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6634
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-18 16:24:40 +00:00
Vincent Ambo
5eda0fbd86 feat(corp/tvixbolt): add Nix build instructions
Now that tvix-eval has almost caught up, tvixbolt can be built in
the depot tree.

Change-Id: Ib26dd98727b110ad8d668aec60db99678644a167
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6491
Tested-by: BuildkiteCI
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 10:45:22 +00:00
Vincent Ambo
010a96e525 refactor(corp/tvixbolt): adapt for tvix-eval's upcoming observer API
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>
2022-09-04 17:15:19 +00:00
Vincent Ambo
8655440ae3 feat(corp/tvixbolt): check in initial tvixbolt version
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>
2022-09-04 14:05:38 +00:00