Live data from Hacker News

Driving with D

dlang.org

141–150 of 186 posts

Re: Driving with D

#141

Earlier quoted context omitted.

D is easy to pick up, and has three really fast compilers. It feels like a very practical language. Rust in comparison feels much less practical - glacial compile times and byzantine rules about manging memory. It may be 'safer' but that's a moot point when I find it all so unintuitive that I'm not going to be able to make anything with it anyway. And I really question what these situations are where you can't have g…

> And I really question what these situations are where you can't have garbage collection in 2021. Game development, anything with a UI (GC pauses frustrate users), anything that needs high performance (scientific applications, data analysis), you name it. Ownership semantics have a side-benefit of automatic thread safety; something that is less important than memory safety (because many programs can work in one thre…

>Game development

C# Unity, Lua Love 2D,...

>anything with a UI (GC pauses frustrate users)

Millions of C#, Java, Python, Javascript UI apps

>anything that needs high performance (scientific applications, data analysis)

Numpy, Julia,...

Using non garbage collected languages for 99% of apps today is a waste of time, and i'm saying this as mostly an embedded developer.

Re: Driving with D

#142
post #101
post #36

Earlier quoted context omitted.

What are the legal hurdles you had to jump to get this hack approved for street use? As car modders know all too well, this can often be the hardest task.

Fortunately, and surprisingly, this project was smooth sailing on the legal front. I contacted a VicRoads certified engineer in regards to the project and got the all clear. Even my insurance was OK with it. I think it's because most of the legislation is aimed at engine modifications.

That's cool. Over here (Sweden) it's not easy (if at all possible) to get these kinds of things approved.

Re: Driving with D

#143
post #31

Earlier quoted context omitted.

This isn't a very good summary of how the language evolved. D has basically always had the ability to not use the GC, it's only recently that we've taken an interest in replacing C. The GC has been written in D for a very long time, that wouldn't be the case if the language didn't allow manual memory from day 1. BetterC is a nice-to-have rather than a language dialect. Having a GC is an absolute godsend for getting c…

on the point of the GC being a good thing to have, this is true, but not when your main objective is to replace C++, C++ key advantage being RAII deterministic manual memory management You cant replace C++ with GC language, even 10 years ago this should have been evident to a seasoned developers such as Walter Bright and Andrei Alexandrescu Sometimes great developers are bad product managers Anyway, with Rust and Go,…

You surely can, it depends on the domain.

"Lockheed Martin reviewed various options for the Aegis Open Architecture including the programming language and execution environment for the system. In their experiments, they found that HotSpot Java code ran comparable to C++ on an experimental 250 millisecond periodic workload. At the same time, they found that the Java language provided superior abstraction and encapsulation than C++, and they judged that retraining their existing staff of CMS-2 programmers to become effective in Java would have lower risks than attempting to train them in C++."

https://www.ptc.com/en/blogs/plm/ptc-perc-virtual-machine-te...

So there you have it, Java powering battleship weapons targeting systems, after replacing C++.

Re: Driving with D

#144
post #73

Earlier quoted context omitted.

Not different enough to be worth switching from Java/C++ with their much bigger and more established communities. This was especially true earlier in it's history when it required GC. Now it doesn't, but it has to compete with Rust which can also offer memory safety.

But Go came and succeeded. Would you attritube this to Google's marketing, products like Docker/Kubernetes, or the simplicity of the language? Maybe something else?

Google's marketing, products like Docker/Kubernetes, and worshiping of UNIX key figures.

Re: Driving with D

#145
post #127

Earlier quoted context omitted.

Hi, Firstly, Congratulations. This is no trivial accomplishment. Here are the questions I have. 1. Normally, cars come with their own ECUs for the engine. Interfacing with them requires knowledge about the underlying firmware used afaik. Did you happen to reverse engineer the firmware so that you could interface your own electronics with the provided ECU ? 2. How did you make the car believe that your 6 speed automat…

Sorry for my late reply. I'm currently at work- I'll make sure to reply when I knock off. Have a great day :)

No problem at all. Take your time :)

Re: Driving with D

#146
post #18

Earlier quoted context omitted.

I use D every day at work (inherited codebase) and the UFCS bothers me to no end. I try not to use it.

There are "bad" uses of UFCS, and good ones (sometimes depending on preference). For example, I hate code like `1.writeln`. The major feature that it provides is pipelining (as shown in the article)

> I hate code like `1.writeln`

Meh... after not more than my first month into D this syntax grew on me and now I just use `1.writeln` everywhere. More than a few years later, I can't think of a single issue this has ever caused me.

Re: Driving with D

#147
post #65

Earlier quoted context omitted.

> such as the fact that a safe subset exists, but depends on GC, @safe works perfectly fine and exactly the same in @nogc code as in GC-enabled code.

My mistake - SafeD was introduced since I stopped using D, so I was going off this article: https://dlang.org/articles/safed.html#safed-subset > When you enter SafeD, you leave your pointers, unchecked casts and unions at the door. Memory management is provided to you courtesy of Garbage Collection. Does D provide the necessary tooling to be able to expose a safe API for something which needs to allocate memory, with…

https://github.com/atilaneves/automem

Re: Driving with D

#148
post #2

Any reasons D never caught on more? No big tech company anchor behind it?

Plenty of great answers above already. What I also think is a valid argument is that in order to appreciate the language, one has to be a seasoned developer hence many heated discussions on HN or Reddit. It reminds me of Lua, where at least one person would mention something about 1-index arrays and nil element behaviour.

Re: Driving with D

#149
I like D and could pick it up easily. It feels a lot like C without memory management overhead, Ada-inspired safety and lots of productivity feats. However, where D really shines is the amount of time between learning the language and starting doing something useful in it.
Post reply on HN