As being able to use a language to write an editor is a personal must-have in a language, your mention of kilo caught my eye. I did a quick read through of the Odin overview and FAQ and my initial impressions are positive. Bonus points to them for multiple return values and no automatic fallthrough on switch.
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?
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.
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.
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.
>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.
>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.
> 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.
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.
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.
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.
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.
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.
No, the "C community" and creators aren't making a political stance on things at all. Lua doesn't either. The Zig creator is very outspoken on political matters.
Not making a political stance is implicitly embracing the status quo. That’s usually fine because most hot political issues are far away from programming language design and implementation. Others feel differently, that political issues which affect community members (or people who could become community members) are important to speak out on. Regardless, every community takes political stances, some are just more upfront about it
Andrew Kelley is just one guy and he’s allowed to express his own political opinions online, just as you are. What evidence is there that the community as a whole is “annoyingly political”?
I like the generator with the exception of hyphens. Many sites don’t allow them or treat them as a special character. Unfortunately there is no longer any way that I’ve found to tweak rules. There was once a way buried under a few menus but it’s gone.
> Humans also love their tools. While tools get more advanced, they sometimes lose some charm or benefits of older tools.
This is true. In summer when I sit in the dark with the windows open (hot country and no AC and I don't want to attract bugs), my 4K computer monitor is totally incapable of dimming to a level that doesn't blind me. Even with white on black/dark mode and brightness set to 0. In fact, even during the day I work with brightness 0 on that thing, it seems all monitors are optimised for max brightness these days.
Meanwhile, my old VT520 terminal has an analog brightness dial which I can turn so low that I can barely make out the letters in a pitch-black room <3
"In fact, one thing you can count on in the United States is how few people are ever going to willingly read a book of poetry and find out what’s in there." uh yep.
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?