Commit graph

532 commits

Author SHA1 Message Date
Profpatsch
f05bece2cb refactor(users/Profpatsch/read-http): parse headers as utf8
Headers should always be ASCII, so let’s crash if they are not. The
thing gets a lot easier to use, and clients who fail this restriction
can just fuck off.

Also actually print the results to stdout instead of stderr …

Change-Id: I782c96c537ae11b541175e96453c4114e0a71b05
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2451
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 11:10:00 +00:00
Profpatsch
ef743ffbb5 fix(users/Profpatsch/lib): eprintenv should exec into prog
Change-Id: I2eab4ce24871121381011c1cfc8ef5e042502cb2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2450
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 11:10:00 +00:00
Profpatsch
5d44df3af6 refactor(users/Profpatsch): move arglib_netencode into its own lib
arglib is the simple idea of passing structured data via a
conventional environment variable instead of implementing an optparser
for every little tool.

Pop the envvar, decode the contents, return the contents.

Change-Id: Ie44148293a58aae9a0a613895176227d43b491bb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2449
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 11:10:00 +00:00
Griffin Smith
c726c6c264 feat(gs/emacs): Only run clj-kondo on clojure files
Change-Id: Ia7f18e0514f29e450dfc6a7bbdbc5e47ab7636b5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2460
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2021-01-29 21:47:49 +00:00
Griffin Smith
892c51caa6 fix(gs/emacs): Don't try to load agda-mode
It's not installed because it's broken right now

Change-Id: I1bf198788fb90aabe3ba1a7b65399c3579983704
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2459
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2021-01-29 21:47:49 +00:00
Griffin Smith
4856643282 feat(gs/emacs): Add a proptest snippet
Change-Id: If1e0a206a19101928375cec230629de066f9326e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2429
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2021-01-29 21:47:49 +00:00
Griffin Smith
31fcf6dfe4 feat(gs/emacs): Fix highlighting on line-number-current-line
This appears to be getting overridden by a package somewhere now

Change-Id: I4f0776b5ae65e5cfa936e3636ce1bb5e2c85790a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2427
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2021-01-29 21:47:49 +00:00
Griffin Smith
6add13a29b feat(gs/emacs): Add < to evil-surround-pairs in rust-mode
In addition to >

Change-Id: I3b42d396e9eb3c4f6dcdf8ab2b804804100a103c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2426
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2021-01-29 21:47:49 +00:00
Griffin Smith
323932ee6c fix(gs/system): Don't try to set hard fd limit
This gives a permission denied error when I try to log in

Change-Id: Ibb9a66bb0ccec5fdf6839dd38ffd7e0a782687d6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2425
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2021-01-29 21:47:49 +00:00
sterni
001ee91169 feat(users/sterni): move clhs.clhs-lookup to clhs-lookup
This way ci should pick up on clhs-lookup since only a single derivation
is exposed with the default.nix and it is less cumbersome to type the
attribute path (users.sterni.clhs.clhs-lookup →
users.sterni.clhs-lookup). The exposed CLHS wasn't used for anything
anyways and I can always expose it again using passthru or extra if it's
ever merged.

Change-Id: I6c5aeba1b58ca650700c6efa0913e4b42685ea6b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2461
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-01-29 17:36:40 +00:00
Profpatsch
1fb5a17f14 feat(users/Profpatsch): add read-http
reads a http request or response from stdin, and parses its headers
into a netencoded record.

Darn rust code took way too long to write.

Change-Id: Ie99faa6d4bbd4996fa4e43fb119a11d85b611c99
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2447
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-27 13:41:18 +00:00
Profpatsch
f68781da1b chore(users/Profpatsch/netencode): netencode.nix -> gen.nix
Change-Id: I7ccbfe863fbff65015caa8c740b80c4bb5c59dc1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2446
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-27 13:41:18 +00:00
Profpatsch
b725e9b7e4 feat(users/Profpatsch/netencode): add dwim function to nix gen
Basically what you expect, strings to text, ints to 64-bit integers,
attrs and lists to nested records and lists.

Change-Id: I9d3d841f32ab32a152cd61522f02ebde4a9b11d3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2444
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-27 13:41:18 +00:00
Profpatsch
a044a87084 fix(users/Profpatsch/netencode): remove Boxes in AST struct
Apparently HashMap and Vec already do internal boxing, so the extra
indirection in the value isn’t needed.

Then, in order to make things uniform, move the boxing of `Sum` into
the `Tag` value. No extra boxing in the recursion! \o/

Change-Id: Ic21d2e3e6ac0c6e1f045bf2c9d3e9c5af446fcff
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2443
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-27 13:41:18 +00:00
Vincent Ambo
83465be599 feat(3p/telega): Pin tdlib version used for telega
Recent channel updates have caused some issues for telega.el, mostly
because the version of tdlib (the C++ library for Telegram) and the
Emacs package are out of sync.

This overrides the version used in the Emacs package to a "known good"
commit. It would be useful to change the tdlib derivation in nixpkgs
to make this version mismatch a hard build error.

Change-Id: I9c994f783e1cc17e933432507cd13b65697efd4a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2445
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-26 13:25:43 +00:00
Vincent Ambo
aa6e7f7c10 chore(tazjin/emacs): Disable my default dark theme temporarily
There's a giant laser in the sky which makes it hard to read anything
on a dark theme.

Change-Id: I1dd0631dc8f8f693cceada4e62b25d4bde322e09
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2442
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-26 10:29:16 +00:00
Vincent Ambo
cf4357d9b7 chore(tazjin/emacs): Remove some unused packages
Change-Id: I4adf7c1e028c997f776c635e1c6210f904274582
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2441
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-25 19:18:09 +00:00
multi
4ac51ea504 chore(users/multi): remove user from the depot.
This commit removes my user directory in the depot, my user account on whitby,
my entry in the LDAP database, and my entry in the website graph. I've had my
fun with TVL, but I want to move on to spending time on some other things.

This additionally removes aranea from the website graph, which they have
requested in private.

Change-Id: I2d098c8fe239f20d9f6c6cbf66a3dfb4a955a4cf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2436
Tested-by: BuildkiteCI
Reviewed-by: multi <depot@in-addr.xyz>
Reviewed-by: lukegb <lukegb@tvl.fyi>
2021-01-23 21:13:39 +00:00
Profpatsch
81d5571398 feat(users/Profpatsch/netencode): rename spec -> README
Change-Id: I0afda1c3705b8789cf6a0c57f7b74d005deb4ff5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2433
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-23 15:37:26 +00:00
Profpatsch
222016a174 feat(users/Profpatsch/netstring): add README
Change-Id: I2b5e74f376ac2212ec12fd85267e115621095639
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2432
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-23 15:33:50 +00:00
Profpatsch
cc3f54a0ee feat(users/Profpatsch/netstring): add rust to_netstring
Change-Id: I539472fc9ebc3ebe6c34e01fde9c08d3e2e3558c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2431
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-23 15:33:50 +00:00
Vincent Ambo
ea9982d9ea feat(tazjin/nittredir): Add Chrome extension to redirect to Nitter
There is another extension for this already, but it hooks in after the
page has already started loading - doing it on the URL change handler
is much faster.

Change-Id: I442552cbd8bb040df999a1624cafd436f4a7b875
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2430
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-20 15:36:05 +00:00
Vincent Ambo
de64ebbbaa feat(tazjin/emacs): Reset keyboard layout before locking screen
I managed to lock myself out by having the layout set to Russian while
locking the screen. This prevents that from happening.

Change-Id: I15780d2a626d96abe0af8db3736fad75034e66d8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2424
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-19 15:04:16 +00:00
V
29db630a39 chore: Remove banned user
Change-Id: Icd61f7c567a327c74a4f381168e94737b2b30702
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2422
Tested-by: BuildkiteCI
Reviewed-by: edef <edef@edef.eu>
Reviewed-by: tazjin <mail@tazj.in>
2021-01-19 10:30:19 +00:00
Vincent Ambo
5868d4bd49 refactor(tazjin/rlox): Prepare scanner for shared use
In the book, the clox interpreter has its own scanner which uses a
pull-based model for a single pass compiler.

I can't be bothered to write another scanner, or amend this one into
pull-mode to work with the treewalk interpreter, so instead I will
just reuse it and pull from a vector of tokens.

The tokens are shared between both interpreters and the scanner is not
what I'm interested in here.

Change-Id: Ib07e89127fce2b047f9b3e1ff7e9908d798b3b2b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2420
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-19 09:57:05 +00:00
Vincent Ambo
1ff7a2686c refactor(tazjin/rlox): Add Interpreter trait for switching impls
Change-Id: Iae28d64ce879014c5e5d7e145c536c1f16ad307d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2418
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2021-01-18 00:24:16 +00:00
Vincent Ambo
d6d3c12efb feat(tazjin/rlox): Implement simple arithmetic operators
Change-Id: I9873bcd281053f4e9820a5119f5992a0b8cb8cfc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2417
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-01-17 21:17:54 +00:00
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