Commit graph

555 commits

Author SHA1 Message Date
Vincent Ambo
7fb93fb490 feat(tazjin/rlox): Bootstrap VM for Lox bytecode
Change-Id: I479e20bf2087e5c4aa20e31b364c57ed0d961bcf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2416
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-01-17 21:17:54 +00:00
Vincent Ambo
b1d0e22b1f chore(tazjin/rlox): Move other modules under treewalk::
It's unclear if the second part of the book can reuse anything from
the first part (I'm guessing probably the scanner, but I'll move that
back if it turns out to be the case).

Change-Id: I9411355929e31ac6e953599e51665406b1f48d55
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2415
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-17 21:17:54 +00:00
Vincent Ambo
c26915d012 feat(tazjin/rlox): Track source lines along with bytecode
Change-Id: I272e73b9b1c9571fbfe4fa983fb4283ddee02bd4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2414
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-17 21:17:54 +00:00
Vincent Ambo
49c4cc6c56 feat(tazjin/rlox): Initial bytecode representation
This is significantly simplified from the version in the book, since
I'm using Rust's Vec and not implementing dynamic arrays manually.

We'll see if I run into issues with that ...

Change-Id: Ie3446ac3884b850f3ba73a4b1a6ca14e68054188
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2413
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-17 21:17:54 +00:00
Vincent Ambo
30a6fcccee refactor(tazjin/rlox): Move entrypoints into interpreters
Right now this introduces a simple mechanism to flip between the
interpreters.

Change-Id: I92ee920c53d76ab6b664ac671993a6d6426af61a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2412
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-17 21:17:54 +00:00
sterni
861c0f0c79 feat(sterni/clhs): add cli to lookup symbols in the CLHS
Probably very similar to M-x sly-hyperspec-lookup: take a list of
common lisp symbols on the command line open the corresponding pages
in a local copy of the hyperspec in $BROWSER. Optionally the paths can
be printed to stdout.

Change-Id: I389e254f14eb0fc8fd8b18a4dbfe7adeeda9ba72
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2397
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-01-17 13:17:28 +00:00
Profpatsch
80e1ece329 feat(users/Profpatsch): set up a file watcher for tree sitter
Uses inotify to watch a file and print when it is modified, so we can
update the parser and display the sexp on the terminal.

Now the setup is good enough to start experiementing with queries on
the syntax tree.

Change-Id: I091587fc495ff627c79a69a52915aaaa8c51fcd2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2411
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-17 11:37:39 +00:00
Vincent Ambo
f8b3e2a100 refactor(tazjin/rlox): Move treewalk interpreter into subdirectory
Change-Id: I9163f75db5a1ff75e1b1f81bad78fd9d8ddb104a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2409
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-17 09:34:13 +00:00
Vincent Ambo
052f8976bb fix(tazjin/rlox): Include static globals in resolution
Change-Id: Id377ce1fe4c9b9cd65395d15873399d9b6d38af8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2408
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-17 09:34:13 +00:00
Vincent Ambo
06a6aa5dc0 refactor(tazjin/rlox): Call resolver from interpreter
This makes the interpreter API a bit cleaner and allows for tighter
integration between the two parts (e.g. for static globals, which are
unhandled in the resolver right now).

Change-Id: I363714dc2e13cefa7731b54326573e0b871295d6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2407
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-17 09:34:13 +00:00
Profpatsch
9ea76fdf1a feat(users/Profpatsch): add a tree-sitter parser for nix
Uses the rust library to set up a simple nix parsing expression, which
reads a nix file and prints the sexp tree.

Change-Id: I32dc9c7b39aa0f7ffa2b99348d6c2269e5fe1a6a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2402
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-17 07:51:52 +00:00
Vincent Ambo
e7a7e09300 chore(tazjin/homepage): Remove mentions of Twitter
I've stopped using it. This makes the header look a bit empty, but
I'll write new copy at some point.

Change-Id: I39bf36ba915c44e3d57905d0036de693b6431071
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2406
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-01-16 20:51:48 +00:00
Vincent Ambo
da7e99a4ff feat(tazjin/rlox): Use variable depth for env lookup
Finishes the binding implementation from https://craftinginterpreters.com/resolving-and-binding.html

Change-Id: I1e2c1f4139d9e77ce0b99e38db26edd4cdb56ad2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2404
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-16 13:46:31 +00:00
Vincent Ambo
29335a8b63 feat(tazjin/rlox): Implement variable depth resolver
Implements the first part of the resolver from
https://craftinginterpreters.com/resolving-and-binding.html

This is wired up to the execution paths in main, but not yet in the
tests. The resolved depth is also not actually used for variable
lookups (yet).

Change-Id: I3a8615252b7b9b12d5a290c5ddf85988f61b9184
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2403
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-16 13:46:31 +00:00
multi
f472c82427 chore(users/multi): Remove old SSH keys attribute.
Change-Id: I5d26aab3865593b74a13794947ad61396135a207
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2400
Tested-by: BuildkiteCI
Reviewed-by: multi <depot@in-addr.xyz>
2021-01-15 13:06:33 +00:00
multi
4bb250b530 chore(users/multi): Refactor SSH keys and add remote builds key.
This commit rearranges my SSH keys, and adds a public key for accessing whitby
as a remote builder from my laptop.

Change-Id: Ide1a9e296d307d141c1a732d01923e46772180a9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2398
Tested-by: BuildkiteCI
Reviewed-by: multi <depot@in-addr.xyz>
2021-01-15 13:06:33 +00:00
Vincent Ambo
740a9a3565 feat(tazjin/rlox): Implement support for closures
Change-Id: I0ffc810807a1a6ec90455a4f2d2bd977833005bd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2396
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 20:26:37 +00:00
Vincent Ambo
39439d59e8 feat(tazjin/rlox): Implement early return from functions
In the book this is implemented via exceptions as control flow, and
I'm sticking somewhat closely to that by doing it via an error
variant.

Change-Id: I9c7b84d6bb28265ab94021ea681df84f16a53da2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2395
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 20:26:37 +00:00
Vincent Ambo
20a6cfeee2 refactor(tazjin/rlox): Let scanner tokens own their lexeme
This removes the runtime dependency on a borrow into the program
source code.

It's not yet ideal because there are a lot of tokens where we really
don't care about the lexeme, but this is what the book does and I
am not going to change that.

Change-Id: I888e18f98597766d6f725cbf9241e8eb2bd839e2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2394
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 16:53:02 +00:00
Vincent Ambo
1d8e3f4f8b feat(tazjin/rlox): Implement function definitions
... with this, functions now work.

Note that this bubbled up another weird code structure nit: The
parser::Function type should probably not carry its name directly.

However this doesn't matter much and I don't care right now.

Change-Id: If8e3b23f07033260433b9acd45f37c0e61fd2ff8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2393
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 15:19:01 +00:00
Vincent Ambo
56d8fa97ed feat(tazjin/rlox): Implement calling user-defined functions
This slightly jiggles around interpret_block to let callers pass in an
environment.

Change-Id: I03112a38be0e8696242d8eae8d41da8c2cc66b48
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2392
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 15:19:01 +00:00
Vincent Ambo
fe97398fd9 refactor(tazjin/rlox): Thread lifetimes through interpreter
In order to store a function in the interpreter's representation of a
callable, the lifetimes used throughout rlox need to be threaded
through properly.

This is currently not optimal, for two reasons:

* following the design of the book's scanner, the source code slice
  needs to still be available at runtime. Rust makes this explicit,
  but it seems unnecessary.

* the interpreter's lifetime is now bounded to be smaller than the
  source's, which means that the REPL no longer persists state between
  evaluations

Both of these can be fixed eventually by diverging the scanner from
the book slightly, but right now that's not my priority.

Change-Id: Id0bf694541ff59795cfdea3c64a965384a49bfe2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2391
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 15:19:01 +00:00
Vincent Ambo
1ed34443d8 feat(tazjin/rlox): Parse function declarations
Change-Id: I1db4316563827976e5233dc7a626968f80b992ef
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2390
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 02:05:00 +00:00
Vincent Ambo
8bcbb04160 refactor(tazjin/rlox): Add helper method for parsing identifiers
Change-Id: I9a45f823f16919319d6135225d5bd53ed54c2530
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2388
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 02:05:00 +00:00
Vincent Ambo
fcd9801b01 refactor(tazjin/rlox): Let Parser::match_token take a single kind
This is much easier to read & write. It's been annoying me all the way
through.

Change-Id: Ia91756d3111a2ce3f74e1c14bccc210118d221dd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2387
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 02:05:00 +00:00
Vincent Ambo
f4a6e9f133 test(tazjin/rlox): Add a handful of interpreter tests
Change-Id: I32dd896d42cc73d68d73093e9cbb74b48d95e041
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2386
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 00:52:51 +00:00
Vincent Ambo
0c1c4584cb feat(tazjin/rlox): Implement PartialEq for interpreter::Value
Values have equality, unless they're functions.

Change-Id: Ie5c623081a1fa556e6b7a5251b0ce85af68dd31a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2385
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 00:52:51 +00:00
Vincent Ambo
9b477975d4 feat(tazjin/rlox): Always return values from interpreter
This makes it easier to write interpreter tests, as we don't need to
look at output and such.

Change-Id: I6f8ce0cb0c482b8c00707d09e6be750c8e534176
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2384
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 00:31:27 +00:00
Vincent Ambo
a03b509fb8 refactor(tazjin/rlox): Constructor for interpreter with globals
Change-Id: Id8242c22500c8e2781cc656d3faabb28d9bdf091
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2383
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 00:31:27 +00:00
Vincent Ambo
26544aa5f0 feat(tazjin/rlox): Implement function call evaluation
Change-Id: I6767c3a1a9654475b4066415f8c026b9c5b5907a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2382
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 00:31:27 +00:00
Vincent Ambo
090c96eae9 feat(tazjin/rlox): Scaffolding for builtin functions
... and adds an example builtin which returns the current epoch.

The types introduced by this, especially in the interpreter module,
are going to be used for user-defined functions, too.

Change-Id: I0364a67241e94642cde08489ac711a340e30ebe8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2381
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-14 00:31:27 +00:00
sterni
e93a2fc48f feat(ops/nixos/whitby): add sterni user
Change-Id: Ia6790913ea2777a9d4ca89830436623766991c13
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2368
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-01-13 22:05:33 +00:00
Vincent Ambo
73c2b8fb85 refactor(tazjin/rlox): Wrap interpreter values in new enum
This makes it possible to distinguish between literal and other
values, such as functions.

Change-Id: I4d87b96c2988e25a61eecfeeb56188fabfd0dc40
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2367
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-13 17:03:15 +00:00
Vincent Ambo
f3c60865a3 feat(tazjin/rlox): Parse function calls
Change-Id: I1836c73dbfd5fc4ca30c2d22bbffee2fb222d566
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2366
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-13 17:03:15 +00:00
Griffin Smith
2253617e0b feat(gs/emacs): Add gpg encrypted +private.el
This has auth tokens etc.

Change-Id: I0877744de38d31f2dfe402ab009f31a22467c3b4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2365
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2021-01-13 16:53:58 +00:00
Griffin Smith
11da5b2fbc feat(gs/yeren): Blacklist the psmouse module
There appears to be an issue where the internal trackpad tries to
register itself as a ps1 mouse rather than a usb one, which causes some
dmesg warnings that may or may not cause actual problems. Regardless,
blacklisting this should be harmless.

Change-Id: I00fb539b8acf4fbf1b9125786ea6dc4f649b08c7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2364
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
0f75042fea feat(gs/home): Add alias to cargo test and watch
Change-Id: I6f2c7dfaa8cc9da9ca4c602b521a27ed3fecd6da
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2363
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
bbea618a98 feat(gs/emacs): Add commands to enable/disable tvl notifications
Change-Id: Ie43680eeb963e9328adc9f79107fff2d0911cc99
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2362
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
7850ad0321 feat(gs/yeren): Get internal soundcard working
Change-Id: Idafb951eb995a92e955e42bee5b563a738ce49c7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2361
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
f5e72972fd feat(gs/home): Install xonotic
Change-Id: I67742f843e45d50fcff00c198ac6e8345859f7c9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2360
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
66763d72e0 feat(gs/home): Enable git-rerere
Change-Id: I5a30b554dbda2ba53032bef3ff78b67a4cf95aa4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2359
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
41281020aa feat(gs/home): Install ngrok
Change-Id: If4a8d914e110699f87e7459685fc0b620e0f0203
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2358
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
486ca1633b fix(gws.fyi): Set config.allowUnfree in the shell.nix
Necessary for tarsnap (for now), though I'm probably gonna get rid of
that sooner rather than later.

Change-Id: I4614a8e4ea62edd247a0fead6ae38d1f870b36f4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2357
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
733871195c feat(gs/emacs): Configure lsp-mode for rust
- add <> as evil-surround pairs (this isn't working atm)
- Make lsp-ui-doc frames a reasonable size
- Use clippy as the cargo watch command for rust-analyzer

Change-Id: Ieee2633cbb332af6513af6b7484adeef5bdb3e06
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2356
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
be9b62c88d feat(gs/emacs): Disable flycheck-mode in clojure-mode
None of the flycheck checkers work, really, and even if they did I
ignore them most of the time.

Change-Id: Iebb0b5202207f1fbada197bb5667fa8431ab879c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2355
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
fdccca5b85 feat(gs/emacs): Bind original org-clock-in binding
This is too deep in my muscle memory, and actually fairly ergonomic on
my keyboard

Change-Id: I2e57c3221a52f00f62e5a7427bdfae6fe37ff850
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2354
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Griffin Smith
5e30c3fe1b feat(gs/emacs): Add new snippets for rust-mode
Add snippets for async tests and benchmarks

Change-Id: Ic1ad46c7f76b1e68c4043a13e821583195c661ab
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2353
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2021-01-13 16:53:58 +00:00
Vincent Ambo
b4e420d4ff chore(3p): Bump NixOS channels to 2021-01-09
Your regularly scheduled channel update, but slightly more regular
than before.

Included fixes:

* 3p/emacs: Pick telega.el from stable channel, unstable is broken.
* glittershark/fprintd: Compile with gcc9, since build fails with the
  new default of gcc10
* glittershark/fprintd: Use a global overlay for the fprintd package
  until https://github.com/NixOS/nixpkgs/pull/108962 lands in
  nixos-unstable
* glittershark/home: Don't install rr, as it's not building with gcc10

Co-Author: Griffin Smith <grfn@gws.fyi>
Change-Id: Ia715fef64a405a220049fc540017356fa7370e0b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2341
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Tested-by: BuildkiteCI
2021-01-13 16:53:20 +00:00
Kane York
216e7334f6 feat(u/riking/dotfiles): enable SHOW_DATETIME for xsecurelock
Change-Id: I095c38ce2d9939836fa285d33b7ab0129cc695ac
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2352
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2021-01-11 21:38:38 +00:00
Kane York
ec99a8dd11 feat(u/riking/dotfiles): commit regolith config
Change-Id: Ia21885adc5200ea60e309767fa27123af77ffa10
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2351
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2021-01-11 21:38:38 +00:00
sterni
923d90990e chore(sterni): init user folder
Change-Id: I34c71c72778f35df9e613314d5a99b14a5030975
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2350
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-01-11 11:43:33 +00:00
Profpatsch
04f91b5957 feat(users/Profpatsch): add script for randomly evaling nixpkgs
Running this after a codified refactor acts as a good smoke test,
if a big subset of packages is broken or any central packages are
broken, this should find them quite quickly, thanks to randomness™.

Just let it run for a few minutes and check the errors that pop up.

Change-Id: I1505dd31ca25b29254474a15cd6cb71d9743038a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2346
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: lukegb <lukegb@tvl.fyi>
2021-01-11 08:58:57 +00:00
Profpatsch
2f807d7f14 feat(users/Profpatsch): add a rewriter for lib.stdenv changes
This is in order to advance the rewriting from stdenv.lib to lib.
https://github.com/NixOS/nixpkgs/issues/108938

The hard part about changing the argument is that a package might not
include lib in its arguments, which is why I use hnix to check whether
lib is included and add it to the import list if it doesn’t already
exist there.

So far, only the really common pattern of

    meta = with stdenv.lib;

is rewritten.

Change-Id: I370f0a321b0e5a5bd21ec21fc7cefdd65ec845ed
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2345
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-10 20:03:45 +00:00
Vincent Ambo
c1cb4c260c chore(tazjin/emacs): Remove org-journal
I haven't used this much in the last months and it's causing issues
via some hook now, so bye bye.

Change-Id: If2b321887569b31c0ac7ad3fdd1b9c1d9f7b69f7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2344
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-10 13:32:47 +00:00
Vincent Ambo
4e34276b69 feat(tazjin/nisp): Add initial source-to-source transform
... this isn't finished yet, in particular it lacks:

* better support for attribute sets
* support for defining functions that take attribute sets

Change-Id: Ia897fccd9d2b674b6ed12907ae297bfdcc86db48
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2237
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
2021-01-09 16:52:34 +00:00
Vincent Ambo
88bf43878f chore(3p): Bump NixOS channels to 2020-12-28
Changes:

* ops/nixos/tvl-slapd: The NixOS module for OpenLDAP has removed the
  ability to configure OpenLDAP directly and now forces users to use
  some kind of weird Nix->OLC mapping that is mostly undocumented.

  This moves the config we need to the new format in a way that may or
  may not work and does the other arbitrary dance steps that someone
  decided to impose on us. Note that this now throws lots of warnings,
  but I can't be bothered to fix them.

* 3p: Random package removals accomodated

* users/glittershark: Pin grfn's kernel to 5.9, because the CK patch
  is not yet updated for 5.10

* users/glittershark: Update vendor hash for pg-dump-upsert, I suspect
  this changed because of something in the Go build machinery in
  nixpkgs. The deleteVendor flag also has no effect anymore and has been
  removed.

* users/glittershark: agda build is broken, commenting out development
  home-manager environment until it can be fixed

* third_party/haskell_overlay: updating random needs upper boundarles
  of a few dependencies relaxed (curse them)

* third_party/gerrit_plugins: for some cursed reason the fixed-output
  hash of the gerrit owners plugin fetchgit changed, updated.
  Same for the checks plugin.

Change-Id: Ica37995fe8039d3ba80eab643867f98795c56734
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2295
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
2021-01-09 13:21:00 +00:00
Vincent Ambo
0b4e280a07 feat(tazjin/rlox): Implement for loops via desugaring to while
Change-Id: I31a93efcc8e0c2bcb8549e2a2c05bb58d2dc74ca
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2326
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-06 23:02:31 +00:00
Vincent Ambo
d47e55ba4d feat(tazjin/rlox): Parse & interpret while statements
Change-Id: Iee772274de95dfd6a6d4af973402859aeda17b1d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2325
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-06 23:02:31 +00:00
Vincent Ambo
0a0335ae6c feat(tazjin/rlox): Parse & interpret logical operators
Change-Id: I1a7d0eda61f7f077b820dc0d2c2516e204966962
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2324
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-06 23:02:31 +00:00
Vincent Ambo
93122a212e feat(tazjin/rlox): Interpret if statements
Change-Id: Ic6aed29bec42098eb07e1ba9eb01dbcaae8d11e3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2322
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-01-06 17:14:17 +00:00
Vincent Ambo
a89777b34f feat(tazjin/rlox): Parse if statements
Change-Id: I2352d75a3f02d65a5a2d04fb2cc4daa50f11ca1e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2321
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-01-06 17:14:17 +00:00
Profpatsch
27a73171cf feat(Profpatsch/netencode): add netencode-mustache
A little executable, combining the netencode and mustache libraries to
make easy templating from the command line possible.

Combined with the nix netencode generators, it’s now trivial to
populate a mustache template with (nearly) arbitrary data.

Yay.

Change-Id: I5b892c38fbc33dd826a26174dd9567f0b72e6322
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2320
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-03 16:29:57 +00:00
Profpatsch
f1c38e2560 feat(Profpatsch): dump netencode spec & parser
The netencode standard, a no-nonsense extension of netstrings for
structured data.

Includes a nix generator module and a rust parsing library.

Imported from
e409df3861/pkgs/profpatsch/netencode

Original license GPLv3, but I’m the sole author, so I transfer it to
whatever license depot uses.

Change-Id: I4f6fa97120a0fd861eeef35085a3dd642ab7c407
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2319
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-03 16:29:57 +00:00
Profpatsch
1261616bff feat(Profpatsch/writers): add rustSimple writers
A bunch of writer functions wrapping the `buildRustCrate`
functionality of nixpkgs. Can be used to write inline rust code, or
rust code read from files with `builtins.readFile`.

Change-Id: I9d74e9381b858b485925e4dc3fbb7fc392877c0a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2318
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-03 16:29:57 +00:00
Profpatsch
e219c13328 feat(Profpatsch): add netstring helper function & python lib
Simple helper function to generate a netstring that is a list of
key-value pairs, to serialize a nix dict. Also adds a python lib to
read the serialized form into a dict again.

Change-Id: I306c0cfd51640c0658d32c8d3a4f3d332ba448f0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2315
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-03 16:12:33 +00:00
Profpatsch
baab2ce359 fix(Profpatsch/writers): ignore the most annoying flake errors
Change-Id: I3b8f51ff0dcdd842811e2fd9876cd4925c64f135
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2314
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-03 16:12:33 +00:00
Profpatsch
b046c77493 feat(Profpatsch/writers): add yants types to python3 writer
Uses the new restrict type to make sure flake errors start with an E.

Change-Id: I30369ade28e1ef612c91a368de2d5b128e6cf2a9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2313
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-03 16:12:33 +00:00
Profpatsch
6b21b108ba feat(users/Profpatsch): add writers.python3
This is a reexport of nixpkgs.writers.writePython3, but the libraries
are passed the package set, like with other writers.

Change-Id: Ia5a2ed1b6b329700836a8575d2bde768bf64fb31
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2311
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-03 16:12:33 +00:00
Profpatsch
533e365c12 feat(users/Profpatsch): add python3Lib writer
Smol writer to create a python lib directly from a nix string.
The resulting library can be consumed by the writePython3 writer.

Change-Id: Id3d793564d230b38a08f65140bda4287285e1a72
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2310
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-01-03 16:12:33 +00:00
Profpatsch
361aa2aac2 feat(emacs-tree-sitter-move): shell and json test files
Change-Id: Idadb58a935abdbfa99327ba79de8b33d38b8c722
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2264
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-01 22:40:38 +00:00
Profpatsch
5a6f781c3e fix(emacs-tree-sitter-move): get named parents & check for nils
If there was no parent, the while loop would try to get the parent of
a `nil`, which crashes and burns.

We now also ignore any non-named parents; this might be unnecessary,
if tree-sitter parent nodes are always named, but I don’t know that at
the moment and it’s not documented very well, so better safe than
sorry.

Change-Id: Ia72ee9241b885ab312f8ecf7a8fbfece7eea8f1b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2263
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-01 22:40:38 +00:00
Profpatsch
fdb47be7d7 feat(emacs-tree-sitter-move): load more than one tree sitter grammar
Change-Id: I43b8ddb180c056f1b8c650ccc915ec41bae83960
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2262
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-01 22:40:38 +00:00
Profpatsch
3279786cd2 feat(emacs-tree-sitter-move): add a simple down movement as well
Always goes to the first child for now.

Change-Id: I1d00b2f2013ba7e5f88622d1de3c99500e5f1a7a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2261
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-01 22:40:38 +00:00
Profpatsch
e07e88d81d feat(emacs-tree-sitter-move): left and up movements, skip unnamed
We skip intermediate nodes that do not have any siblings, because they
are irrelevant to navigation and just add extra keypresses without any
highlight changes. This might not be the best choice, we’ll see.

Change-Id: I75fbf79aa7915172e426442a076d57cfbebf5421
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2260
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-01 22:40:38 +00:00
Profpatsch
9da760fba4 feat(emacs-tree-sitter-move): Add tree-sitter-move-reset
Resets the cursor to the named node under the cursor.
`-right` does not do it anymore, so it’s possible to navigate on
higher levels of the tree instead of always resetting to a leaf.

Change-Id: Id330854c72ea24da0cc8611f30f5617e0f127c1b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2259
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-01 22:39:28 +00:00
Profpatsch
806c281b34 feat(users/Profpatsch): moving around via the tree-sitter parse tree
Has a little setup to get the cursor position and map it onto a tree
sitter node. The current node is saved in a cursor variable, and a
highlight overlay marks the range of the current node in the buffer.

Change-Id: I0af56115f928732e993fbefe978a246ca7c757ee
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2258
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-01 19:03:30 +00:00
Vincent Ambo
1686355d2e refactor(tazjin/rlox): Hold shared environment ptr in interpreter
Change-Id: Ia4c4ef330be431a344d42bc00d3a518825fb9399
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2305
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-12-31 19:10:39 +00:00
Vincent Ambo
b55caf0338 feat(tazjin/rlox): Implement block scope in interpreter
This is currently a bit hacky because of the environment
wrapping/unwrapping, will refactor this to just keep a single Rc
around instead.

Change-Id: Iad1cbbe35112d0329248d4655a09260fc60644c8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2304
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-12-31 19:10:39 +00:00
Vincent Ambo
8915cd6fba feat(tazjin/rlox): Implement block parsing
Change-Id: I1b7235ed71fa36120984a36f22cd564f59581352
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2303
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-31 15:33:08 +00:00
Vincent Ambo
3c979acdf3 refactor(tazjin/rlox): Unify parser::Statement & parser::Declaration
Change-Id: I6f21b246eb9d3bf760edb3220ce6be5de5b05b08
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2302
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-31 15:33:08 +00:00
Vincent Ambo
26ed836e1d feat(tazjin/rlox): Add support for scoped environments
Adds scoped environments using a sophisticated structure known as an
SRPT, which stands for "shitty parent pointer tree".

Change-Id: I62f66aabe6eb32ea01c4cabcca5b03cfefcc28ee
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2301
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-31 15:33:08 +00:00
Vincent Ambo
48a54625ce refactor(tazjin/rlox): Separate assignment and definition
So that:

> var a = 15;
> b = 12;
Error in program: Error { line: 0, kind: UndefinedVariable("b") }
> a = 12; print a;
Number(12.0)

Change-Id: I687e95ccc2d3084e39a71bd452656ae981c95191
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2300
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-31 14:32:03 +00:00
Vincent Ambo
cc958e6730 feat(tazjin/rlox): Implement mutable variable assignment
Change-Id: I56db10a5ac26958ae27a8d4c8fa7b8f8285bc7e1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2299
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-31 14:32:03 +00:00
Vincent Ambo
8ab66f1689 refactor(tazjin/rlox): Retain interpreter state in REPL
Change-Id: Id60760e241ad0e45871b48e499f58e9831d57316
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2298
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-12-31 11:19:42 +00:00
Vincent Ambo
78355d3c0b feat(tazjin/rlox): Add global variable support in interpreter
Change-Id: I4134cf78dc3934a517ad0c848ae1d3729abaf882
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2297
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-12-31 11:19:42 +00:00
Vincent Ambo
0f9a7b3f86 feat(tazjin/rlox): Parse variable assignment & access
Change-Id: I9894d76716d739e85a4757d9e658f884228e7f52
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2290
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-22 20:18:01 +00:00
Vincent Ambo
5010b79718 fix(tazjin/emacs): Don't override CARGO_INCREMENTAL
Change-Id: Ib25c45795cb8aea87fc7e22343af6710a6339d32
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2289
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-22 10:13:28 +00:00
Vincent Ambo
a104afa6ea refactor(tazjin/rlox): Introduce declarations in parser
Change-Id: I873fdd53319ec36da18926d9477e809a69dbace7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2288
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-22 10:13:28 +00:00
Vincent Ambo
75ae25daa9 feat(tazjin/rlox): Add support for statements
First part of
https://craftinginterpreters.com/statements-and-state.html

Supports print statements, as well as evaluation for the sake of
it (i.e. future side-effects).

Change-Id: Ic6653b568f98d6cfe3f297615b7113c0ba1d9a70
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2287
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-22 10:13:28 +00:00
Vincent Ambo
5d2d80795d fix(tazjin/emacs): Bind notmuch shortcuts via EXWM
Change-Id: I082ee9f75f9e0ef486bc240b4aeda3dec8e79019
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2284
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-20 16:30:54 +00:00
Vincent Ambo
8ad3e84e40 chore(tazjin/emacs): Remove #'fefes-blog
It's not worth reading anymore, he's getting old.

Change-Id: Ia9bac99169949c3f057c0e9c526cbc99e925af76
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2283
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-20 16:25:54 +00:00
Vincent Ambo
5ebe28cca2 feat(tazjin/rlox): Add runtime type error handling
Change-Id: I0d52bc9ff5be6421cb4131265ed28ce1ea7d8ff3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2282
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-20 16:25:54 +00:00
Vincent Ambo
bc6775c318 feat(tazjin/rlox): Implement tree-walk interpreter of exprs
This is only a subset of the Lox spec so far. It implements the
language up to the runtime error chapter on
https://craftinginterpreters.com/evaluating-expressions.html

Change-Id: I295dbf4b6544420d6fe80b6aaba661fb21acdea6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2281
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-20 16:25:54 +00:00
Griffin Smith
fea146deb5 fix(gs/yeren): Increase fd soft limit to 65535
I'm building a database! I have to open all the files!

Change-Id: Ie77ad6fafe837c0ddba6b5d56cdc06d787807d4e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2257
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2020-12-15 23:59:22 +00:00
Vincent Ambo
a9014203b6 chore(3p/lieer): Upgrade to lieer 1.3
* rebases the send scope patch
* removes the API key override patch, lieer now has a configuration
  option for this

Change-Id: I198e8b61855f6cdb2b1439a1c8f2d9d69261c1b5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2242
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-12-14 19:41:30 +00:00
Griffin Smith
6197e4bc81 fix(gs/system): Prefer cache.nixos over whitby
cache.nixos.org is way faster

Change-Id: If6f9a448b5a5ad7dab6d01e19c447e113a8d933a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2256
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-12-14 18:18:19 +00:00
Griffin Smith
e9e7ecfd59 feat(gs/emacs): Bring back org-clubhouse
Change-Id: Id89bd99740b7761c092a923912b07917b56f4d55
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2255
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-12-14 18:18:19 +00:00
Griffin Smith
a2c03cc78b feat(gs/yeren): Re-enable rc6 and psr
These didn't appear to be the source of the flickering after all.

Change-Id: Id3cce3e7905d0af21dc6ec4dc3a11828451378fe
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2254
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-12-14 18:18:19 +00:00
Griffin Smith
d6f11af7eb feat(gs/emacs): Update for latest doom changes
Change-Id: I771ada41a64961da9969d0ce805943698d2c9a31
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2253
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-12-14 18:18:19 +00:00
Griffin Smith
4e263520d6 feat(gs/yeren): Install a bunch of packages
Change-Id: Ie70a91f0efa2560a3ad088648f72e8a30451cbfe
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2252
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
2020-12-14 18:18:19 +00:00