by norman784 · 4y ago · 0 comments
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.
"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 :)
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.