3 ms·
Sandboxing is relevant, but nix does that by default, so no difference here. Nonetheless, I agree that Nix does the optimum here, full-on emulation would be pr
by gf000 2y ago
Sandboxing is relevant, but nix does that by default, so no difference here.
Nonetheless, I agree that Nix does the optimum here, full-on emulation would be prohibitively expensive.
- jchw 2y agoYou know, though, it would probably be possible to develop a pretty fast "deterministic" execution environment if you just limit execution to a single thread, still not resorting to full emulation. You'd still have to deal with differences between CPUs, but it would probably not be nearly as big of an issue. And it would slow down builds, but on the other hand, you can do a lot of them in parallel. This could be pretty interesting if you combined it with trying to integrate build system output directly into the Nix DAG, because then you could get back some of the intra-build parallelism, too. Wouldn't be applicable for Nixpkgs since it would require ugly IFD hacks, but might be interesting for a development setup. Perhaps it's an area worth researching.
- gf000 2y agoI don't know, concurrency is still on the table, especially that the OS also has timing events. Say, a compiler uses multiple threads and even if you assign some fixed amount of fuel to each thread, and mandate that after n instructions, thread-2 must follow for another n, how would that work with, say, a kernel interrupt? Would that be emulated completely only at given fixed times? But I do like the idea of running multiple builds in parallel to not take as big of a hit from single-threaded builds, though it would only increase throughput not latency.