Live data from Hacker News

Driving with D

dlang.org

161–170 of 186 posts

Re: Driving with D

#161

Earlier quoted context omitted.

Honestly, I believe it is much more about marketing than one might expect.

Agree. I think this is one of the reasons Ada has seen (and continues to see) so little use.

Coming from the Pascal side of programming, the syntax doesn't help to gain adoption in hacker community that grew out of UNIX culture.

In a way I think it is a kind of revenge that most newer languages adopt Pascal style variable and type declarations.

Re: Driving with D

#162

Earlier quoted context omitted.

You listed a bunch of engines written in C and C++.

How does that matter? You said "game development", not "writing a game engine". You said "data analysis", not "writing linalg algorithms", in which case we'd all have to bow to Fortran anyway. Your argument also doesn't apply to GUI apps, anyway. C# and Java amount to a huge number of such apps, and they're self-hosted. GC languages are vastly more productive that manual-memory languages, and for the vast majority of…

If your suggestion is, "GC languages can be used to write anything so long as whatever parts can't be written in a GC language are written in a non GC language," then yes that's true. But it's also a tautology.

Re: Driving with D

#163
post #159

Earlier quoted context omitted.

You listed a bunch of engines written in C and C++.

Unreal then, https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScrip... Or you prefer anything written in DirectX or Metal? Chapter 5 from The Garbage Collection Handbook. https://gchandbook.org/contents.html

Unreal is written in C++ but, like Unity, can be scripted in other languages. Like unity it fits the "GC language for high level scripting of non-gc code" pattern. There is certainly no debate about the feasibility of implementing game logic in Lua. Reference counting in graphics drivers is not comparable to GC in Java or C# because its lack of generality permits the use of faster algorithms that don't GC pause. Swift is a workable systems language with reference counting built in, but you should bear in mind that it doesn't have "a garbage collector" per se, like you would imagine when you hear that a language is GC'd.

Re: Driving with D

#164
post #159

Earlier quoted context omitted.

Unreal then, https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScrip... Or you prefer anything written in DirectX or Metal? Chapter 5 from The Garbage Collection Handbook. https://gchandbook.org/contents.html

Unreal is written in C++ but, like Unity, can be scripted in other languages. Like unity it fits the "GC language for high level scripting of non-gc code" pattern. There is certainly no debate about the feasibility of implementing game logic in Lua. Reference counting in graphics drivers is not comparable to GC in Java or C# because its lack of generality permits the use of faster algorithms that don't GC pause. Swif…

Reference counting pauses when cascading deletions take place, it well known domino effect.

C# allows for GC free regions with GC.TryStartNoGCRegion, manual memory management via MarshalServices, stackalloc, Span() and value types.

Almost forgot Unreal C++ is GC based for entities and anything Blueprint related.

Re: Driving with D

#165
post #99
post #93

Earlier quoted context omitted.

All my embedded design work has been in C as i don't need all the extra cruft. Also anything i want to be very fast on limited hardware i also use C and C only. As for any hobby programming i do on the side, C is usually my goto choice, unless i want to be very esoteric.. following along the lines of: "The enemy of art is the absence of limitations."

I find that C actually gets in my way compared to D when I am writing code with limited resources. The end result is semantically the same but with D I can avoid macros, inline asm is easier etc.

while this makes all the sense in the world to even a seasoned C programmer...

I've been doing it so long I could write macros in my sleep, and inline asm is a fun little exercise.

Though i absolutely agree, especially with someone newer, that could be a major road block. Might want to learn D just to be more efficient (even though I will never abandon my first love completely)

Re: Driving with D

#166
post #157

Earlier quoted context omitted.

D had Andrei Alexandrescu behind it for years, he worked at facebook for a while and tried to push D there, and they did used D for while Andrei is a big deal i would say Since then FB moved on the build their own Ocaml based language reasonml Julia doesn't have a big company behind, yet the language is steadily climbing the popularity ladder (and i doubt they have anyone at the calibre of Andrei Alexandrescu, but ag…

Last time I checked MIT is rather big. Facebook never really adopted D beyond a C++ preprocessor written in D. And yes the community is rather lousy with language marketing, which is completely unrelated to technical achievements.

A product failed, blame the product owner (designer, maker, etc..)

Why are you refusing to blame the product owner

D is not a good language, it really is not, it doesn't offer any compelling advantage to justify accepting its flaw

Or simply put, its a bad product A bad product doesnt have to be trash, just enough bad design issue to make it bad I would strongly recommend new developers not to touch it there are far better option

Say it as it is, its simple, its the truth

Its functional, people use it, but its bad C++ is also bad, but its so overwhelmingly popular that you might want to learn it D is bad, and is unpopular

Re: Driving with D

#167

Just - impressive. And since this is about dlang a bit... My favorite part of D compared to cpp, was metaprogramming syntax. (i.e. NOT ' ') I was so sad when I got to know that the only thing that rust took from cpp, was ' '.

It's really beyond me why would Rust designers adopted the '' symbols. If I'm not mistaken Walter had specifically mentioned that he's avoided these symbols based on his experience on implementing C++ compiler in the early days of C++. Due to the ambiguity of the symbols with other operations' symbol, their inclusion will require extra symbol look up table and this will significantly increased parsing and hence overall compilation time. Based on the complaints on Rust compilation time that you see in HN, probably he's right after all.

One of the design principles of D is to create compiler friendly programming language and this is evident with the higher speed compilation of the D programs in comparison to similar program in C++ and Rust. Comparatively speaking, Go also has a very fast compilation time but Go currently does not support generic yet, and there's that.

In addition, another design principle of D is to be as intuitive as possible and programmer friendly compiled programming language. If you think this should be easy please check this video regarding of this Professor to try to completely compile R to no avail in 10 years during a keynote speech in a recent major R conference [1]. For examples, this is the reason that you have UFCS in D and there's also no macro in D. You can see that some of later programming languages agreeing with D approaches and copying this UFCS feature. On the overall language idioms, D want to be easily program similar to Python but compiled, i.e. fast in compilation and running time. FYI, there is even a book specifically written for Python programmers if they want try and perhaps migrate to D [2].

[1] How I Learned to Love Failing at Compiling R

https://www.youtube.com/watch?v=VdD0nHbcyk4

[2]D, the Best Programming Language, for Former Python Developers : Learn D Programming for Python Developers

https://www.amazon.com/Programming-Language-Former-Python-De...

Re: Driving with D

#168

Earlier quoted context omitted.

How does that matter? You said "game development", not "writing a game engine". You said "data analysis", not "writing linalg algorithms", in which case we'd all have to bow to Fortran anyway. Your argument also doesn't apply to GUI apps, anyway. C# and Java amount to a huge number of such apps, and they're self-hosted. GC languages are vastly more productive that manual-memory languages, and for the vast majority of…

If your suggestion is, "GC languages can be used to write anything so long as whatever parts can't be written in a GC language are written in a non GC language," then yes that's true. But it's also a tautology.

If you need to stay away from the GC because of some practical reason, you can always write C/C++/Rust. You implied that this is a frequent situation when it isn't. Your example of "anything with a UI" was quite a bad one.

Most projects are better off written in a GC language because the productivity benefits outweigh the performance costs.

Re: Driving with D

#169
post #94
post #13

Hi, I'm the author of the article. Feel free to ask any questions you may have. I have to go to bed, I have work in about 4 hours, so I'll reply when I can.

You're a wizard. I wouldn't have a clue where to start with a project like this.

Thank you!

I spend a tonne of time in the reference manual for the 6 speed, and things clicked for what my next steps should be. It was really about trying to familiarise myself with the problem as much as possible.

Re: Driving with D

#170
post #13

Hi, I'm the author of the article. Feel free to ask any questions you may have. I have to go to bed, I have work in about 4 hours, so I'll reply when I can.

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…

1. I don't interface to my car's electronics over serial or CAN bus. Instead, I interface by emulating actuators and sensors the 4 speed gearbox computer expects.

2. I'd like to introduce you to "manualisation" [0]. It's where the solenoids of the 4 speed are wired directly to the gear selector switch. The 4 speed computer is surprisingly tolerant of this, and it forms the basis of my interface.

My interface provides enough information to the 4 speed computer to stop it from erroring out or putting my car into limp mode. However, it is aware that something has changed because changes in engine RPM do not correlate with its shift commands.

3. I mean in terms of software. I can modify the behaviour of my box more than a standard tune can. I can add a 0-100KM/h tracker to my system, or shift lights, I can fundamentally change the decision making process in shifting (for the moment it's torque based), etc.

I could go out on a limb and a GPS module and a map; it'd select a gear based on the corner angle and speed or so.

Thank you for kind words :) If you have any other questions, ask away!

[0] https://youtu.be/H1T6vr44Zak

Post reply on HN