News for hackers. Stuff that matters.
Re:D is being used for autonomous driving research – Audi an... by totalperspectiv on Monday June 24, 2019 @06:27PM (#20269182)
Your comment on dev time is something I intuitively agree with. And there are the future costs of dev time to add new features later / debug code etc. It's a poor measure at the end of they day.

As to C/D/C++/Rust/Nim, what I think is interesting to see, is which ones lead you to the performant path naturally, vs having to really dig into the bowels of the language or go against the grain of the language, so to speak. I have not written enough of any of them to say which do this. I would hazard that Rust does the best job, due to its explicitness / very nature.

Re:D is being used for autonomous driving research – Audi an... by WalterBright on Monday June 24, 2019 @10:55PM (#20270789)
> which ones lead you to the performant path naturally

D's big advantage is the plasticity of the code, meaning it's much easier to try out different data structures and algorithms to compare speed. My experience with C and C++ is they're hard to change data structures, meaning one tends to stick with the initial design.

For a smallish example, in C one uses s.f when s is a value of a struct, and s->f when s is a pointer to a struct. If you're switching from one to the other, you have to go through all your code swapping . and ->. With D, both are .

Re:D is being used for autonomous driving research – Audi an... by totalperspectiv on Monday June 24, 2019 @11:16PM (#20270879)
That's an excellent point. There was a neat paper a few years back where they were making the point that Java could actually lead to better performance in complex scenarios than c or c++ because the team could iterate on the algorithm faster and explore different paths.
Re:D is being used for autonomous driving research – Audi an... by riffraff on Tuesday June 25, 2019 @01:01AM (#20271321)
This is also the same claim that gets mentioned when k comes up: the shortness of programs leads to finding better solutions.
Re:D is being used for autonomous driving research – Audi an... by earenndil on Monday June 24, 2019 @07:19PM (#20269544)
> I would hazard that Rust does the best job, due to its explicitness / very nature

I might say the same about c, except even more so.

As for 'the performant path', something to watch for there is jai, probably coming out later this year. It has clever things there, like dynamically switching between SOA and AOS, or doing small dynamic allocations on the stack.

Re:D is being used for autonomous driving research – Audi an... by nicoburns on Monday June 24, 2019 @10:21PM (#20270626)
C does, until you start making things multithreaded, at which point you either start defensively copying things, or dev times slows massively due to having to maintain complex locking invariants in your head.
Re:D is being used for autonomous driving research – Audi an... by totalperspectiv on Monday June 24, 2019 @07:31PM (#20269613)
I haven't looked at Jai. I'll have to check it out. I have looked at Zig, which seems to inhabit a similar space. They both seem a little too early days for me at the moment (I at least want a chance at using it $work), but I like the general idea of better C.
Re:D is being used for autonomous driving research – Audi an... by vips7L on Monday June 24, 2019 @08:34PM (#20270056)
D has a betterC flag [0]. Though at that point I'm not sure why you wouldn't just write c++17.

[0] https://dlang.org/blog/2017/08/23/d-as-a-better-c/

Re:D is being used for autonomous driving research – Audi an... by WalterBright on Monday June 24, 2019 @10:56PM (#20270793)
D's betterC includes the metaprogramming facilities.
Re:D is being used for autonomous driving research – Audi an... by vips7L on Monday June 24, 2019 @11:12PM (#20270863)
And at the very least it has dub right? I've thought about it alot.
Re:D is being used for autonomous driving research – Audi an... by skocznymroczny on Tuesday June 25, 2019 @03:00AM (#20271761)
I'd love to use betterC more if it had dynamic arrays and assoc arrays. BetterC opens up opportunities such as WebAssembly too.
Re:D is being used for autonomous driving research – Audi an... by earenndil on Tuesday June 25, 2019 @02:27PM (#20277278)
Webassembly is slowly (but carefully) deciding on a garbage collection spec of its own; once that's available, you should see a whole new slew of languages targeting it, including full-fledged d.