www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D vs Zig

reply Walter Bright <newshound2 digitalmars.com> writes:
https://news.ycombinator.com/item?id=46165249
Dec 05
next sibling parent Kapendev <alexandroskapretsos gmail.com> writes:
On Saturday, 6 December 2025 at 01:02:05 UTC, Walter Bright wrote:
 https://news.ycombinator.com/item?id=46165249
Of course D and Zig share a lot of things, but that's not that important. Happy to see them enjoy Zig and making something with it. We (The cool D community) could try that too sometimes hehe. I'm joking a bit ;)
Dec 05
prev sibling next sibling parent reply monkyyy <crazymonkyyy gmail.com> writes:
On Saturday, 6 December 2025 at 01:02:05 UTC, Walter Bright wrote:
 https://news.ycombinator.com/item?id=46165249
 Build systems: Anyone who’s fought with CMake or dealt with 
 header file dependencies knows this pain. For a small team 
 trying to move quickly, we didn’t want to waste time debugging 
 build configuration issues.
The majority of the community doesn't seem to know how to run the d compiler, if you want to compete here you could but youd probably piss off the dub people
Dec 05
parent reply Sergey <kornburn yandex.ru> writes:
On Saturday, 6 December 2025 at 01:45:09 UTC, monkyyy wrote:
 The majority of the community doesn't seem to know how to run 
 the d compiler, if you want to compete here you could but youd 
 probably piss off the dub people
Write a post to HN !! It will be win-win-win As you will - improve your attractiveness for employers - advertise OpenD - make Walter happy Just D it
Dec 06
parent reply monkyyy <crazymonkyyy gmail.com> writes:
On Saturday, 6 December 2025 at 12:50:28 UTC, Sergey wrote:
 On Saturday, 6 December 2025 at 01:45:09 UTC, monkyyy wrote:
 The majority of the community doesn't seem to know how to run 
 the d compiler, if you want to compete here you could but youd 
 probably piss off the dub people
Write a post to HN !! It will be win-win-win As you will - improve your attractiveness for employers - advertise OpenD - make Walter happy Just D it
why would I publish that to hn? When I did try writing d articles did anyone read them?
Dec 06
next sibling parent Kapendev <alexandroskapretsos gmail.com> writes:
On Saturday, 6 December 2025 at 13:08:04 UTC, monkyyy wrote:
 On Saturday, 6 December 2025 at 12:50:28 UTC, Sergey wrote:
 On Saturday, 6 December 2025 at 01:45:09 UTC, monkyyy wrote:
 The majority of the community doesn't seem to know how to run 
 the d compiler, if you want to compete here you could but 
 youd probably piss off the dub people
Write a post to HN !! It will be win-win-win As you will - improve your attractiveness for employers - advertise OpenD - make Walter happy Just D it
why would I publish that to hn? When I did try writing d articles did anyone read them?
I did... 👉👈😳 And... I would like to see one on HN one day... It's my favorite platform!
Dec 06
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 12/6/2025 5:08 AM, monkyyy wrote:
 why would I publish that to hn? When I did try writing d articles did anyone 
 read them?
Publishing on HN is a great way to attract readers. Another way is to publish it on X.com.
Dec 06
parent reply monkyyy <crazymonkyyy gmail.com> writes:
On Saturday, 6 December 2025 at 21:26:26 UTC, Walter Bright wrote:
 On 12/6/2025 5:08 AM, monkyyy wrote:
 why would I publish that to hn? When I did try writing d 
 articles did anyone read them?
Publishing on HN is a great way to attract readers. Another way is to publish it on X.com.
Convince someone to write up a blog post about my hot reloading lib and why it cant exist in c and maybe cant exist in c++ and how its amazing someone completely unempoyable wrote it in 100 lines or whatever; and lets see if you get 1000 new dlang users. Worse-reddit will be full of flakes and conformists with worse attension spans then me(and thats is saying something); I dont think it will happen. You have your niche, it be better if you exploited it rather then competing with the rust cult. I put allot into this: https://crazymonkyyy.github.io/writings/gif.html I didnt see a return, your free to post it to hakernews to see what happens.
Dec 06
next sibling parent reply Julian Fondren <julian.fondren gmail.com> writes:
On Saturday, 6 December 2025 at 23:47:40 UTC, monkyyy wrote:
 I put allot into this: 
 https://crazymonkyyy.github.io/writings/gif.html I didnt see a 
 return, your free to post it to hakernews to see what happens.
The breakdown's good. Quick visualizations like this are seasonal with Advent of Code, and also are a fun part of Raytracing in One Weekend. This doesn't work as a script but is similar: ```d import std; const width = 255, height = 255; void main() { enum s = "magick -size 255x255 -depth 8 rgb:- output.gif"; auto convert = pipeProcess(s.split.array, Redirect.stdin); foreach (ubyte time; 0 .. 255) { foreach (ubyte y; 0 .. height) { foreach (ubyte x; 0 .. width) { ubyte r = time; ubyte g = y; ubyte b = x; ubyte[3] pixel = [r, g, b]; convert.stdin.rawWrite(pixel); } } } convert.stdin.close; convert.pid.wait; spawnProcess(["xdg-open", "output.gif"]); } ``` This one does work as a script, pulls in a D library, and caches compilation, but I wasn't able to get it a gif out of it: ```d /++ dub.sdl: configuration "release" { targetType "executable" dependency "gamut" version="~>3.3.5" } +/ enum width = 255, height = 254; import std; import gamut; void main() { ubyte[3][] pixels = new ubyte[3][width * height]; foreach (ubyte y; 0 .. height) { foreach (ubyte x; 0 .. width) { ubyte r = 1; ubyte g = y; ubyte b = x; pixels[y * width + x] = [r, g, b]; } } Image image; image.createLayeredView(&pixels[0][0], width, height, layers: 1, PixelType.rgb8, pitchInBytes: 3 * width, layerOffsetBytes: width * height * 3); enforce(!image.isError); image.saveToFile("output.png"); spawnProcess(["xdg-open", "output.png"]); } ```
Dec 07
parent monkyyy <crazymonkyyy gmail.com> writes:
On Monday, 8 December 2025 at 03:53:08 UTC, Julian Fondren wrote:
 On Saturday, 6 December 2025 at 23:47:40 UTC, monkyyy wrote:
 I put allot into this: 
 https://crazymonkyyy.github.io/writings/gif.html I didnt see a 
 return, your free to post it to hakernews to see what happens.
The breakdown's good. Quick visualizations like this are seasonal with Advent of Code, and also are a fun part of Raytracing in One Weekend. This doesn't work as a script but is similar: ```d import std; const width = 255, height = 255; void main() { enum s = "magick -size 255x255 -depth 8 rgb:- output.gif"; auto convert = pipeProcess(s.split.array, Redirect.stdin); foreach (ubyte time; 0 .. 255) { foreach (ubyte y; 0 .. height) { foreach (ubyte x; 0 .. width) { ubyte r = time; ubyte g = y; ubyte b = x; ubyte[3] pixel = [r, g, b]; convert.stdin.rawWrite(pixel); } } } convert.stdin.close; convert.pid.wait; spawnProcess(["xdg-open", "output.gif"]); } ``` This one does work as a script, pulls in a D library, and caches compilation, but I wasn't able to get it a gif out of it: ```d /++ dub.sdl: configuration "release" { targetType "executable" dependency "gamut" version="~>3.3.5" } +/ enum width = 255, height = 254; import std; import gamut; void main() { ubyte[3][] pixels = new ubyte[3][width * height]; foreach (ubyte y; 0 .. height) { foreach (ubyte x; 0 .. width) { ubyte r = 1; ubyte g = y; ubyte b = x; pixels[y * width + x] = [r, g, b]; } } Image image; image.createLayeredView(&pixels[0][0], width, height, layers: 1, PixelType.rgb8, pitchInBytes: 3 * width, layerOffsetBytes: width * height * 3); enforce(!image.isError); image.saveToFile("output.png"); spawnProcess(["xdg-open", "output.png"]); } ```
Im fairly opinionated about line count and start up time to get a hello world; and youve more then doubled the line count and added a language specific dependency. Your lib likely makes sense if your doing a 1000 line task, but Im trying to communicate using a computer as data processing with "pipes" of black boxes visually with this article.
Dec 08
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
Nice article! Please append "Using D" to the title, and I'll post it to HN!
Dec 07
parent reply monkyyy <crazymonkyyy gmail.com> writes:
On Monday, 8 December 2025 at 05:40:34 UTC, Walter Bright wrote:
 Nice article! Please append "Using D" to the title, and I'll 
 post it to HN!
Again I dont care for hn. If you want articles, provide a structure; if you have a requirement like "titles start with 'Using D:'" you could define that, host a section on one of your websites then *quarterly* post a link to hn for a newletter. That way your trading whatever social capital you have in your non-profit for these requirements; make them not bullshit and clear upfront, that that trade becomes reasonable. In 5 years you would have a big pile of articles all in a single link hierarchy that *THEN* getting someone to read may convert into a d user
Dec 08
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 12/8/2025 6:54 AM, monkyyy wrote:
 On Monday, 8 December 2025 at 05:40:34 UTC, Walter Bright wrote:
 Nice article! Please append "Using D" to the title, and I'll post it to HN!
Again I dont care for hn.
I'm trying to help you (and D!). Absent an effort to promote the article, nobody is going to read it. It's a good article you wrote. All it needs is a "Using D" appended to the title. It doesn't need a structure. I cannot fix the article for you. Please help me help you!
Dec 08
next sibling parent Peter C <peterc gmail.com> writes:
On Tuesday, 9 December 2025 at 03:06:51 UTC, Walter Bright wrote:
...
D is primarily community and foundation-driven. It's not that the D programming language is not viable in a production setting, it's that it doesn't address the practical realities of industry. In 'the real world', industry prioritizes availability of talent, depth of the library ecosystem, and the assurance of corporate backing (i.e. risk management), over pure language elegance. It's technical merit is irrelevant to hiring managers. Excellent (C/C++ like speed) is not a differentiating factor (Go, Rust, C++ exist) These are some of the reasons why D struggles here compared to its competitors. Zig, while having a different design philosophy than D, faces the same fundamental challenges regarding widespread industry adoption. To me, as useful as it is, D is essentially the disorganized "kitchen sink" of programming languages. Of course, that is not what will bring about widespread adoption these days. The successful modern languages define themselves by what they exclude and the specific problem they solve best. New modern programming langauges need to differentiate themselves with a clear, specialized focus. So if D is going to self promote, then it makes sense to do that on platforms where you can potentially expand the D community. But forget about widespread industry adoption. It's just no going to happen.
Dec 08
prev sibling parent reply Kapendev <alexandroskapretsos gmail.com> writes:
On Tuesday, 9 December 2025 at 03:06:51 UTC, Walter Bright wrote:
 On 12/8/2025 6:54 AM, monkyyy wrote:
 On Monday, 8 December 2025 at 05:40:34 UTC, Walter Bright 
 wrote:
 Nice article! Please append "Using D" to the title, and I'll 
 post it to HN!
Again I dont care for hn.
I'm trying to help you (and D!). Absent an effort to promote the article, nobody is going to read it. It's a good article you wrote. All it needs is a "Using D" appended to the title. It doesn't need a structure. I cannot fix the article for you. Please help me help you!
Monkeyyyy, it's not a bad idea to try. Will also be fun to see the reactions of HN people. I'm currently trying to write a blog about memory management in D (GC, no GC, mixed), but will take some time haha.
Dec 09
parent Walter Bright <newshound2 digitalmars.com> writes:
On 12/9/2025 2:17 AM, Kapendev wrote:
 I'm currently trying to write a blog about memory management in D (GC, no GC, 
 mixed), but will take some time haha.
I'm looking forward to seeing it!
Dec 09
prev sibling parent Guillaume Piolat <first.nam_e gmail.com> writes:
On Saturday, 6 December 2025 at 23:47:40 UTC, monkyyy wrote:
 I put allot into this: 
 https://crazymonkyyy.github.io/writings/gif.html I didnt see a 
 return, your free to post it to hakernews to see what happens.
Cool article, I went to try to play games but your link yield https://crazymonkyyy.github.io/monkyyy.itch.io/frut-gam3 ought to be https://monkyyy.itch.io/frut-gam3
Dec 08
prev sibling next sibling parent reply zjh <fqbqrr 163.com> writes:
On Saturday, 6 December 2025 at 01:02:05 UTC, Walter Bright wrote:
 https://news.ycombinator.com/item?id=46165249
Rust is now fully interfacing with C++, especially Google. I think for D to develop, it's also crucial to fully interface with C++!
Dec 05
next sibling parent reply Sergey <kornburn yandex.ru> writes:
On Saturday, 6 December 2025 at 02:06:01 UTC, zjh wrote:
 Rust is now fully interfacing with C++, especially Google. I 
 think for D to develop, it's also crucial to fully interface 
 with C++!
Which project of Rust can interface with C++? Afaik they are solving this issues with automatic bindgen approach So they are generating C API automatically and working with this API. D can just steal this C API if it was generated and use it in dstep/importC Btw do you still use D? Or did you switch to Rust?
Dec 06
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
D also supports the C++ name mangling, which means D can call C++ functions.
Dec 06
parent reply Sergey <kornburn yandex.ru> writes:
On Saturday, 6 December 2025 at 21:24:52 UTC, Walter Bright wrote:
 D also supports the C++ name mangling, which means D can call 
 C++ functions.
This functionality pretty hard to work with. I've tried to use it for one C++ library and finished with the approach of manually prepared C API for C++ API and ImportC. It worked much better approach. Examples are here https://github.com/cyrusmsk/gguf-converter/tree/main/libs_tests Simple C++ interop was working with D (separate folder where I've tried to compare this with popular ML/AI langs). But when I tried to use it with real C++ library (sentencepiece) that I wanted to use (sp folder) - it failed with C++. It was non-straightforward how to define namespaces and how to work with string_views. If anyone could fix this C++ library - would be interesting to see.
Dec 06
parent Walter Bright <newshound2 digitalmars.com> writes:
On 12/6/2025 2:08 PM, Sergey wrote:
 It was non-straightforward how to define namespaces and how to work with 
 string_views.
https://dlang.org/spec/attribute.html#namespace If there's something wrong with the documentation, please let us know.
Dec 07
prev sibling parent zjh <fqbqrr 163.com> writes:
On Saturday, 6 December 2025 at 12:47:54 UTC, Sergey wrote:
 On Saturday, 6 December 2025 at 02:06:01 UTC, zjh wrote:
 Which project of Rust can interface with C++?
 Btw do you still use D? Or did you switch to Rust?
Google and other big companies are currently using Rust, but I don't like rust. What I want is to combine C++ and D.
Dec 06
prev sibling parent reply Bienlein <fm2002 web.de> writes:
On Saturday, 6 December 2025 at 02:06:01 UTC, zjh wrote:
 On Saturday, 6 December 2025 at 01:02:05 UTC, Walter Bright 
 wrote:
 https://news.ycombinator.com/item?id=46165249
Rust is now fully interfacing with C++, especially Google. I think for D to develop, it's also crucial to fully interface with C++!
I had a quick look at Zig and I don't that is has some unique selling point. Rust hast memory safety, Go has much easier concurrency using Goroutines aka Communicating Sequential Processes (CSP). But Zig has neither nor - nor anything new aside from Rust and Go. For example Crystal has CSP as well. The work Dmitry Olshansky has done with Photon adding something like CSP to D is IMHO very valuable and a big step.
Dec 08
parent Serg Gini <kornburn yandex.ru> writes:
On Monday, 8 December 2025 at 13:46:33 UTC, Bienlein wrote:
 I had a quick look at Zig and I don't that is has some unique 
 selling point. Rust hast memory safety, Go has much easier 
 concurrency using Goroutines aka Communicating Sequential 
 Processes (CSP). But Zig has neither nor - nor anything new 
 aside from Rust and Go. For example Crystal has CSP as well.
It's quite rarely mainstream languages are getting something completely new. Rust taken ideas from https://en.wikipedia.org/wiki/Cyclone_(programming_language) Go was a direct continuation of ideas from (though reworked) https://en.wikipedia.org/wiki/Alef_(programming_language) and https://en.wikipedia.org/wiki/Limbo_(programming_language) No implicit is the main feature of Zig I think. Everything is explicit as possible. https://ziglang.org/learn/why_zig_rust_d_cpp/
 The work Dmitry Olshansky has done with Photon adding something 
 like CSP to D is IMHO very valuable and a big step.
That work is awesome yes
Dec 08
prev sibling parent reply xlogor <xororwr gmail.com> writes:
On Saturday, 6 December 2025 at 01:02:05 UTC, Walter Bright wrote:
 https://news.ycombinator.com/item?id=46165249
Zig's rise is not just marketing, they have great tooling, they have an LSP that's actually usable, and works with all its language features, including translate-c and comptime..
Dec 08
next sibling parent reply Kapendev <alexandroskapretsos gmail.com> writes:
On Tuesday, 9 December 2025 at 07:31:28 UTC, xlogor wrote:
 On Saturday, 6 December 2025 at 01:02:05 UTC, Walter Bright 
 wrote:
 https://news.ycombinator.com/item?id=46165249
Zig's rise is not just marketing, they have great tooling, they have an LSP that's actually usable, and works with all its language features, including translate-c and comptime..
I personally haven't had any issues with D language features. They are easy to misuse maybe like attributes (` nogc`, ...) or `-betterC`. LSP is the thing I see often here. I'm kinda interested on working on this, but will see. I need to make games too.
Dec 09
parent reply Serg Gini <kornburn yandex.ru> writes:
On Tuesday, 9 December 2025 at 10:10:30 UTC, Kapendev wrote:
 LSP is the thing I see often here. I'm kinda interested on 
 working on this, but will see. I need to make games too.
Don't be Clouudy
Dec 09
parent Kapendev <alexandroskapretsos gmail.com> writes:
On Tuesday, 9 December 2025 at 12:17:44 UTC, Serg Gini wrote:
 On Tuesday, 9 December 2025 at 10:10:30 UTC, Kapendev wrote:
 LSP is the thing I see often here. I'm kinda interested on 
 working on this, but will see. I need to make games too.
Don't be Clouudy
I haven't even started!! And I use nano and grep btw.
Dec 09
prev sibling parent reply Basile B. <b2.temp gmx.com> writes:
On Tuesday, 9 December 2025 at 07:31:28 UTC, xlogor wrote:
 On Saturday, 6 December 2025 at 01:02:05 UTC, Walter Bright 
 wrote:
 https://news.ycombinator.com/item?id=46165249
Zig's rise is not just marketing, they have great tooling, they have an LSP that's actually usable, and works with all its language features, including translate-c and comptime..
For some reasons I monitor foreign PL issues. That's been a week or so that i've updated the link to https://codeberg.org/ziglang/zig/issues. Beside my onw little experience, it's very clear that Zig is going into something. They've reached the next level.For the time being I would take care... Remember Nim-lang. Big hipe, now they are into the process of rewitting the compiler.
Dec 09
parent Kapendev <alexandroskapretsos gmail.com> writes:
On Tuesday, 9 December 2025 at 14:51:36 UTC, Basile B. wrote:
 On Tuesday, 9 December 2025 at 07:31:28 UTC, xlogor wrote:
 On Saturday, 6 December 2025 at 01:02:05 UTC, Walter Bright 
 wrote:
 https://news.ycombinator.com/item?id=46165249
Zig's rise is not just marketing, they have great tooling, they have an LSP that's actually usable, and works with all its language features, including translate-c and comptime..
For some reasons I monitor foreign PL issues. That's been a week or so that i've updated the link to https://codeberg.org/ziglang/zig/issues. Beside my onw little experience, it's very clear that Zig is going into something. They've reached the next level.For the time being I would take care... Remember Nim-lang. Big hipe, now they are into the process of rewitting the compiler.
Well, it's actually also Nim 3 in disguise.
Dec 09