Live data from Hacker News

Tvix – A New Implementation of Nix

tvix.dev

81–90 of 107 posts

Re: Tvix – A New Implementation of Nix

#81
post #41

Said it downthread, but saying it again because it bears repeating: This is a product whose major contributors live in a state prone to very persuasive forms of coercion . Worse, this is a _build system_. Moreover, it's one of the most reticulate build systems on the planet -- I doubt more than a few hundred senior engineers would be able to spot a Jia-Tan-style compromise in the Nix machinery, let alone a remix/work…

Cool, now do Israel.

Re: Tvix – A New Implementation of Nix

#82
post #47

Earlier quoted context omitted.

I would recommend against using Tvix at this time, but if you are wondering why they wrote it, they wrote an article: https://tvl.fyi/blog/rewriting-nix The goals they list are: > Creating an alternative implementation of Nix that is fully compatible with nixpkgs. No explanation needed. > More efficient Nix language evaluation, leading to greatly increased performance. The Nix language is evaluated whenever doing the…

> A builder implementation using OCI instead of custom sandboxing code. A complete non-starter, never in a thousand years am I gonna use something that requires a Docker installation for building derivations.

Podman is also an option.

Re: Tvix – A New Implementation of Nix

#83
post #82

Earlier quoted context omitted.

> A builder implementation using OCI instead of custom sandboxing code. A complete non-starter, never in a thousand years am I gonna use something that requires a Docker installation for building derivations.

Podman is also an option.

No, I don't want "dollar store Docker" either.

Re: Tvix – A New Implementation of Nix

#84

By the way, is there some way to specify dependencies in C? Like requirements.txt in Python, where you put libraries names and versions and the user has to run a single command to install them (and without requiring root privileges)? Is this nix/tvix/guix an equivalent of pip?

> is there some way to specify dependencies in C? Like requirements.txt in Python, where you put libraries names and versions and the user has to run a single command to install them (and without requiring root privileges)?

I'd describe this as "(language-specific) package management".

"Requiring root privileges" is more/less equivalent to "packages get installed in a system-wide location".

There are some C or C++ specific package managers.. but, essentially what's missing is the ecosystem/culture for providing a packages for those. -- e.g. With the Rust, packages use Cargo.

> Is this nix/tvix/guix an equivalent of pip?

Nix and guix are system package managers.

Since they're powerful tools, one popular use case is for providing dependencies for C projects.

Nix practically requires root for its installation. (i.e. installing it without root may be possible, but I'd think it's impractical). Although once installed, it can provide packages without needing root.

Re: Tvix – A New Implementation of Nix

#85
post #47

Earlier quoted context omitted.

I would recommend against using Tvix at this time, but if you are wondering why they wrote it, they wrote an article: https://tvl.fyi/blog/rewriting-nix The goals they list are: > Creating an alternative implementation of Nix that is fully compatible with nixpkgs. No explanation needed. > More efficient Nix language evaluation, leading to greatly increased performance. The Nix language is evaluated whenever doing the…

> A builder implementation using OCI instead of custom sandboxing code. A complete non-starter, never in a thousand years am I gonna use something that requires a Docker installation for building derivations.

Maybe once you learn what OCI is, you'll rethink that ;)

Re: Tvix – A New Implementation of Nix

#86
post #4

One useful webpage this project provides is this godbolt for nix: https://bolt.tvix.dev/ really useful.

Well, we have the ambition to make it a sort of Godbolt for Nix, but none of us are frontenders and it's not quite as visually impressive and easy to follow as the actual Godbolt. It does work, though!

We've also been thinking about ways to make nixpkgs available there. Adding `lib` at least in some fashion would be quite useful, I think.

Re: Tvix – A New Implementation of Nix

#87
post #35

Looks like the dev team mosly speaks Russian? (Russian is native for me, but I've lived most of my life stateside.) In Russian, "tvix" is pronounced, roughly, "tweaks" (but with a German - hard "v" - W sound), which to a Russian probably sounds super clever, given what Tvix is (Nix, tweaked). In English though, how is it pronounced? I'd like to propose "t-f-icks", because it at least sounds like a candy we think the…

Привет) Almost everyone on the team speaks a language where this pronunciation is obvious (most prominently Russian and German, but it also works in e.g. Swedish).

I've noticed when talking to English native speakers that Brits seem to get it right away and say something close to "твикс", whereas Americans almost always say "tee-vix" ("тивикс") and need serious convincing work to switch over to how we say it.

Re: Tvix – A New Implementation of Nix

#88
post #35

Looks like the dev team mosly speaks Russian? (Russian is native for me, but I've lived most of my life stateside.) In Russian, "tvix" is pronounced, roughly, "tweaks" (but with a German - hard "v" - W sound), which to a Russian probably sounds super clever, given what Tvix is (Nix, tweaked). In English though, how is it pronounced? I'd like to propose "t-f-icks", because it at least sounds like a candy we think the…

I think the more likely etymology is because it's from The Virus Lounge. Tvix = The Virus Lounge Nix.

That is the actual etymology, but we're happy to retcon it to something more clever))

Re: Tvix – A New Implementation of Nix

#89
post #80

Earlier quoted context omitted.

It's my understanding that the ${hash}-${name} order is actually intended to help with tab completion, but from a different direction; if you already know the first couple chars of the hash, you can quickly tab-complete it, instead of using the less-unique name. I mean, I don't think that's the order I would have picked either, but there is logic behind it.

Why would you remember anything from a hash instead of the infinitely more usable name+ version (a more-than-enough-unique combo?

If you have an actively used Nix system with a large disk, it's very likely that you have a large number of (unused) deriations with the same prefix in there. A derivation is also a lower-level thing than a package, so it's not guaranteed that you have a useful name & version in there.

I just checked on my laptop and I have, for example, over 400 stdenv-linux build outputs in there.

Re: Tvix – A New Implementation of Nix

#90
post #78

Earlier quoted context omitted.

Tvix explicitly targets stable Nix features, so supporting Flakes is a non-goal. Many users have a poor understanding of what Flakes _actually_ are: They are a bit of UX glue on top of existing Nix features: - Input/output schemas for `flake.nix` - A lock file format - CLI features to work with the two above It's entirely feasible to build out a Flake user interface & evaluation support on top of Tvix without making…

> Tvix explicitly targets stable Nix features, so supporting Flakes is a non-goal. Except that it rolls its own CA store[1], which is also not a stable Nix feature. One could argue that it has to roll its own store because Nix wants to own the store, but implementing a shadow version of an experimental feature makes the "they're just targeting stable features" part ring rather hollow. > The key point of Tvix _not_ ha…

Flakes are a misfeature that adds a complicated layer of abstraction over an already not very simple system.

I follow some chats with lots of Nix beginners, and the amount of people that are now stuck in a flakes tarpit and have no understanding of the fundamentals of Nix (and no path to get there, really, in the course of normal usage) is depressing. Just the other day I saw someone post a 40 line Nix code snippet using flakes, pulling in 2 git repos apart from nixpkgs (because the barebones flakes are barely even usable without support libraries), all to make a simple nix-shell with a single package in there - and it didn't even work and they were unsure how to proceed with debugging.

In almost all chats with flakes proponents it also eventually turned out that what they want is something like niv, but integrated into the Nix binary, not all of the additional stuff that is attached to flakes.

Anyways, adisbladis' point is that Tvix does not need to support flakes in any way. If you really want to add these complications to your Nix code, you can implement everything flakes do in pure Nix (using e.g. the flakes-compat thing linked above).

Post reply on HN