24 ms·
Tvix – A New Implementation of Nix
- NewJazz 2y agoPS: TVL is international, but a lot of the development will take place in our office in Moscow. Say hi if you're around and interested! That's going to be a no from me.
- ingenieroariel 2y agoImagine if we had said the same about Nginx. Let's evaluate things on technical merits, specially if they are using open source licenses we understand. In this case GPL v3.
- 1attice 2y agoYes, imagine if we had said the same about Nginx. Now let's imagine now that we're saying those things in 2024, during the first major land war in Europe since WWII, in a context where state actors, if they are not already Jianing Tan, have enormous motivation to do so. Now, let's put the risk at the root of the build system, and leave the lead devs in a country known to coerce, threaten, torture, poison and kill its dissidents. That's a no from me, dawg. Look outside, it's not 2015 anymore.
- Filligree 2y agoI’m afraid these wars are going to kill open source. Unfortunately… if that’s going to happen, I’d rather have it happen without first having huge security breaches.
- NewJazz 2y agoI'm responding to their suggestion to travel to Moscow. FWIW I am very excited to see a rust impl of Nix focused on performance, and I am completely understanding that a person cannot pick their nationality (to some degree).
- Gerlo 2y agoWhy?
- NewJazz 2y agoI'm a US citizen and there is a significant risk that I will be detained and held hostage if I travel to Moscow.
- zare_st 2y agoI don't think is wise even if you had written guarantees from their state via the business, because how your state might look at it. It's a war, things have changed.
- rekoros 2y agoThat post is from 2021, pre-big war (but post-2014 one, which nobody noticed). In 2021, stopping by and saying hi wouldn've have been all that preposterous.
- alchemist1e9 2y agoMaybe worth mentioning rust and performance more prominently as the motivations. Is Nix eating the world? We have seen lots of unbelievable projects using it on HN recently. It feels like anyone serious about complex systems and building software are embracing it. I use it extensively also via nixpkgs, though somehow I have yet to make the leap to full NixOS. One consideration for anyone who hasn’t jumped in, is that I have nixpkgs on Linux, MacOS, and Win11 hosts. I’ve found that incredibly useful.
- vvern 2y agoCan you provide some links to some projects? You’ve piqued my interest
- NewJazz 2y agoTow-Boot comes to mind for me. https://github.com/Tow-Boot/Tow-Boot/ https://github.com/Tow-Boot/Tow-Boot/ Also plenty of projects here: https://github.com/nix-community/awesome-nix https://github.com/nix-community/awesome-nix
- alchemist1e9 2y agohttps://github.com/majbacka-labs/nixos.fi https://github.com/majbacka-labs/nixos.fi https://news.ycombinator.com/item?id=40010991 https://news.ycombinator.com/item?id=40010991 https://news.ycombinator.com/item?id=39720007 https://news.ycombinator.com/item?id=39720007 https://news.ycombinator.com/item?id=39692801 https://news.ycombinator.com/item?id=39692801 https://news.ycombinator.com/item?id=39658684 https://news.ycombinator.com/item?id=39658684 https://news.ycombinator.com/item?id=39004785 https://news.ycombinator.com/item?id=39004785 I didn’t find these via HN search, I found them in my bookmarking account. I have a slightly strange way of bookmarking - I send emails to a dedicated email account, so these I found there looking for Nix in a search.
- dlahoda 2y agodo you use special email client and host provider for that? does it work for 10k bmarks?
- Rucadi 2y agoOne useful webpage this project provides is this godbolt for nix: https://bolt.tvix.dev/ https://bolt.tvix.dev/ really useful.
- tazjin 2y agoWell, 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.
- flurie 2y agoIt's worth noting that tvix explicitly[1] does not support flakes. [1] https://lobste.rs/s/ypwgwp/tvix_we_are_rewriting_nix#c_zvtzeh https://lobste.rs/s/ypwgwp/tvix_we_are_rewriting_nix#c_zvtze...
- Rucadi 2y agoThis seems to be from 2 years ago, a lot of things could have changed. He seemed quite opinionated on flakes, but the only bad thing that I can see to flakes is that you cannot pass args to them, for imo no valid reason, you have to use the file+file protocol and update the inputs each time to have a reasonable way to pass parameters...
- RaitoBezarius 2y ago(Tvix developer here) 2 years after, Flakes are still what they are, IMHO, a pile of layering violations. I do not see a path forward for them in Tvix before we get to fix them layer by layer, which Nix is trying to do (slowly?). At some point, once we stabilize a bunch of things, I have some plans to do what I call the right design of Flakes, but it does not involve modifying completely the core of the interpreter to leak this implementation detail everywhere, but more make this a library concept.
- remexre 2y agoMost flakes make it a pain to cross-compile, too, especially to platforms other than the "big four" ({aarch64,x86_64}-{linux,macos}), as compared to overlays. (That said, the tooling around flakes is so much nicer that I still use and recommend them.)
- dlahoda 2y agooverride input works well. asking nix to accept arbitrary args in flakes like asking to so random patch of rust code during compilation. to patch use cargo patch. that is analogy of flakes, when you thing how flakes make nix statically typed.
- k8svet 2y agoI've had CL11242 open in my browser for a few weeks. The first thing I'm doing when it merges is evaluating my flake(s) with flakes-compat.
- smasher164 2y agoDoes tvix support targeting windows? And I do not mean WSL. iirc, the nix attempted a windows port but there were some hardcoded assumptions made about unix in the implementation that made it intractable, for example the location of the store. Do these issues also hold for tvix?
- Smaug123 2y ago(Nix itself is slowly chugging along with Windows via MinGW - https://discourse.nixos.org/t/nix-on-windows/1113/108 https://discourse.nixos.org/t/nix-on-windows/1113/108 and https://github.com/NixOS/nix/issues/1320 https://github.com/NixOS/nix/issues/1320 , for example.)
- coach__amit 2y ago[not related to this thread] working on a project that I'd love to run by you in the men's health space. came across a comment you made on a previous post, so figured I'd reach out. amitthakrarcoaching@gmail.com
- Smaug123 2y agoThe form of this message pattern-matches perfectly to spam, by the way, especially from an account whose only activity is to make essentially this same post three times; if you are in fact human, you might want to do something about that (such as being precise about which comment you mean, and why it's relevant).
- ingenieroariel 2y agoI recently learnt about this: https://nlnet.nl/project/libnix/ https://nlnet.nl/project/libnix/ A project funded by the EU to bring Nix to Windows. (edit: typo and clarity)
- RaitoBezarius 2y agoTvix developer here; we do have Windows in mind. Rust makes a bunch of things easier regarding this, but _not everything_. It's not a priority. The location of the store is not really the main blocker in those sorts of situations, IMHO.
- Izmaki 2y agoFor somebody who hasn't used Nix yet, but heard good things about it, why use Tvix instead of Nix? The page didn't seem to mention the reason(s) behind the project.
- tmountain 2y agoIt looks like they’ve factored out the main features of Nix into modules to allow for more flexibility regarding the implementation details of each underlying service.
- RaitoBezarius 2y agoNot ready, so not a good reason to use it yet.
- aidenn0 2y agoI 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 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 Nix equivalent of installing a package, or rebuilding your configuration. Note that most of the time it's "fast enough" but the authors of Tvix are doing more with the Nix language (which leads into) > No more strict separation of evaluation and build phases: Generating Nix data structures from build artefacts ("IFD") should be supported first-class and not incur significant performance cost. and > Well-defined interaction protocols for how the three different components (evaluator, builder, store) interact. As it currently works, the Nix language is evaluated to something called a derivation, which is a specific format for defining how to build something (including a list of dependencies). The derivation is then used to actually build the artifact. This is about when you want the metaphorical snake to eat its tail and have the results of a derivation be more nix language to evaluate. > A builder implementation using OCI instead of custom sandboxing code. Hermetic builds require some sandboxing; Using OCI containers seems like an obvious choice, but didn't exist when Nix was first created.
- orbital-decay 2y agoSo, how ready is this for general use? Is there anything still missing in the implementation?
- k8svet 2y agobuiltins.fetchTarball is not there, among others, and from watching Matrix I think there are still some things in nixpkgs that eval slightly differently in tvix. It feels like things are heating up, and "soon" is on the horizon.
- RaitoBezarius 2y agoTvix developer here; correctness is still not guaranteed, there's nothing to use here except if you already understand well Nix concepts to pick parts and build stuff on the top of it and accept the inherent instability :).
- codedokode 2y agoBy 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?
- ingenieroariel 2y agoCheck out devenv.sh from the Cachix people, it allows you to list stuff like pip for any language, including services / postgresql extensions: { pkgs, ... }: { services.postgres = { enable = true; package = pkgs.postgresql_15; initialDatabases = [{ name = "mydb"; }]; extensions = extensions: [ extensions.postgis extensions.timescaledb ]; settings.shared_preload_libraries = "timescaledb"; initialScript = "CREATE EXTENSION IF NOT EXISTS timescaledb;"; }; }
- ingenieroariel 2y agoOne way to wrap your head around it is apt/systemd in a pip-like config file.
- codedokode 2y agoInteresting, but the word "containers" is scaring me. I wanted just a simple tool to download and install several libraries and not a full Docker/Kubernetes level system... But it looks like a good choice for running tests in CI.
- singron 2y agoI think containers are completely optional and it can install and run everything directly.
- dlahoda 2y agonix eco has project(s) which instead building full images just plug tiny shim linked into nix store. nix-snapshotter. fast and small. oci images spec allows to do nice thing with nix.
- mise_en_place 2y agoThere's no need for more fragmentation in this ecosystem. Already package managers are heavily fragmented in the Linux world. This is making a bad problem worse.
- miduil 2y agoWhy do you think that? I've been following Tvix for some time closely and I've never felt they were introducing any sort of fragmentation.
- RaitoBezarius 2y agoTvix developer here; Tvix is quite different from Nix and is a clean restart, in my humble opinion, it would be quite hard to integrate some features of Tvix in the current Nix because you have two targets: (a) getting the feature in the existing architecture of Nix (b) evaluating a good architecture for the feature itself in the ideal architecture.
- Aerbil313 2y agoYou know what, you are right. Going beyond just the fragmentation, there’s too much (Linux) cruft on top of (Unix) cruft on top of (POSIX) cruft. Complexity leading to diminishing returns in every effort to modernize the system. Unironically, let’s throw away all the historical cruft and build a new OS, with a Nix-like package manager, TheseusOS-like architecture and only 6 processes visible when I run htop after a clean install, all with clear descriptions: Services Manager (systemd), Display Manager, Desktop Environment, Connections (WiFi/Bluetooth) Manager, Audio Manager, Power Manager. A desktop OS that is intelligible by its user.
- Samuel_w 2y ago[dead]
- rekoros 2y agoLooks 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 Lebowski nihilists might well have been ordering at a diner.
- jrockway 2y agoI pronounce it "tiv icks". Remember DIVX?
- rekoros 2y agoThat works!
- hamandcheese 2y agoI think the more likely etymology is because it's from The Virus Lounge. Tvix = The Virus Lounge Nix.
- tribby 2y agoI would pronounce it tee-vix, because of the stock ticker symbol TVIX[0] which was a leveraged volatility ETN and very popular in its day. a little too popular - credit suisse delisted it a couple months after the initial market crash brought on by the pandemic caused it to skyrocket naming is hard :) 0. https://www.thestreet.com/etffocus/market-intelligence/rip-tvix-saying-goodbye-to-a-volatility-legend https://www.thestreet.com/etffocus/market-intelligence/rip-t...
- jancsika 2y agoDo you put the hash at the end of the dirname in the store? IIRC, Nix names things like "$unreadable_hash$pkg_name" which makes tab completion impossible in the case someone wants/needs to go spelunking in that directory.
- RaitoBezarius 2y agoTvix is compatible with Nix, thus it follows the /nix/store/$hash-$name naming scheme.
- orbital-decay 2y agoFuzzy completion makes it trivial, although it doesn't help with the unreadable part. Spelunking in nix store dirs directly is usually unnecessary, though. You can debug/tinker with your derivations in nix shell (or, confusingly as always, nix-shell).
- yjftsjthsd-h 2y agoIt'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.
- eviks 2y agoWhy would you remember anything from a hash instead of the infinitely more usable name+ version (a more-than-enough-unique combo?
- tazjin 2y agoIf 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.
- 1attice 2y agoSaid 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/workalike of it. There is currently a war going on. Not a 'war on' drugs, or cancer, or a 'culture war', or any of the other phenomena that Americans routinely nowadays call a 'war', but an actually-actual conflagration involving grads, kinzhals, and, easily, the futures of a couple of well-intentioned engineers in Moscow. I expect the creators of this product are sincere, serious, smart, kind, generous, funny, honorable people. Yet it is simply too plausible that the FSB could come by and lean on them (or their uncle, or mother, or sister, or...) and have a little something extra put at the very root of the tree, from where it could be folded into any (or every) part of the system. Open source across international borders is a peacetime phenomenon, as we are all about to discover, methinks. I hope I'm wrong.
- orbital-decay 2y agoI really don't want to start irrelevant discussions in this thread, but if you think an extrajudicial secret service can't lean on any open source developer regardless of the country and your side relative to it, please think again. "This can't happen here" is not a helpful attitude, and also you are on the slippery slope here. Paranoia can disintegrate the community far quicker than any actual spooks. Without a certain amount of trust (backed by reputation and verification) nothing useful could be possibly done.
- glittershark 2y agothere are plenty of people with commit bits (me included) who don't reside in Russia, and would (I hope) be pretty alert to the Russian state coercing tazjin (the only committer currently residing in Russia) into introducing some form of backdoor.
- otabdeveloper4 2y agoCool, now do Israel.
- angiosperm 2y agoIs the language statically-typed? If not, why not?
- aidenn0 2y agoNix the language is untyped; I don't believe Tvix changes this, particularly since it has the goal of supporting all of Nixpkgs.
- Filligree 2y agoThat’s a pity. IMO the lack of static typing is one of the biggest flaws of the language, and it persistently slows me down.
- dlahoda 2y agopure flake nix with nixos modules is strongly statically typed. in this case typing is evaluation. so tvix promises doing typing faster.
- aidenn0 2y agoI guess it does depend on what you consider evaluation-time to be e.g. “Haskell is a dynamically-typed, interpreted language.”[1] 1: https://aphyr.com/posts/342-typing-the-technical-interview https://aphyr.com/posts/342-typing-the-technical-interview
- mixedCase 2y agoDoes not care about flakes and does not care about adding types, the most important omission in Nix. A minor performance bump seems unlikely to make me want to boil the ocean.
- dlahoda 2y agonix modules have types. in flakes they can be quasi statically verified
- korginator 2y agoTVIX was a media player made by Dvico. I used to have one a few years ago. You may want to check on trademark issues around the name. https://a.co/d/hOzOcvu https://a.co/d/hOzOcvu