News for hackers. Stuff that matters.
Re:D is being used for autonomous driving research – Audi an... by electrograv on Monday June 24, 2019 @11:59PM (#20271067)
If you’re looking for more “PL ADD” fuel, don’t forget to look into Zig! https://ziglang.org/

Of all the modern systems level programming languages I’ve seen, I like Zig the most. It combines a powerful, modern type system (generics, algebraic data types, statically checked null references) with an impressive simplicity (e.g. without the productivity-consuming and mentally burdensome “borrow checker” of Rust).

Re:D is being used for autonomous driving research – Audi an... by pcwalton on Tuesday June 25, 2019 @11:40AM (#20275325)
> without the productivity-consuming and mentally burdensome “borrow checker” of Rust

The borrow checker also gives you memory safety, which Zig does not have at the moment.

Solving use-after-free and related issues is a hard problem. I have yet to see a way to solve it that doesn't boil down to one of runtime garbage collection, not allowing heap allocation at all, not freeing memory at all, or a region system/borrow checking. It's fine to not like the borrow checker, but it's there for a reason.

Re:D is being used for autonomous driving research – Audi an... by pjmlp on Friday June 28, 2019 @02:25AM (#20301964)
Yeah, but currently it still is a roadblock when writing GUI code, to the point that Gtk-rs samples use macros to overcome the boilerplate to access widget data from callbacks.
Re:D is being used for autonomous driving research – Audi an... by littlestymaar on Tuesday June 25, 2019 @12:30PM (#20275887)
I'd not call the borrow-checker "productivity-consuming" : it is indeed a tough challenge for somebody learning the language, but in the medium/long run it becomes totally transparent when you've internalized its expectations. I've been working in Rust full time for one year now, and the only time I really had to think hard about "how to write this piece of code while complying to the borrowck rules", I was really happy to have it, because I would have written a nasty memory bug if nobody told me that I was doing something stupid.

It comes with a steep learning curve though, and I remember giving up three times in two years when I decided to give Rust a try. It eventually clicked on the fourth attempt(Idk if the docs had evolved between the third or fourth time or if it's the result of the slow progress I made through the three first try) but now, I really happy with the language.

Re:D is being used for autonomous driving research – Audi an... by bb1234 on Tuesday June 25, 2019 @10:10AM (#20274328)
Question: For someone who does not know either Rust or Zig, would you say that Zig also has tools that help the programmer protect from data race conditions (I have read that Rust is helpful in this regard)?
Re:D is being used for autonomous driving research – Audi an... by totalperspectiv on Tuesday June 25, 2019 @11:16AM (#20275076)
I have looked at Zig! It looks sweet, but a little to early days for me personally. For example, there's no documentation on how to open a read a line from a file. The best I can find is an example implementation of `cat` in the source repo. I will certainly be coming back to it at some point though.