by christophilus · 1y ago · 0 comments
Have you tried zig? I'm casually looking for a C replacement and I took a quick look at zig but came away not liking the community vibe (some things were too dictatorial for my tastes).
If you did anything with zig, how would you say the languages compare?
Both are very nice people as long as you’re nice yourself, imo.
My opinions:
Odin’s creator has some strong opinions around not prioritizing LSPs and QoL tools around Odin.
Zig’s is a little more hard nosed about simplicity. Zig is a very small language for a reason.
I’m on my zig arc now, but Odin is next.
The compiler error on variables which are mutable when could be const is almost as annoying. Zig does not acknowledge that not all code is production code, that sometimes you want to prototype without having to backtrack and fix compiler errors to irrelevant things when the goal is prototyping and figuring out what you are building.
It also adds friction to learning the language because statements you write will immediately get flagged as wrong -- is it actually wrong due to your unfamiliarity with the language, or is it just the lsp immediately flagging and underlining all unused as red. Better take a moment to check.
Super annoying to me. I can't get past it, nor do I trust the author of Zig to not go even further in this direction. He has made it clear he will not compromise on this issue.
There are more planned similar errors on the way here. At least it looks like they are no loner planning to do compiler errors on unused pub functions if they are not accessible from outside the package.
Zig: Trust the programmer to manually manage memory, but not to clean up unused variables.
The language is weirdly pedantic, in ways orthogonal to Rust.
That's such a good tagline, actually one of the things that annoyed me with zig as well. The other one is the lack of attention to syntax aesthetics and ergonomics, it's a bit all over the place and I am also not fond of semicolons.
> Compile error: This variable of type `Foo` is unused
Ok then, I'll just remove that, and...
> Compile error: This function you're calling expects an argument of type `Foo`
Just kill me.
This is one thing that really annoys me about Go, I am a competent programmer and I don't want be treated like an incompetent one. If I want vetting tools, I'll enable then when it suits me.
Others try Odin or C3 instead.
And honestly, I like the fact that it forces the source code to not include bloat. Lines of code that are there, but don't do anything, and can be misleading.
And in Zig, the language server can be configured to automatically add and remove `_ = variable;` statements, so this is frictionless.
"Oh and I have to do this one too"
"Oh and this five as well"
"Almost there"
"Nope"
no, he does not. He just doesn't use LSP but never did he ever oppose QoL tools.
Odin has great support for LSP and they are working on other tools as well. Do note that Odin doesn't have a foundation like Rust or Zig so their pace of development will be at their own discretion. Please don't expect it to be similar to Zig or other well funded languages.
I recall gingerBill saying that he’d rather work on the language than adoption. Which is a fine position to have.
Never did I say he was morally against LSPs or anything, just that he has strong opinions on prioritizing its development vs the language itself.
Please don’t put words in my mouth. I’m trying to be very clear.
The Odin lsp I found (ols) is not official and not made by gingerBill. Which, again, is fine. It’s good that the community took up the burden of making an LSP.
He's somewhat against package managers (doesn't want Odin ecosystem turning into NPM or Crates.io where a single package draws in a thousand dependencies).
But yeah, Odin's LSP is used by most Odin users, including staff at JangaFX.
I do not personally use an LSP for my own personal reasons (I found I PERSONALLY was less productive with such tools). I am not against the concept of autocompletion tools like an LSP. If you are more productive using one, that is great!!! OLS exists but OLS is just not "official"—even if it is very good from what many people have told me. The only reason it is not official is that none of the core team worked on it, including myself.
As for QoL tools? Of course we want these but our philosophy is make sure the foundations are brilliant first before half-arsing the tool built on top of the foundations.
Gingerbill is mainly against package managers because ecosystems like NPM and Crates.io are a mess...
Odin could trivially have a package manager and even one of the best support for it at the language level too because of how I designed what a package is in the language itself. I choose to not officially support a package manager because I don't want to encourage the path to hell.