-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hi, I've been thinking about rix's idea of using javascript as the execution backend for nix, and I'm unsure whether it will actually benefit the performance.
Logically speaking, a JIT is only useful when there is a lot of repetitive execution that can be lowered to machine code, for faster repetition. Nix however is designed to be a schema description language with only a bit of internal code reuse.
Will the overhead of parsing nix, then converting it to js, then getting v8 to parse the js and execute it be smaller than just executing Nix directly? There is a LOT of lines of code in nixpkgs, so I feel like the generated javascript would be quite a lot for javascript to have much of a performance benefit.
I feel like it should be a priority to get rix to the point where it can execute nixpkgs, and potentially generate the output derivation specifications for a system configuration (purely on the nix language evaluation side). Then it would be possible to benchmark complex real-world configs against each other.
I know one of the biggest hurdles for that is file imports, though I have ideas on how to achieve that.
Anyway, I'm curious about your thoughts on this topic as well