Live data from Hacker News

How does D improve on C++17?

p0nce.github.io

31–40 of 77 posts

Re: How does D improve on C++17?

#31

D is a fantastic language. C++ is so difficult to unseat as a systems language now since it is back as a moving target which is both evolving and has extremely robust tools to go with it. Challenging it on the language level is not enough.

Yeah. C++ has so good tooling that despite what new language I try, I always hit some implementation, ecosystem or tooling issue that always leads me to conclude I would have been more productive with C++. Which sucks monkeyballs as aesthetics go.

Re: How does D improve on C++17?

#32
post #23

I was working on a similar article just a couple of weeks ago for the D wiki, but I wanted to focus on the really big things, and I want to include more examples: http://wiki.dlang.org/Coming_From/C_Plus_Plus_WIP_article

Yeah, my article is a bit of a quickie and not very good, I didn't expect people would post them here and on reddit. Moreover, it isn't a big picture post.

Re: How does D improve on C++17?

#33
Is now the time for D? I really wonder, I am not really sure. Certainly a lot of languages go thru a period of obscurity before success, but I'm still uncertain.

The one issue that sticks for me was the dual standard libraries. Just seems so messy.

Re: How does D improve on C++17?

#34

Is now the time for D? I really wonder, I am not really sure. Certainly a lot of languages go thru a period of obscurity before success, but I'm still uncertain. The one issue that sticks for me was the dual standard libraries. Just seems so messy.

The dual library issue ended 7 years ago or so.

Re: How does D improve on C++17?

#35

> D has no need for a preprocessor How does this work, specifically conditional compilation? I have lots of code like this: #if __APPLE__ /* do things the OS X way */ #else /* do things the Linux way */ #endif Where the OS X way calls functions that do not exist on Linux, and vice-versa. How does D handle this?

    version (Posix) {
      version(OSX) {
        // Weird stuff on OSX
      }
    // Sane stuff for Linux or FreeBSD
    }
    version (Windows) {
      // Weird stuff for Windows
    }
But think that this is processed by the compiler, not by a text pre-processor. Also, you can use your own version stuff, for example here : https://github.com/Zardoz89/nBodySim/blob/master/source/app.... there is a "PFor" version to allow to compile a version of the program that uses a parallel foreach (an N Body simulator)

Re: How does D improve on C++17?

#36

> D has no need for a preprocessor How does this work, specifically conditional compilation? I have lots of code like this: #if __APPLE__ /* do things the OS X way */ #else /* do things the Linux way */ #endif Where the OS X way calls functions that do not exist on Linux, and vice-versa. How does D handle this?

Lack of a preprocessor does not imply lack of conditional compilation: http://dlang.org/version.html The constructs are simply built into the language. This has considerable benefits: you can use e.g. `static if` to enable/disable code based on conditions which refer to constants declared in the program (there is no longer a separate namespace for preprocessor defines and program constants), and with CTFE, you can us…

The language it's itself his own preprocesor, thanks to CTFE. I think that it is what I love more of D.

Re: How does D improve on C++17?

#37
> D has a package manager. C++ has none that is popular in its community. Therefore, using a third-party library is many times easier.

This comes up all the time in reference to C++. C++ doesn't need a package manager because it has excellent support from distro package managers. Most libraries are in the system package manager. And yes, sometimes you need a newer version of a package or one not quite widely-used enough to be in the system package manager, in which case you need to do compile it yourself or install it manually. But that is a problem common to all package managers and there is nothing about D which will make it any easier.

Re: How does D improve on C++17?

#38

Earlier quoted context omitted.

>WalterBright uses it in his compiler. Ironically, the dmd compiler is written in C++.

D didn't exist when the dmd compiler was written. But Daniel Murphy has written a C++ to D converter, and it's looking like the next release will have dmd written in D.

Where is ?

Re: How does D improve on C++17?

#39

I'm curious how many people out there on HN actully use D and what for? I don't typically see D based projects here on HN so it would be interesting to find out about any use cases where D was found a perfect fit.

I did some hobby stuff with it. But I'm afraid that I didn't use it for real stuff. A few weeks ago I try to use it to write a tool to update our Java webservices from the latest Maven deploy (I'm afraid that I work as Java programmer :( ). Sadly I got issues with linking against std.net.curl , and I end writing a bash script for that.

I really enjoy a lot more writing on D, but I keep finding the issue that I need to interface with C++ libs for something (for example Qt 5 for an emulator GUI) or weird errors like these problem with std.net.curl on Ubuntu 14.04 . If not was for that, I would wrote the Trillek virtual computer on D.

Re: How does D improve on C++17?

#40

Is now the time for D? I really wonder, I am not really sure. Certainly a lot of languages go thru a period of obscurity before success, but I'm still uncertain. The one issue that sticks for me was the dual standard libraries. Just seems so messy.

The dual library issue ended 7 years ago or so.

enh shows how much i know.

Honestly, I'm pretty excited for Rust. Having a strong proof of lifetime enforced by compiler is very compelling idea.

Post reply on HN