Hacker News new | ask | show | jobs
by dartos 553 days ago
Odin and Zig both have dictators.

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.

5 comments

Zig's compiler error on unused variables is a deal breaker for me unfortunately. The language author also has an insulting attitude towards anyone who wants otherwise, categorizing them as bad programmers he doesn't want to work with and doesn't want using Zig.

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.

> Zig: Trust the programmer to manually manage memory, but not to clean up unused variables.

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.

The worst part is if you have an unused variable the compiler won't even show you the real errors until you fix all the warnings first.

> 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.

Odin allows you to opt into the vetting tools through build flags (`-vet` and `-vet-*`) or even per-file build tags `#+vet unused`.

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.

Some people love this, some think it’s a necessary sacrifice - a rite of passage to endure in order to produce ”optimal” software.

Others try Odin or C3 instead.

Go refuses variables that are declared and not used as well.

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.

Meanwhile in Haskell they introduced typed holes in order to allow you to compile more types of programs that aren't yet fully finished.

I'm all for preventing this kind of thing from making it into the main branch, but a compiler error by its nature blocks compilation, which forces weird shenanigans like commenting out lines of code or adding arbitrary meaningless uses. Why is that better than a compiler warning (made mandatory in CI)?

Yeah, in C, you at least add the unused attribute and can grep for it. In some languages that do not support "_" prefix or the attribute meaning unused, you have to comment out parts. It is really annoying and I think it is worse.

In some C code where I have to suppress an unused variable warning (for example to a pthread callback), I just do (void)arg at the top of the function.

The solution is easy, have separate debug and release modes and only mandate variables to be used in the latter (though still provide a flag to disable the check, for the occasional debugging an issue that only happens with the release config).

Alsl, automatic `_ = var` is the worst of all, now instead of the compiler showing me one-by-one the few variables I'm not using temporarily so I can fix those, I instead have made n modifications all across the codebase (remember, this is all recursive) that are syntactically correct and won't be shown by the compiler.

Zig already has a seperate debug mode, if you feel the issue is important, file an issue on the zig GitHub page
Given that this is quite a controversial topic, I don't think they would allow such issues, besides the currently existing ones.
I prefer adding "_" in front of unused variables, like I do in OCaml.
It's stupid and annoying in Go too!
"Let me comment this line out"

"Oh and I have to do this one too"

"Oh and this five as well"

"Almost there"

"Nope"

>Odin’s creator has some strong opinions around not prioritizing LSPs and QoL tools around Odin.

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 a thread from a few years ago where people were saying that zig had better LSO support than Odin and saying that Odin should prioritize that more.

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.

> The Odin lsp I found (ols) is not official and not made by gingerBill

FWIW it's the same for Zig. ZLS is not official and not made by andrewrk.

>Please don’t put words in my mouth. I’m trying to be very clear.

my bad then

>The Odin lsp I found (ols) is not official and not made by gingerBill. Which, again, is fine

Ginger Bill is just the creator of the language. He is already hands full with the front end and back end of the language alone. You pointing out "its fine" makes it seem like you expect him to work on LSP, web site, marketing and everything else all by himself, which he can't and I personally think he won't. LSP is a big mess and it is alright to not prioritize LSP and focus on working on the core language itself, especially if marketing is not a serious concern.

Again, please don’t put words in my mouth. That’s what both your comments are doing.

For example: > You pointing out "its fine" makes it seem like you expect him to work on LSP, web site, marketing and everything else all by himself

How you extrapolated all that from me saying “it’s fine” is beyond me.

I’m not here to argue, just to state my opinion that both language creators are pretty nice people with some particular opinions.

I literally said that it’s fine that ols is community made. I even said it’s good that the community is willing to put in that work.

I also passed no judgement on his choice to not prioritize an LSP.

Take your outrage elsewhere, please.

honestly, that sounds like a 'normal' opinion, not a strong one.
I don’t mean strong as in weird and out there.

I mean strong as in I don’t believe his opinion will be easily swayed.

> no, he does not. He just doesn't use LSP but never did he ever oppose QoL tools.

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.

>He's somewhat against package managers

yes and that is a design decision.

Its not just the dependencies bloatware, there is also an issue of accidentally pulling in a GLP license code base and several others. But if one wishes to make a package manager for Odin, they can do so and other Odin users may use it if they found it to be really helpful but from what I know, Ginger Bill will never officially support it as it doesn't align with his vision of the language.

There is nothing in the design of Odin that prevents a package manager from being created, in fact quite the opposite.

The decision, which is not design per se, is to not have an OFFICIAL package manager, nor even endorse a third party one.

I am the creator of the Odin programming language. That's not even my opinion...

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.

Not prioritizing tools is a mistake imho. I'd argue it helps a lot with adoption and you end up with useful tools.
Odin actually has a pretty great LSP already.
If your goal is viral adoption, I agree, but it sounds like Odin is kind of geared towards the graphics programming world and doesn’t require vitality at this stage.
Odin has a great LSP.

Gingerbill is mainly against package managers because ecosystems like NPM and Crates.io are a mess...

It's not just that they are a mess accidentally, but they will necessarily become that. I won't discuss the full position here but in short: not everything needs to be automated, especially the automation of dependency hell. And making such things easier to do, is not a good thing and WILL lead to what mess we have no due to human nature.

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.

They are a beautiful mess. crates is actually fantastic. Being anti package management is very unproductive. It's gross but it's super productive
Odin does have a pretty nice "package management" story. You can literally just throw a folder with Odin files into your project structure and it "just works". The compiler sees it and includes it automatically.

I don't hate cargo either, I've also used Ruby for years, gem is nice, but in both ecosystems there's also a ton of abandoned packages, some that haven't been touched in years...

> You can literally just throw a folder with Odin files into your project structure and it "just works". The compiler sees it and includes it automatically.

This is true of most modern languages. That's not the problem package management is solving. Package management is solving the problem of how you decide which versions of which files to put into your project, considering the fact that dependencies may form a complex graph, not a simple tree.

A language can decide that it simply won't support complicated dependency graphs, which is a valid decision but is the opposite of having a nice package management story.

Well, being able to simply chuck files into your project and not deal with actually importing, linking, etc... means that you can then just use something like git to manage files.

Anyhow, I've used Odin, it's easy, never found the lack of package manager to be annoying. I've also used Rust, cargo is nice. I think I maybe lean a tad to the way Odin works, if for no other reason than crates.io is a graveyard of dead projects and you constantly have to see what's active and what's not, I find myself going to each project's GitHub anyway. With Odin I just import librairies straight from GitHub.

And both are easier than C/C++'s lack of, well, anything.

When importing a library from Github, you also have to see if it's abandoned or not. Crates actually shows you the last updated date right there.