Commit graph

37 commits

Author SHA1 Message Date
William Carroll
509e356bb8 feat(wpcarro/slx.js): Support JavaScript simple-select impl
See README.md

Change-Id: I6a50e34398c42aabe3cceba160be006f1867eca4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7874
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2023-01-19 18:12:59 +00:00
William Carroll
032ab16bbb feat(wpcarro/slx): Support filtering by date
Queries like `before:"03/05/2020`

Change-Id: I34b06f38c8f3abeed9ad6824cd365065a1fe8d2b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7831
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2023-01-17 21:17:19 +00:00
William Carroll
a9d866c775 feat(wpcarro/slx): Match against all columns
With `MATCH_ALL` type.

Change-Id: I2fe537c2b277a86be5c04a27da088f31fe7eb09e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7817
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
2023-01-17 21:13:17 +00:00
William Carroll
0d4f3433de feat(wpcarro/slx): Simple Select impl'd in JS
Proof-of-concept implementation of "simple select" to write browser
apps that can filter lists with labels like:

```
author:Hemingway title:For\sWhom.+
```

Change-Id: I6c4cc65fe6319c9230fdc1e983462864acdc6aef
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7812
Reviewed-by: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2023-01-17 21:08:23 +00:00
William Carroll
bd0bf6ea7d feat(wpcarro/compiler): Support Vector type
Support an array that dynamically resizes itself, and replace usages of `List`,
`Array`, and `Queue` with `Vec`.

Change-Id: I910b140b7c1bdddae40e08f8191986dccbc6fddf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7080
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
2022-10-25 04:32:59 +00:00
William Carroll
ee235235b9 feat(wpcarro/compiler): Support string literal type
```
repl> "Hello, world"
String
repl> (fn x "testing")
a0 -> String
```

Change-Id: Ia76299a56aa4d2032c9a21277e2fddfb2e055831
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7079
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
2022-10-25 03:59:07 +00:00
William Carroll
1e9c3955bf refactor(wpcarro/compiler): Modularize debug fns
Define `debug.ml` and `prettify.ml` to clean-up some code.

Change-Id: Iee2e1ed666f2ccb5e56cc50054ca85b8ba513f3b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7078
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
2022-10-25 03:59:02 +00:00
William Carroll
a8876a4cda feat(wpcarro/scratch): Implement "Algorithm W"
I've been wanting to grok Haskell-style type inference for awhile, so instead of
just watching conference talks and reading papers about it, I've decided to
attempt to implement it to more readily test my understanding of it.

Change-Id: I69261202a3d74d55c6e38763d7ddfec73c392465
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6988
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
2022-10-24 17:42:43 +00:00
William Carroll
0b04dfe03c feat(wpcarro/scratch): Rewrite Python compiler in OCaml
Just to see how productive I could be in OCaml with little familiarity. Overall
I really like it.

Change-Id: I8affc65a5ee86a29d4f8c01426529ae9948660f9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6934
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-10-10 22:35:26 +00:00
William Carroll
1ab252470a feat(wpcarro/scratch): Proof-of-concept register VM
I heard that register VMs might be slightly faster than stack VMs, and then it
occurred to me that I wouldn't know how to write a register VM if I tried. So I
wrote one (sort of).

Change-Id: I15309bca88f4b43f6e04957acedc90d9adf16673
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6902
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-10-10 17:45:49 +00:00
William Carroll
db9cb70d5d feat(wpcarro/rust): Define Rc<T> example
My foray into "smart pointer" land.

Change-Id: I4ca775c72168dd34d90bf88fa41149867cd7fdae
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6244
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
2022-09-06 18:09:30 +00:00
William Carroll
27c1763a7a feat(wpcarro/rust): Define stdin example
Pipe Rust strings to shell commands.

Change-Id: Id8afeed642d30c79e193fa9b353de081a5843eb5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6197
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-08-29 16:21:37 +00:00
William Carroll
4732603a42 feat(wpcarro/rust): Include std::fmt::Display example
Gotta know how to `to_string` things

Change-Id: I259ef61ecaf6ae7fabe0b3d211706ba5f429b3a7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6057
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-08-09 17:22:37 +00:00
William Carroll
46ba96544a docs(wpcarro/rust): Tidy-up documentation width
Line was too long

Change-Id: I62c4454307f89e089f7d4cda0721f6b9d8029ced
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5900
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
2022-06-27 18:20:53 +00:00
William Carroll
61458ac072 chore(wpcarro/rust): Include Cargo.lock
v0v

Change-Id: I0ce845e01bdb76e2894322c622919f0a24ffff7e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5899
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
2022-06-27 18:11:50 +00:00
William Carroll
0ae6a441e6 feat(wpcarro/rust): Show 3/3 json examples
See git diff

Change-Id: Ic3100dbed09775113ddb055e6ba0d5cf900426d0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5898
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-06-27 18:07:50 +00:00
William Carroll
c18ca0f852 feat(wpcarro/rust): Show 2/3 json examples
Documented in the module

Change-Id: I550c233c8116904a1f9cd6841ee778eb0abb540a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5897
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-06-27 17:18:43 +00:00
William Carroll
8e9bfaba47 feat(wpcarro/rust): Show 1/3 json examples
See json/src/main.rs

Change-Id: I83ee6b762b741a05932832a9a87eb8161bb95d0f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5896
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-06-27 16:25:37 +00:00
William Carroll
95f302f95d feat(wpcarro/rust): Create a sandbox for learning Rust
See README

Change-Id: I007a4d5c3b840986f6d3bc93aaa72d26daaa9b12
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5895
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-06-27 16:20:11 +00:00
William Carroll
5b059b4b98 docs(wpcarro/simple-select): Add README 📘
Because documentation

Change-Id: I1d805331efd5cb3ca878a1b66774d0807f735872
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5349
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-03-01 23:19:10 +00:00
William Carroll
465ddb07bb feat(wpcarro/simple-select): Support readline-style KBDs
...and prevent REPL from crashing on parse/compilation errors. Better error
messaging would be quite nice as well.

Change-Id: I47d06fd74ef65bfa3f14f0b57a5516a908321da8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5348
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-03-01 22:59:07 +00:00
William Carroll
81138b25eb fix(wpcarro/simple-select): Support regexes
The python lib for sqlite doesn't support REGEXP, so we need to support it
manually.

Change-Id: I90670ff564d6fb40e8cee30c3d1509feb2c00857
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5347
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-03-01 22:59:07 +00:00
William Carroll
426cc2db2c feat(wpcarro/simple-select): Support CSVs
Convert CSVs to in-memory SQLite tables from which we query. Also read variables
from the command-line.

For now, I'd say this is MVP-status.

Change-Id: I8b7400e60da4b14eea25c3f4b47447497a4218c8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5346
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-03-01 22:46:05 +00:00
William Carroll
0e76f30c5b feat(wpcarro/simple-select): Execute SQL query on database
Connect REPL to SQLite for further integration testing.

Change-Id: Ie48a68eedf227dcf67d0262dd4672d53bbc6ec86
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5345
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-03-01 22:08:01 +00:00
William Carroll
9eefa2e484 feat(wpcarro/simple-select): Compile AST to SQL
Currently supports the SQLite flavor of SQL. Preliminary testing seems to show
encouraging results.

Change-Id: Ib2ed6a695352f41185c8e8abdadfd76ce38bdbcc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5344
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-03-01 21:58:00 +00:00
William Carroll
eb412699b6 feat(wpcarro/simple-select): Parse query language 🎉
Seems to successfully handle inputs like...

```
> (-fname:"William" lname:/C.*l/) OR (fname:"William" -lname:"Carroll")
```

Change-Id: I5277cfbc7d102158eab5e1e71b2d95aaf13508fd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5340
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-03-01 02:07:51 +00:00
William Carroll
b5f78e433c feat(wpcarro/simple-select): Define Parser class
Copy-paste from monorepo.

Change-Id: Iff51fa9b939fe7dec3952077b5764bcc45d96f24
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5339
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-03-01 02:07:51 +00:00
William Carroll
88a3051ae5 feat(wpcarro/simple-select): support tokenizer for query language
Support a tokenizer for a query language that looks like:

```
-fname:/W.*m/ lname:"Von Carroll"
```

Parser otw...

Change-Id: I2badf14a41313ca2f75dec20adbcf9031b22ab83
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5338
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-03-01 02:07:50 +00:00
William Carroll
7770ccf0e3 feat(wpcarro/simple-select): Support basic Scanner class
...alongside a small REPL to quickly test the functionality.

Change-Id: I3c2b3f060d82cd49488e00dec9b72f7b23e2b666
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5337
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2022-02-28 18:55:03 +00:00
Vincent Ambo
aa122cbae7 style: format entire depot with nixpkgs-fmt
This CL can be used to compare the style of nixpkgs-fmt against other
formatters (nixpkgs, alejandra).

Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: wpcarro <wpcarro@gmail.com>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: cynthia <cynthia@tvl.fyi>
Reviewed-by: edef <edef@edef.eu>
Reviewed-by: eta <tvl@eta.st>
Reviewed-by: grfn <grfn@gws.fyi>
2022-01-31 16:11:53 +00:00
William Carroll
9098920f0a feat(wpcarro/scratch): create a proof-of-concept blockchain server
> You cannot get educated by this self-propagating system in which people study
> to pass exams, and teach others to pass exams, but nobody knows anything.  You
> learn something by doing it yourself, by asking questions, by thinking, and by
> experimenting.
> - Richard Feynman

In the spirit of learning by doing, I decided to implement a simple blockchain
server. More work remains, but I'm tired after working on this for ~2-3h. I'd
like to reimplement this from memory using a statically typed language like
Haskell. I'd also like to implement node
discovery (https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery) because
that is still something I don't quite understand. But I'm signing-off for
now...

Change-Id: I74f424e7f52ffbf81eaad420d7d5205da66d33b5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4802
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
2022-01-08 06:00:26 +00:00
William Carroll
fad38387af feat(wpcarro/cryptopals): Support repeating key cipher
I think this is a form of symmetric encryption where the passphrase (e.g. "ICE")
is repeated (e.g. "ICEICEICEICEI...") until it matches the length of the
cleartext string; after that, the two byte-strings are XOR'd against one another
and then encoded as hexadecimal creating the ciphertext.

Change-Id: Ib148f06d6c42a41377d1df1f0738d77da935a9f6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4789
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
2022-01-08 05:51:16 +00:00
William Carroll
7aaddb3d31 fix(wpcarro/cryptopals): Update cleartext scoring algorithm
Create a frequency table of alphabetic characters by reading each character in
"Alice in Wonderland"; use this frequency table to score cleartext when decoding
ciphers.

Change-Id: Id322af64d792c15231a1a02794f396c46196c207
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4788
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
2022-01-08 05:51:15 +00:00
William Carroll
4cf86f2e53 feat(wpcarro/scratch): Upload my solutions to cryptopals
More beginner problems/solutions for CTF-style challenges.

Change-Id: Ide229e99e3ccc1ede5a5ca1c2ad039498e49ea4c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4740
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2021-12-29 19:34:02 +00:00
William Carroll
5c0ec720af feat(wpcarro/scratch): Upload my solutions to picoCTF challenges
Just getting my feet wet...

Change-Id: Ia1db0c69fe7d5ea5cb5585853d0688ef97f2680a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4739
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2021-12-29 19:34:02 +00:00
William Carroll
b6d143e5d2 fix(wpcarro/nix): Remove <briefcase> references
Angle-bracketed references are a Nix anti-pattern, and thankfully this
repository enforces this as a standard.

TL;DR:
- Drop angle-bracketed references
- Change `briefcase` -> `users.wpcarro`
- Fix any resulting regressions
- Fix //users/wpcarro/tools/simple_vim
- Mark //users/wpcarro/boilerplate/typescript and related projects
  as broken
- drop .skip-subtree file, enabling depot CI

Change-Id: I7153cbabafa617bfd6b199370cbec65cb75441f6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4325
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: grfn <grfn@gws.fyi>
Autosubmit: wpcarro <wpcarro@gmail.com>
2021-12-15 15:49:40 +00:00
Vincent Ambo
019f8fd211 subtree(users/wpcarro): docking briefcase at '24f5a642'
git-subtree-dir: users/wpcarro
git-subtree-mainline: 464bbcb15c
git-subtree-split: 24f5a642af
Change-Id: I6105b3762b79126b3488359c95978cadb3efa789
2021-12-14 02:15:47 +03:00