Commit graph

53 commits

Author SHA1 Message Date
0a5920adaf
irc: split parser into lexer and parser components
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4e73459a02caff5335d690656fd6f1396a6a6964
2026-04-24 23:13:19 +03:00
feb247f64a
irc: extract inline constructors; deduplicate value-copy logic
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ifc74f0bfe621a05fa7b91a5f6be1ea976a6a6964
2026-04-24 23:13:18 +03:00
28de44c598
irc: PrimOp memory leak and IR_VERSION mismatch
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iad057cd5f51ef26e7de93ccca7b3d3156a6a6964
2026-04-24 23:13:17 +03:00
f6481b3c01
irc/parser: use explicit IR nodes for patterns and interpolation
Replaces lambda pattern desugaring with direct `LambdaPatternNode`
generation, which:

- Separates required and optional fields in pattern structure
- Preserves @-binding and ellipsis information in IR
- Remove like 50 lines of Let-binding desugaring logic

and replace string interpolation concatenation tree with
`StringInterpolationNode` to:

- Use `StringPart::make_literal/make_expr` for cleaner representation
- Optimize single-literal strings to `ConstStringNode`
- Remove `toString` builtin wrapper generation

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I7d3fa038f743d02b9caae0979b79f5086a6a6964
2026-04-24 23:13:16 +03:00
359a707663
irc/types: IR type extensions
Updates IR_VERSION to 3. In an effort to support more features of the
Nix language, implements 5 new node type constants:

- `LAMBDA_PATTERN` = `0x70` - Lambda with pattern matching
- `INHERIT` = `0x71` - Simple inherit expressions
- `INHERIT_FROM` = `0x72` - Inherit from source expression
- `STRING_INTERPOLATION` = `0x73` - String with interpolated parts
- `BUILTIN_CALL` = `0x74` - Builtin function call

and some struct definitions before the Node class, such as `PatternField`.

Those will come in handy for suppporting the entire Nixpkgs library.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1f0e81a120a0c956b8068d81c42796616a6a6964
2026-04-24 23:13:15 +03:00
56f15d749e
docs: initial specification; we yap
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I885e6317d186ccdc847195957dba4ab26a6a6964
2026-04-24 23:13:14 +03:00
14bbc09280
docs: document using just in the codebase
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I56d1de8a88bb28e49e6387a320f318c86a6a6964
2026-04-24 23:13:13 +03:00
13a38f707b
meta: switch to justfile for task organization
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib4000ab597f94b2dd3dccf1e31fce3a76a6a6964
2026-04-24 23:13:12 +03:00
2c9ad890b2
tests: move fixtures to dedicated dir
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9d6ce6a264780f215b1b57d947b5264c6a6a6964
2026-04-24 23:13:11 +03:00
2a005574d3
tests/benchmark: make benchmark cases... bigger
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iabd307b475f6568cff4d1ae6e5ae56ef6a6a6964
2026-04-24 23:13:10 +03:00
1ceb889a16
irc: add timing measurements; formatting
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id4402547e18b6569464850c3753383396a6a6964
2026-04-24 23:13:09 +03:00
54892c3121
irc/evaluator: fix variable lookup, recursive let, and value handling
Bunch of things:

- Decode depth and offset from encoded variable indices
- Pre-allocate Values for recursive let bindings before eval
- Use mk* methods for value copying instead of direct assignment
- Evaluate attrset values immediately to avoid dangling thunks

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4dd40c93d74df5973a642fb9f123e70e6a6a6964
2026-04-24 23:13:08 +03:00
e8fcaccacc
irc: add ListNode support; fix recursive attrset scoping
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1657bc6a05c264f0ae0dd2c94d32b1046a6a6964
2026-04-24 23:13:07 +03:00
51305298ee
irc/parser: fix list parsing and function application
Fixes bug where `concat [1 2 3] [4 5 6]` tried to apply integer 1
as a function.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6f373dd83bcac9e59286b0448472200b6a6a6964
2026-04-24 23:13:06 +03:00
85a865af47
tests: initial integration tests
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I09ed2eea568edfaecdb800197bc36c416a6a6964
2026-04-24 23:13:05 +03:00
b3dcba607b
tests/benchmark: fine-grain timing reports
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia481b0129193540636665340bd257d136a6a6964
2026-04-24 23:13:04 +03:00
4ea090cf33
tests/benchmark: rename runner script; compare compilation with native eval
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6ef30732f875ab134a35282eb2cd66a36a6a6964
2026-04-24 23:13:03 +03:00
d272dc589e
tests: initial benchmarking setup
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If0ed2dd4279abf155a8ddc678ca047736a6a6964
2026-04-24 23:13:02 +03:00
8a093aa9e8
irc: improve multi-line strings; complete list concat and dynamic attrs
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I64e53c68d90b62f3ca306865ceda32af6a6a6964
2026-04-24 23:13:01 +03:00
e6231f546d
tests: update test cases for newer syntax items; drop old artifacts
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8640148e8e7597924f9c776750c856266a6a6964
2026-04-24 23:13:00 +03:00
dd79db1f86
irc: more syntax support
Indented strings, ancient let bindings and a bit more

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib86c2d8ca4402dfa0c5c536a9959f4006a6a6964
2026-04-24 23:12:59 +03:00
5e41a7cb37
tests: add tests for lookup paths and imports
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I7e54691aa3e81efcb495124d13e8c24a6a6a6964
2026-04-24 23:12:58 +03:00
775bb42c63
irc: support lookup paths and import keyword
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0d16726646aef82ce675c4f8d209029a6a6a6964
2026-04-24 23:12:57 +03:00
dc7b3305db
tests: add test fixture for merge operator
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ie8d8e5fb817349469fed194773120ce86a6a6964
2026-04-24 23:12:56 +03:00
3387e0d822
irc: support merge operator
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icfb0cc81542e637d4b91c6a5788370fb6a6a6964
2026-04-24 23:12:55 +03:00
95baf44a9c
irc: add Float and URI literal support
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I40c59d94f650e7b9e68f77598492d7ab6a6a6964
2026-04-24 23:12:54 +03:00
3dd2d604ce
nix: format test fixtures via nix fmt
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia9c1e9b0a8cd9c6d834f153609baa5426a6a6964
2026-04-24 23:12:53 +03:00
30a3304171 chore: run clang-tidy with --fix
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I84fc0804ceeb652b26ee385b26132e816a6a6964
2026-02-24 19:40:05 +03:00
af17da34da chore: run through 'clang-tidy' with '-fix' 2026-02-24 19:40:05 +03:00
79f99f189f nix: inline env set; add clang-tools to devshell & name shell
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5cf7ad8f9fc8c568e53e6cf8dda12b746a6a6964
2026-02-24 19:40:05 +03:00
ea20aaab00 various: format with clang-format
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib9abc9d2dcd036d3680c5aa3dc919bfa6a6a6964
2026-02-24 19:40:05 +03:00
63a9eddc49
irc/evaluator: fix e passed by value in Thunk constructor
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If3bdfd1fc0851d4113b89827474a74a86a6a6964
2026-02-22 00:18:20 +03:00
eb84d4617b
chore: set up clang-tidy
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Idd88aa64efcc59a70dffa548603e51156a6a6964
2026-02-22 00:18:19 +03:00
5b80e3aa63
chore: set up clang-format
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia4928173791618598031d584f7b6cf166a6a6964
2026-02-22 00:07:52 +03:00
4aa514d83d
meta: ignore more generated files and nix artifacts
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id142ee9a1bdf076542f684130ba925216a6a6964
2026-02-22 00:07:51 +03:00
e36693ac3f
docs: document project architechture
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iaa99d706d61857fbd51d3b757b5066ab6a6a6964
2026-02-22 00:07:50 +03:00
2539ff7ca3
chore: add CMake test target; ignore build directories
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0db5e008e65f5a5109d8eaa6119b3c246a6a6964
2026-02-22 00:07:49 +03:00
ddfbc91b58
tests: add regression test suite; update test fixtures
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5ccf7cb25394bdcae068b49f66787c3a6a6a6964
2026-02-22 00:07:48 +03:00
f4135a5dca
types/serializer: add HasAttrNode binary encoding for ? operator
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibfb89151eb80ab1ae1d8878b6849d2c96a6a6964
2026-02-22 00:07:47 +03:00
3441853eef
various: fix string comparison, interpolation and ADD op. for strings
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ice1bfb5682ab48a967dc16f1378e23ae6a6a6964
2026-02-22 00:07:47 +03:00
da9be4b014
docs: document binary format; add testing instructions
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I2cb3440f97b4add57860b212a60442336a6a6964
2026-02-22 00:07:46 +03:00
860460c402
chore: update gitignore for build artifacts
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I3fd18bc9e15b0a33557fcd95368b49776a6a6964
2026-02-22 00:07:45 +03:00
49f64c9c98
tests: initial test suite for IR compiler
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I70cd1dfa45add9df58a44add69fbd30a6a6a6964
2026-02-22 00:07:44 +03:00
22c92bfdd5
plugin: integrate evaluator for runtime comp
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1e43447957eb0c09b3ee7c2c21abe6496a6a6964
2026-02-22 00:07:43 +03:00
c32328f14d
evaulator: implement IR evaluation engine
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I980aaef64177b76620e3d1f9f39001046a6a6964
2026-02-22 00:07:42 +03:00
4b97433642
serializer: add HasAttrNode binary encoding
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ifdbd53aafc8291c78c273e2c9092fdf26a6a6964
2026-02-22 00:07:41 +03:00
a69385c5ca
ir-gen: add HasAttrNode conversion
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8e5bf04734112dc6e0885a42b4d546016a6a6964
2026-02-22 00:07:40 +03:00
59fedbe78d
types: add hasAttrNode for ? operator support
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I73691d86c8ce277bacc0dd7ed33939c96a6a6964
2026-02-22 00:07:39 +03:00
32f74c29fd
parser: add inherit keyword; initial string interpolation
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icdada04a72728e8881e2db4254bd88546a6a6964
2026-02-22 00:07:38 +03:00
7a74735213
nix: add libblake to buildInputs; split off nativeBuildInputs
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0541e803fd9635867501202c18567f786a6a6964
2026-02-22 00:07:37 +03:00