Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can DMD compile C projects directly similar to the Zig compiler?


I haven't used Zig, but DMD can compile C projects directly using makefiles or by simply putting the .c files on the dmd command line.


Do you plan on giving Zig a try? (They seem to be doing a lot right.)

Taking the opportunity here to point people to "Adding Modules to C in 10 Lines of Code" from NWCPP earlier this year:

<https://www.youtube.com/watch?v=2ImfbGm0fls>

(The pitfalls you mention running into there wrt to different compiler instances is itself a decent case study in not relying on singletons <http://www.object-oriented-security.org/lets-argue/singleton...>—even if it ultimately wasn't so inconvenient that the work never got done, it would be even more convenient if it didn't need to have been done in the first place!)


> Do you plan on giving Zig a try? (They seem to be doing a lot right.)

All this Zig spam is getting very tiring.


It's not "Zig spam" to ask, in direct response to a compiler guy who has just stated that they have not tried it yet, whether they plan to. For further context, the video I linked to is Walter showing up to a C++ users group to present a talk about the D compiler infrastructure—again, at a C++ event, for a bunch of C++ programmers. Considering that, if what I've done here by asking the natural follow up question is a faux pas, then I hesitate to conceive of what you must think of those actions by the person I'm asking it of.

Even all that aside, comparing and contrasting contemporaries in a similar space is natural. That's just, like, scholarship, you know? Imagine someone who's defending their thesis responding to a question about alternatives to their research by getting into a big huff about it. That'd be pretty silly, right?

And the comments about "PL tribalism" are a little odd, then, since the most tribalistic behavior we have evidence for in this thread is someone reacting exactly like this. As a fan of Walter's contributions, including D, in the past I've gone so far as to put a non-trivial amount of effort into polishing the articles on D, Walter, and Digital Mars on Wikipedia. Meanwhile, I've never even written a Zig program, dude; if there's a tribe I belong to, it's not Zig.


> It's not "Zig spam" to ask (...)

It is Zig spam, not because of the discussion or the question or the topic of the time of day. It's Zig spam because it's yet another Zig post among the barrage of Zig posts desperately shoe-horning offtopic gratuitous references to Zig. It's tiring and adds nothing to any discussion.

If you feel that strongly about the need to promote Zig, submit discussions. Please don't spam each and any top submission with these gratuitous references.


Please don't blow past the comments already addressing your complaint.

What I responded to was a comment from D's own creator who himself directly mentioned Zig. I didn't shoe-horn shit. I've been waiting a long time for a hit on Corncob TV.

If you're upset about Zig mentioned here, your quarrel is not with me, the person who spent over half the words in their comment bringing it back to the original topic by linking to a useful talk; your quarrel is with, if anyone, the original questioner who got Walter to comment on Zig. (And even then, your ire would be tenuous at best, for the reasons already mentioned.) I also cannot "feel that strongly about the need to promote Zig"—because I am not promoting Zig. As I have already said, D is closer to my tribe than Zig is.


It's not off-topic though. D has the facility to compile C projects, as has Zig. OP asked a genuine question about whether Walter Bright was able to compare experiences.


In a conversation about languages with this kind of C interop, how can you omit Zig?


> In a conversation about languages with this kind of C interop

It's not. It's a discussion about "the C compiler built into the Digital Mars D compiler".

Please stop with all the Zig spam.


Instead of being petulant about it, you could ignore it and move on


Hard to ignore it when it's always in your face:

https://news.ycombinator.com/item?id=33331549

I don't mind languages getting hyped but seeing posts every week on the front page of HN about an unstable esoteric language with 0 adoption - yes, it's getting tiring.


Maybe you should appeal to the community and tell people to stop upvoting it, and explain why it’s wrong for them to think Zig is interesting.


How come it's always accounts made a few days ago which seem too have this problem with other people's interests


10241024 is without a doubt our friendly neighbor troll https://gist.github.com/andrewrk/9aed922a6210e57243af8be8d10...

simplotek is most probably a legitimate user annoyed by Zig news. I don't agree with their point, for what it's worth, but at least it's an opinion shared earnestly, unlike the troll.


Literally from the thread I shared:

- https://news.ycombinator.com/item?id=33337381 (posted from a 12-year-old account)

- https://news.ycombinator.com/item?id=33333904 (posted from a 2-year-old account)


> Instead of being petulant about it, you could ignore it and move o

Not wanting to see gratuitous self-promoting spam degrading the signal/noise ratio of an otherwise interesting discussion is hardly petulance. Replace any Zig reference shoe-horned into this discussion with, say, Java, and see if you have any point.


Agree about the excessive spam. To include attacks and bashing of other programming languages. It's very obvious what's going on and looks like it's going over the top, as if a concerted effort and mode of operation.


Reminds me of this post just from few days ago[1]. I wish HN had a rule or two dedicated to PL tribalism.

https://news.ycombinator.com/item?id=33382003


Have you heard of Rust?


If they've heard of zig, then they've almost certainly heard of Rust. I generally prefer Rust, but C interop is something that zig does significantly better.


Zig can be used as a standalone CC replacement and not just for FFI purposes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: