Sender | Message | Time |
---|---|---|
12 Sep 2025 | ||
As many before me, i implemented my own very basic nix evaluator, it doesnt have any builtins right now, only does basic arithmetic. But the point of it is that it doesnt use AST walking, but rather an approach similar to the STG. Its not fully tagless unfortunately, but i think im just missing something. Anyway, it only makes sense to develop it further if its faster than nix/lix so im wondering if its possible to formulate micro benchmarks relying on a subset of the nix language which could tell me whether my impl is faster or not. Anyone has thought about this before? | 15:07:03 | |
I dont want to write a full nix impl only to figure out "its horribly slow and nothing can be done about that". Ideally we'd be able to tell way before i implement all the nixisms | 15:08:27 | |
https://git.redalder.org/magic_rb/nix-stg oh and the code | 15:11:23 | |
The evaluator is currently recursive but thats my mistake, i just need to do while !iptr.is_whnf() iptr.force() | 15:12:22 | |
Some of the AoC solutions might be a good start for that. | 15:18:29 | |
Oh yeah good idea, im still very far off from being able to even import something but AoC is a very sound idea | 15:25:57 | |
In reply to @jaen:matrix.orgHow is your rust knowledge? | 15:53:37 | |
The repo could probably rebased again. | 15:53:48 | |
Hm, I've been following Rust since it was written in OCaml, so reasonably good theoretical foundations, and I've started writing some practical stuff last year finally (working on a ninja parser for nix-ninja that can handle AOSP scale). So I think I should manage as long as it's not terribly arcane — which I would assume an installer hopefully is not. | 17:36:07 | |
So basically what you'd like me to do is to take https://github.com/NixOS/experimental-nix-installer and rebase it on top of recent upstream (any particular commit, last before they dropped support for upstream nix maybe)? | 17:36:08 | |
13 Sep 2025 | ||
01:28:20 | ||
hi everyone | 20:45:30 | |
09:46:11 | ||
Honestly there's also only things that you can find out at scale. For one, memory usage and value representation is very important. It's not the interpreter or parser that's the bottleneck | 20:47:36 | |
Experimenting with efficient sharing of immutable values would be great. I have some thoughts on this that might manifest into something tangible soon | 20:48:42 | |
im currently still trying to wrap my head around the STG | 20:49:01 | |
Also the plus/minus implementation is a bit more complex than this: https://git.redalder.org/magic_rb/nix-stg/commit/04839e29e51a3b237359d0e95239e2b6960334ff. Like consider the following: | 20:53:18 | |
i mean; the nix language is a bunch of scope resolving and then a bunch of primop calls, there's not much inbetween | 20:54:14 | |
the nix language without e.g. derivation is ... kinda hard to use | 20:55:05 | |
i once experimented by taking the nix source code and taking out everything that isn't the expression interpreter; very little was left. just a handful of primops; i didn't even have import because it depended on the FS | 20:55:40 | |
comparing with e.g. https://nix-re.pl/ which translates everything to a primop call (a + b -> __add a b ; a.b.c or d -> __selectOr a [ "b" "c" ] d ) | 20:56:27 | |
all this to say i don't think there's much of a subset of Nix that would let you reasonably test performance; the only real-world performance test i can think of is "how well can you evaluate nixpkgs"; which requires .. well, everything | 21:00:59 | |
right, okay, point taken, ig ill have to implement enough to eval nixpkgs to actually get any data | 21:10:14 | |
... | 21:10:15 | |
well, im not even at a functional VM so uh, thats ways off, currently trying to wrap my head around the STG still | 21:10:36 | |
okay, i have no clue what im doing, anyone know the STG and can help me find the bug? or anyone up for a fun pairing? I'm pretty sure im folling the paper to the letter but its being weird, i suspect a miscompilation from Nix -> STG, cause the STG VM is behaving exactly as the paper says | 21:32:15 | |
Slowly working on installer rebase and need an opinion — I have some tests that are failing because it assumes existence of a default profile that has nix in it, cf:https://github.com/DeterminateSystems/nix-installer/blob/8a7bb095d93ada552d20d2f22ffd9f1668f8e394/src/profile/nixenv/tests.rs#L135-L136 https://github.com/DeterminateSystems/nix-installer/blob/8a7bb095d93ada552d20d2f22ffd9f1668f8e394/src/profile/nixenv/mod.rs#L98 It is not the case on my system, it links into per-user/root/profile which does not exist (the folder only has channels there. And I'm wondering if it's my NixOS setup that's wrong or is detsys assuming something that's not really true? | 21:59:15 | |
14 Sep 2025 | ||
08:32:48 | ||
16:22:28 | ||
16:37:42 |