Live data from Hacker News

I like Odin

hasenjudy.wordpress.com

121–130 of 211 posts

Re: I like Odin

#121

Earlier quoted context omitted.

And for you, you clearly don't need manual memory management nor high control over memory, memory layout, and memory access. And that's absolutely fine, but don't criticize something which other people REQUIRE and DESIRE. You cannot "solve memory management" because there isn't just "one problem". As for RAII, the article itself showcases some of the alternatives Odin has with the `defer` statement and `deferred_*` a…

Quite the outlashing. One can use both default RAII in a programming language as well as opt-in unsafe memory management. So you are clearly wrong in your assumptions about what the OP must clearly not require/want.

Still no. Many problems require manual memory management of which custom allocators aid a lot with. Odin has extensive support for custom allocators and many other things.

RAII may not even make sense within the type system of a language too. Languages with RAII (C++, D, Ada, Rust (through Drop), and Vala) all have higher level constructs such as methods, and many have automatic memory management too (Rust's is automatic but at compile time).

First let's take C++ as an example of a RAII language, RAII has numerous flaws to it:

* In practice (but not necessarily) couples allocation/initialization together meaning that allocations are rarely bulked together and are scope-governed (which can be very poor with performance). (And I know placement `new` exists, but that isn't implicit RAII any more and doesn't solve any of the other problems)

* C++ originally only had copy constructors which usually involved loads of implicit allocations everywhere. This lead to copy-elision optimizations and the introduction of move/ownership semantics as a way to minimize these issues.

* RAII is very implicit to the reader that it is even happening, meaning you cannot just read the code and know what is happening.

* Ctors and dtors usually have to assume to never fail, or require exceptions to handle the failure cases. And not everyone wants, or can even have, software exceptions.

In sum, adding RAII is not a minor thing and to make it even useful without too many flaws requires loads of extra things on top. It's not a simple construct.

I also never said anything about memory safety in my comment. You can have memory safety and manual memory management. The question is what level of safety and in what form. Odin has pretty much all the general memory safety features (bounds checking, Maybe types, distinct types, no pointer arithmetic, default to slices, virtual memory protections, and many more). What Odin does not offer is ownership semantics and lifetime semantics, which is an entire discussion itself which I won't talk about in this already long comment.

Re: I like Odin

#122
post #98

I think Odin just doesn't do enough. The improvements over C are there, but imho too small to justify/motivate a large-scale change. And personally I think (!) there is no reason to introduce a new programming language without RAII these days. If you don't solve memory management any more than C did (not), then you are ignoring the biggest problem that needs solving and every replacement that does address this proble…

How do you write your garbage collectors or RC without precise manual memory management?

How do you render billions of vertices and maintain a gameplay loop under 8ms for AAA games without precise manual memory/layout management?

Not everyone is writing websites in javascript

Re: I like Odin

#123

Earlier quoted context omitted.

And for you, you clearly don't need manual memory management nor high control over memory, memory layout, and memory access. And that's absolutely fine, but don't criticize something which other people REQUIRE and DESIRE. You cannot "solve memory management" because there isn't just "one problem". As for RAII, the article itself showcases some of the alternatives Odin has with the `defer` statement and `deferred_*` a…

But safe memory management is the biggest problem that needs solving. It’s empirically impossible for humans to write secure, complex programs while managing memory by hand. I agree with OP, that Odin doesn’t go far enough toward safety in this regard. We do all require and desire security.

What it is interesting is that the comment never mentions memory safety, only memory management; you just added memory safety into the discuss.

Memory safety and memory management are not equivalent concepts. As I state in another reply (https://news.ycombinator.com/item?id=32629951), you have memory safety and manual memory management. And Odin offers numerous memory safety features as well as being designed around the power of custom allocators.

Re: I like Odin

#124

Earlier quoted context omitted.

You can’t conclude that a language has taken direct inspiration from another just because they look similar.

https://odin-lang.org/docs/faq/#what-have-been-the-major-inf... Fortunately there's a FAQ, and from that there are two Rob Pike languages (Newsqueak and Go) as well as a pair of Wirth languages (Pascal, Oberon-2).

Does anyone know what influences were taken from Oberon-2 in Odin?

Re: I like Odin

#125
post #98

I think Odin just doesn't do enough. The improvements over C are there, but imho too small to justify/motivate a large-scale change. And personally I think (!) there is no reason to introduce a new programming language without RAII these days. If you don't solve memory management any more than C did (not), then you are ignoring the biggest problem that needs solving and every replacement that does address this proble…

I don't think any feature should be a mandatory part of a programming language, provided its reasons for not including it make sense. I'm fuzzy on Odin, if you showed me some Odin and some Hare I bet I couldn't tell them apart, but it kinda looks like a nice C with syntax inspiration from Go and (hence) Pascal.

A language like that, as long as the object code is correct, then hey, it's there for people who want it.

I think Zig, which I understand better but don't use, has a good reason for not building in RAII. Zig has a "no allocation without an allocator" rule, and what's easiest to describe as native valgrind. It also has comptime, and RAII loses some conceptual simplicity when you start doing transformations between what-you-see and what-you-get.

I think it's worth continuing to explore whether that's a sufficient approach to memory safety, rather than doing something which has already been done, prematurely. I happen to think it's a promising approach, favoring clarity and simplicity.

We'll see. Zig can always add RAII later, and so can Odin. But at most once each, so it pays not to be hasty.

Re: I like Odin

#126
post #107

FWIW, the Odin compiler seems to be written in C++. Are there any plans to make it self hosted?

The creator is explicitly against a self-hosted compiler, for better or worse.

I'm not against self-hosting.

To quote the FAQ (https://odin-lang.org/docs/faq/#is-the-odin-compiler-self-ho...):

> Odin is not currently self hosted nor will be until after version 1.0 when the main implementation of the Odin compiler adheres to a specification and is heavily tested. In general, self hosting before a stable language and compiler exists is masturbatory pleasure.

Re: I like Odin

#127

FWIW, the Odin compiler seems to be written in C++. Are there any plans to make it self hosted?

To quote the FAQ (https://odin-lang.org/docs/faq/#is-the-odin-compiler-self-ho...):

> Odin is not currently self hosted nor will be until after version 1.0 when the main implementation of the Odin compiler adheres to a specification and is heavily tested. In general, self hosting before a stable language and compiler exists is masturbatory pleasure.

Re: I like Odin

#128

Earlier quoted context omitted.

https://odin-lang.org/docs/faq/#what-have-been-the-major-inf... Fortunately there's a FAQ, and from that there are two Rob Pike languages (Newsqueak and Go) as well as a pair of Wirth languages (Pascal, Oberon-2).

That’s fair. That’s however not what the OP claimed, which is what I was responding to.

The creator of Odin has made it very clear he was inspired by and borrowed from both Go and Jai, which is perfectly acceptable. It's also very obvious, to any who have looked at the documentation or used the languages. The other poster already gave you a link, where Go is acknowledged. If you investigate further (Google), you will see that Jai inspired and was borrowed from too.

I suppose your argument is about Odin, being compared to Jai, but its very obvious they are in near categories. Pretty much whatever a person would have used Jai for, they can use Odin. Maybe you want to also watch the YouTube link of Jai versus Odin (https://youtu.be/M763xHjsPk4).

And, it might hurt some feelings, but I'm very understanding of people that rather use Odin than to wait around for Jai.

Re: I like Odin

#129
post #107

Earlier quoted context omitted.

The creator is explicitly against a self-hosted compiler, for better or worse.

I'm not against self-hosting. To quote the FAQ ( https://odin-lang.org/docs/faq/#is-the-odin-compiler-self-ho... ): > Odin is not currently self hosted nor will be until after version 1.0 when the main implementation of the Odin compiler adheres to a specification and is heavily tested. In general, self hosting before a stable language and compiler exists is masturbatory pleasure.

Just a heads up: Be careful posting two nearly identical comments so close together. They both ended up marked "[dead]". HN's filters catch things like that and may auto-kill them.

Re: I like Odin

#130

Earlier quoted context omitted.

I'm not against self-hosting. To quote the FAQ ( https://odin-lang.org/docs/faq/#is-the-odin-compiler-self-ho... ): > Odin is not currently self hosted nor will be until after version 1.0 when the main implementation of the Odin compiler adheres to a specification and is heavily tested. In general, self hosting before a stable language and compiler exists is masturbatory pleasure.

Just a heads up: Be careful posting two nearly identical comments so close together. They both ended up marked "[dead]". HN's filters catch things like that and may auto-kill them.

Thank you for that. I rarely use HackerNews and I was just trying to clarify my own position.
Post reply on HN