16 ms·
DigitalMars C/C++ Compiler
- 0x00000000 9y agoAutomated Teller ATM Machine If you are also confused by the title, DMC = DigitalMars Compiler. It is a C/C++ compiler which seems to be almost completely written by one person https://en.wikipedia.org/wiki/Digital_Mars https://en.wikipedia.org/wiki/Digital_Mars
- stochastic_monk 9y agoHe is also the only person who has ever written an entire C++ compiler on their own, in addition to the first direct-from-C++ compiler. Cfront was a transpiler.
- deleted 9y ago[deleted]
- userbinator 8y agoAccording to the comments it's a D compiler, not C++, but your point still stands.
- drb91 8y agoDMC is in fact a C/C+ compiler (from what I can tell; I don’t use it personally). The D compiler is called DMD.
- WalterBright 8y agoThat is correct. DMC is more precisely a C++98 compiler, with a few later additions.
- userbinator 8y agoI'm curious why the source files I randomly picked to skim over all had this at the top: * Compiler implementation of the * $(LINK2 http://www.dlang.org, D programming language).
- WalterBright 8y agoThe optimizer and back end are shared between DMC and DMD.
- p0nce 8y agoWhere is the DM C runtime code? I haven't found it.
- WalterBright 8y agohttps://github.com/DigitalMars/dmc https://github.com/DigitalMars/dmc
- ColonelPhantom 8y agoDo you have plans to bring it up to date with the current C++ standard?
- WalterBright 8y agoI don't have the time to. I'm always overcommitted :-(
- JdeBP 8y agoI suspect that both Tom Pennello and Chris Lattner would also qualify by your criteria.
- stochastic_monk 8y agoChris Lattner as the primary builder of LLVM deserves enormous credit for that work. Did he really write the entire C++ compiler himself? I haven't been able to find much on Tom Pennello besides some parsing papers from the 70s... I'm interested, but don't know how to find more about his work.
- JdeBP 8y agoOne name to look for is MetaWare.
- TallGuyShort 8y agoI would put up big money for a shirt that said "Run DMC++" and had the Digital Mars icon on it.
- WalterBright 8y agoGreat idea! Wish I'd thought of it. But then, I'd get sued by Run DMC :-(
- ufo 8y agoGCC has also joined in the fun: https://www.fsf.org/blogs/gnu-press/gnu-press-releases-run-gcc-shirt https://www.fsf.org/blogs/gnu-press/gnu-press-releases-run-g...
- chrisseaton 8y agoWhat are you replying to? The title doesn't use 'DMC'?
- 0x00000000 8y agoBefore it was edited, the title was "DigitalMars DMC Compiler"
- tux1968 9y agoHasn't had a release since 2013, but the Github code is still getting updates as recently as the last few weeks. It appears to be written in a mix of itself and D. Wasn't clear to me how you would go about bootstrapping it.
- WalterBright 8y agoDownload DMC and DMD, and you should be good to go.
- deleted 8y ago[deleted]
- Rexxar 8y agoApparently, the compiler is progressively rewritten in d. For those interested, there is a tag for the last pure c version: https://github.com/DigitalMars/Compiler/tree/Last-C-Version https://github.com/DigitalMars/Compiler/tree/Last-C-Version Would probably be interesting to convert it in C++17 :-) Meta-comment: I delete my previous comment by error and want to put it again, and didn't manage to do it again. Is there some anti-duplication code that prevent to write 2 times the same comment on HN?
- WalterBright 8y ago> Apparently, the compiler is progressively rewritten in d. Can confirm, that's what I'm doing. Most of the code is written in an old-fashioned style, but rather than redo that, it's more productive to convert to D, and then into a modern style. The D conversion as it stands is by rote translation, thereby retaining the technical debt. I don't plan on improving the structure until it is all in D.
- giancarlostoro 8y agoThis is great, are there some intended goals for having a C++ compiler written in pure D after you've started to improve the structure? I'm thinking of things like the faster C++ preprocessor that was done for Facebook in D (was it Warp?) and similar improvements to C++ through D. Thanks for all your awesome hard work by the way!
- WalterBright 8y agoI don't really have any scathingly brilliant goals for the D version, other than inspiring others to make use of it. I still maintain it, it'll be much easier to maintain in D, and not much work to convert it to DasBetterC. Yes, it was Warp: https://github.com/facebookarchive/warp https://github.com/facebookarchive/warp https://code.facebook.com/posts/476987592402291/under-the-hood-warp-a-fast-c-and-c-preprocessor/ https://code.facebook.com/posts/476987592402291/under-the-ho... You're welcome! It's reactions like yours that make it worthwhile.
- WalterBright 8y agoWalter here. AMA.
- thespirit 8y agoHas the re-write to D felt productive? May it have been better to start from scratch? Was the "D as a better C" approach inspired by your want to transition DMC to D?
- WalterBright 8y ago> Has the re-write to D felt productive? Yes, it's been oddly satisfying. > May it have been better to start from scratch? Ah, the age old question. I can guarantee, though, the answer is no. It took me maybe a couple weeks to convert the entire front end from C++ to D. Contrast that with the Warp preprocessor I wrote for Facebook, which took many months, and I knew what I was doing. And that is just the preprocessor! Basically, writing a C++ front end takes 10 man years. I know of no effort that took less time, and this is assuming the best in the business doing the writing. > Was the "D as a better C" approach inspired by your want to transition DMC to D? Partially, yes. And certainly doing the transition work has improved betterC. Nothing like proving it works than translating a crotchety old horrifyingly complex piece of code written in 1980's style. I plan on doing this to all my old projects that are still in use.
- loup-vaillant 8y ago> Basically, writing a C++ front end takes 10 man years. This is insane. No language needs to be that complex. I guess that's the power of backward compatibility: forcing an entire industry to dig itself into an ever growing hole, because in the short term we move faster by digging than by first clawing our way out.
- WalterBright 8y agoMastering C++ takes about 10 years, too :-) (Yes, you can be productive in C++ in much less time.)
- deleted 8y ago[deleted]
- WalterBright 8y agoNote that the compiler is fully open source using the Boost license. If you want to build it, you'll need to download the C++ binary from digitalmars.com, and the D compiler from dlang.org.
- exikyut 8y agoThis is absolutely awesome. Until now, the DM C/C++ compiler was closed-source freeware, with contracting/consulting available (https://digitalmars.com/consulting.html https://digitalmars.com/consulting.html). This makes things 10x as amazing :) Also related is that D is now completely under the Boost license as well. Historically D was "partially open, partially closed"; the D frontend (syntax parser and some other pipeline stages) was open, but the backend/code-generator was built on top of the Zortech C++ compiler for DOS/Windows/OS/2. (I only have a hazy notion of the Datalight>Zorland>Zortech>Symantec transition; I'll bet the story would make for an awesome history book, if that doesn't already exist. Hint) There was (highly appropriate) major fanfare when Symantec, who bought Zortech in Aug 1991, allowed the compiler backend technology to be open-sourced in April 2017, 1 year and 1 month ago: https://news.ycombinator.com/item?id=14060846 https://news.ycombinator.com/item?id=14060846 And that, fairly clearly, is what made this source release possible. Also https://news.ycombinator.com/item?id=17131274 https://news.ycombinator.com/item?id=17131274 :) References (most insightful first): - http://www.edm2.com/index.php/Zortech_C%2B%2B http://www.edm2.com/index.php/Zortech_C%2B%2B - https://en.wikipedia.org/wiki/Digital_Mars https://en.wikipedia.org/wiki/Digital_Mars - http://www.computinghistory.org.uk/det/10940/Zortech%20C/ http://www.computinghistory.org.uk/det/10940/Zortech%20C/ - http://www.edm2.com/index.php/Symantec_C%2B%2B http://www.edm2.com/index.php/Symantec_C%2B%2B
- vzaliva 8y agoI was scratching my head how I never heard of DMC++ until I realized that this is related to Zortech C++ compiler I've used (and loved) while ago.
- mathieubordere 8y agoWhy should I favor this compiler instead of gcc or clang?
- exikyut 8y agoIt was the first 3rd party compiler for Windows (1.0) It's apparently really nice to use (I'm on Linux :( ) It was written by one person It targets DOS, Windows and OS/2 (mostly Win32)
- WalterBright 8y agoFor a while it was the only C++ compiler for Windows. (I had figured out how to do all the various weird stack frame variations Windows required.) We sold a lot of those :-)
- exikyut 8y agoInteresting to know.
- WalterBright 8y agoOn Windows, DMC++ being developed on Windows tends to just work better on Windows. My experience in general with Linux tools ported to Windows is the adaptation to the Windows file system conventions is incomplete.
- jbb67 8y agoWhat C and C++ standard versions does this support?
- jfultz 8y agoThere doesn't appear to have been an official release of the compiler since 8.57, announced on August 8, 2013. https://forum.dlang.org/group/c++.announce https://forum.dlang.org/group/c++.announce I can't find anything about what changed between 8.52 and 8.57. But in 8.52, there wasn't even support for C++03, which the DMC site self-reports: https://digitalmars.com/ctg/CPP0x-Language-Implementation.html https://digitalmars.com/ctg/CPP0x-Language-Implementation.ht... cppreference maintains a compiler support grid for features in the C++11 and later standards, which includes DMC 8.52 and mentions a small number of supported features. http://en.cppreference.com/w/cpp/compiler_support http://en.cppreference.com/w/cpp/compiler_support Here's a post on the DMC forum from 2015 which seems to agree that C++11 support is generally not there. https://forum.dlang.org/thread/dbmsmttdbpfjsuhrhpkd@forum.dlang.org https://forum.dlang.org/thread/dbmsmttdbpfjsuhrhpkd@forum.dl...
- yuhong 8y agoI have been asking for them to fix the license on Open Watcom for a while now. A C compiler that has full support for x86 segmentation would be very useful for some projects.
- WalterBright 8y agoYou've got that with DMC today.
- ivanfon 8y agoWhat’s the use case for this compared to gcc or clang?