4 ms·
I think nix could learn a few things from rust (maybe I’m out of date with nix, it was a while back when I tried it). Rust has few things that makes it outstan
by norman784 4y ago
I think nix could learn a few things from rust (maybe I’m out of date with nix, it was a while back when I tried it).
Rust has few things that makes it outstanding against other languages (in this context in particular):
- Tooling: I think nix needs an lsp (if isn’t any yet).
- Static typing: In this particular case might work better the typescript route, where you can gradually add typing (to not break old nix code).
- Docs.rs and documentation: In particular it is very powerful to have a centralized documentation that isn’t ambiguous and also this forces the packages to document themselves, so you could access that documentation directly from the source code and the tooling in your text editor.
This is just something that for me will make it easier to use, I think the days where you write text without help are over, it is much better IMHO work with rust because those points (there are few others, but besides those) for me is so important, and also ease the learning curve of nix language in general.
The other thing is the ecosystem, iirc you need some other packages or helpers to make nix work, there are also cases where you want to setup something and the official docs tell you that you need some package first, then you go a step back and try to figure out what’s that, and the same if you want to install another package, it requires you another package to setup first, I don’t remember exactly but in macos you needed some packager or darwin packager, I really don’t remember, and that was a huge set back, besides other issues with newer macos changes that did nix a PITA to install correctly.
- notemaker 4y agore LSP, there is https://github.com/nix-community/rnix-lsp https://github.com/nix-community/rnix-lsp
- baby 4y agoI need something that works with vscode
- capableweb 4y ago"But it does work with vscode, check the README" "I need something that does X" "But it already does X" "But what about Y?" On a more serious note, the linked project really does work with Visual Studio Code, do check the README of the linked project and you'll see :)
- baby 4y agoI spent like a month trying to make it work with VS Code, it does not (at least on Mac), and that's what most programmers use nowadays.
- capableweb 4y agoDid you check existing issues / open a new one describing your issue?
- norman784 4y agoNice, thanks for sharing, it seems that they are working towards solving some of my pain points with nix.
- lijogdfljk 4y agoAgree completely. My primary OS is NixOS, and i use it on my Mac laptop as well. I love Nix, but i absolutely hate Nix Lang's "typeless" user experience. Ie i can't look at some config, in my editor, and have any clue what it does. It's seemingly purposefully obtuse. I use it, but i hate it, but i'll never leave it. I really hope for advancements in either the LSP or a sane type system (Nickel? Perhaps) to replace NixLang. I think modern Nix (Flakes, modern CLI, etc) would be nearly flawless if i could get good inline information on each field, types, etc. When Nix Lang has as many language features as Rust, ie docstrings, types, etc - i think i'll love it. Until then it's an abusive relationship for me hah.