Live data from Hacker News

Running a D game in the browser

code.alaiwan.org

11–17 of 17 posts

Re: Running a D game in the browser

#11
Excellent work, perseverance proves!

D is a very good language, avoiding most of the pitfalls of C++. I have wondered why D isn't picking up. Even Facebook has abandoned Warp [1]. Other than the lack of corporate backup,

The complexity of the language gets out of hold as we move forward.

DMD is the official compiler, but it doesn't optimize as much as LDC/GDC does. LDC/GDC is not available on the Enterprise platforms on which C++ is used (at least on the servers with RHEL/CentOS).

There are 3 different compilers and the resource is not concentrated on improving just one. I agree that competition is good for health, but when things are not picking up why not focus the efforts on making the better the best (probably GDC/LDC)?

Albeit few community members are very helpful and humble, personal attacks are a common thing in the forum.

The forum gives some hints [2], [3]

[1] https://github.com/facebookarchive/warp

[2] http://forum.dlang.org/post/vlosobeqnvfrfuriedpv@forum.dlang...

[3] http://forum.dlang.org/post/hjaiavlfkoamenidomsa@forum.dlang...

Re: Running a D game in the browser

#12
post #11

Excellent work, perseverance proves! D is a very good language, avoiding most of the pitfalls of C++. I have wondered why D isn't picking up. Even Facebook has abandoned Warp [1]. Other than the lack of corporate backup, The complexity of the language gets out of hold as we move forward. DMD is the official compiler, but it doesn't optimize as much as LDC/GDC does. LDC/GDC is not available on the Enterprise platforms…

D killed itself with the Digital Mars/Phobos confusion years ago. That it uses a GC doesn't help matters.

Re: Running a D game in the browser

#13
post #3

>An obvious enhancement would be to use the WebAssembly backend of the upstream LLVM, and then using Emscripten+Binaryen to convert the generated WebAssembly to asm.js. why would you convert WebAssembly to asm.js?

Actually, I wanted to benefit from the Emscripten execution environment, i.e reimplementation of APIs such as the SDL. I'm not sure there's such a thing for WebAssembly yet.

Re: Running a D game in the browser

#15

>At the moment, I’m only targetting a tiny subset of the D programming language. The language comes with a runtime, featuring a garbage collector. It’s my first journey to the land of D-asm.js, and there’s no way I’m bringing the D runtime with me – especially if I need to port it to Javascript first. This is basically why D is not a good systems programming language. Theoretical GC performance aside, barring a mirac…

That's more a question of entanglement between the runtime and the language, than a question of GC performance. Most of our projects, at work, are in D, and we never wished for a "higher quality GC" (except at the very start, when we started to use D, and were lured into thinking that "now that we have a GC, we don't need to be cautious with our allocations anymore").

Bare-metal in C and C++ is relatively easy, because the compiler doesn't insert runtime-dependent code to implement language constructions.

Avoiding this in D is a lot more subtle, as you have to know which language features require the runtime. For example, array copy (dest[0 .. 8] = src[0 .. 8]) will generate a call to the runtime. Almost every operation on associative arrays will also generate such calls. Class declaration will also generate references to the runtime (for dynamic type information).

However, there are lots of non-runtime things already making D a better C, like array slices and CTFE.

Which means that D is a good systems language, you just have to use it as a better C, and restrict yourself to language features not requiring the runtime.

Re: Running a D game in the browser

#16

>At the moment, I’m only targetting a tiny subset of the D programming language. The language comes with a runtime, featuring a garbage collector. It’s my first journey to the land of D-asm.js, and there’s no way I’m bringing the D runtime with me – especially if I need to port it to Javascript first. This is basically why D is not a good systems programming language. Theoretical GC performance aside, barring a mirac…

> This is basically why D is not a good systems programming language

The ability to run without its runtime is certainly a feature of good system programming languages.

Re: Running a D game in the browser

#17
post #11

Excellent work, perseverance proves! D is a very good language, avoiding most of the pitfalls of C++. I have wondered why D isn't picking up. Even Facebook has abandoned Warp [1]. Other than the lack of corporate backup, The complexity of the language gets out of hold as we move forward. DMD is the official compiler, but it doesn't optimize as much as LDC/GDC does. LDC/GDC is not available on the Enterprise platforms…

D killed itself with the Digital Mars/Phobos confusion years ago. That it uses a GC doesn't help matters.

D does not seem to be the HN darling these days. There have been several cycles of hype and counter-hype on Internet forums about it, much like a sinusoid waveform. What matters is that it delivers in practice and the number of users is growing regardless on the field.
Post reply on HN