Live data from Hacker News

I like Odin

hasenjudy.wordpress.com

191–200 of 211 posts

Re: I like Odin

#191
post #157

Earlier quoted context omitted.

Odin and Zig solve almost all the memory safety aspects, except for use after free. Having bound checks, union types, etc. is good and a real improvement over C, but I think that use after free is a memory unsafety issue. It's the one that's harder to tackle because it's more dynamic ("temporal memory safety"?).

"Use after free" is a symptom of other problems. You can "solve" it by making it very different to do in the first place with something ownership semantics, but there are usually better ways of dealing with it in the first place. One really good approach is to not use pointers in the first place and use handles. I highly recommend this post for more information: https://floooh.github.io/2018/06/17/handles-vs-pointers…

That’s essentially what Rust does: it makes using handles to get temporary access to memory that are owned in a single place very attractive because otherwise the borrow checker will yell at you.

Re: I like Odin

#192
post #172

Earlier quoted context omitted.

Yeah this kind of framing always rubs me the wrong way. I don't "dread" manual memory management. Indeed, from a personal standpoint I really like thinking about stuff like that while I'm programming. It's part of the fun puzzle aspect that got me into all this. But as a professional , I know that there is heaps of evidence over many decades that it is unwise for me to indulge this fancy, when working on real systems…

If you had this belief say, 10 years ago, and because of it you decided to write your serious application in say, Java, you would have been in for a huge unexpected surprise last year when the now infamous log4j vulnerability was made public. See, having memory safety did not prevent the language from causing arbitrary code execution vulnerabilities. Having the log4j project be open source and popular did not prevent…

This is the usual speach against memory safe languages adoption, while ignoring the nice security equation,

    Σ exploits = Σ memory_corruption + Σ logic_errors
Having Σ memory_corruption ==> 0 is of course much welcomed outcome, even if Σ logic_errors > 0.

Re: I like Odin

#193
post #165

Earlier quoted context omitted.

I want to address some points for people that are reading and don't have enough C++ experience to judge that they are not as serious as they might seem. * You can just have your constructors not initialize your member variables. If they don't have default constructors that do work, then no work is done. * Yes, originally. Move-semantics are part of the language since C++11. Enough time has passed. * I read and write…

I absolutely agree, I've written a few hundred thousand loc of C++ at this point and I don't remember one time where I felt that having RAII was anything but great. It made me absolutely hate whenever I had to work in other languages Java and C# and had to remember to release non-memory resources manually.

[deleted]

Re: I like Odin

#194
post #178

Earlier quoted context omitted.

That’s basically any gced language and the fix is present for decades at this point: try-with-resources, ‘using’, ‘with’ (with-whatever IIRC can be traced back to Lisp…)

no, those are absolutely not fixes: you have to remember to use "using", "with", etc. whereas you have to go out of your way to circumvent RAII

Use static analysers, just like you have to do on C and C++ to handle many of their flaws.

Re: I like Odin

#195
post #2

> As someone who is interested in systems programming, and has experience working with Go I wonder how Go got it's reputation as a systems language. Imo, it occupies the same abstraction level as Java or C#.

The simple answer is that it was announced as one.

The more complicated answer is that, traditionally, systems programming languages were those which are not scripting or assembler languages. If you listen to Pike for more than a few seconds you'll soon notice that he's a bit of a language purist, so whatever modern interpretation you might have for a term is unlikely to match what he is communicating.

More specifically, it was announced as a systems programming language designed for things like web servers and systems of that nature, with more control than Java in some areas. Even with conflicting definitions of systems, there should have been no illusions about it being designed to be in roughly the same space as Java with that context. It was very much suggested from the onset that it was meant to compete with Java.

But, ultimately the game of telephone truncated the context that would have helped with finding the right definition of systems and, I expect exacerbate things, there was Rust coming onto the scene juicing the situation with its fans often claiming that "Go isn't a systems language, Rust is!" leaving some revisionism about people believing that Go was a systems language (in the modern sense).

Re: I like Odin

#196
Odin is probably the most productive I’ve been in a language. I went from reading the docs to having a working interactive PBD particle sim in VR via OpenXR in around 48 hours wall clock time.

I am currently writing a rigid body engine in it. It is perfect for graphics/games programming.

Re: I like Odin

#197
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

Here, a GC implemented in Oberon, a GC enabled systems programming language,

https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kerne...

For something more modern in D, also a GC enabled systems programming language,

https://github.com/dlang/dmd/tree/master/druntime/src/core

Re: I like Odin

#198

Odin is currently at the top of my Rust exit-ramp strategy (for personal work). As I grow older, I find myself wanting to use languages that are more conservative in their designs. Back in my 20s, I was all about expressivity and meta-programming: Scheme, Smalltalk, OCaml, and Haskell were my drugs of choice. I looked down upon those simple peons who used pedestrian languages like Java or PHP and I definitely looked…

>As I grow older, I find myself wanting to use languages that are more conservative in their designs.

What about Hare? It's meant to be a modern boring (read simple and stable) language.

Re: I like Odin

#199
post #197

Earlier quoted context omitted.

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

Here, a GC implemented in Oberon, a GC enabled systems programming language, https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kerne... For something more modern in D, also a GC enabled systems programming language, https://github.com/dlang/dmd/tree/master/druntime/src/core

D is GC by default (and currently required for larger parts of stdlib) but also allows disabling GC and doing manual memory management.

Re: I like Odin

#200
post #197

Earlier quoted context omitted.

Here, a GC implemented in Oberon, a GC enabled systems programming language, https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kerne... For something more modern in D, also a GC enabled systems programming language, https://github.com/dlang/dmd/tree/master/druntime/src/core

D is GC by default (and currently required for larger parts of stdlib) but also allows disabling GC and doing manual memory management.

Just like plenty of GC enabled systems programming languages, this isn't a XOR.
Post reply on HN