Live data from Hacker News

My Vision of D’s Future

dlang.org

111–120 of 211 posts

Re: My Vision of D’s Future

#111
post #8

C++ interop sounds like a great unique selling point. Rust/Go/Swift can't match it.

It's not unique. Nim offers C++ interoperability too. https://nim-lang.org/features.html

Nim does it by compiling to c++, which means it's dependent on c++. D isn't.

Re: My Vision of D’s Future

#112
post #47

Earlier quoted context omitted.

I find that D is about as easy as Python to get into. Being able to use rdmd as a shebang makes D almost feel like as scripting language. A lot of Python was also pretty easy for me to directly translate into D. Here is an example: http://inversethought.com/hg/medcouple/file/tip/medcouple.py... http://inversethought.com/hg/medcouple/file/tip/medcouple.d#...

While I enjoy using D, I find it hard to use at times. Especially if someone isn't a C++ veteran, as soon as heavy template usage comes into play I get confused, and error messages are useless because it's several screens of errors with multiple isX() && !isY() && isZ() conditions for types. Most of the standard library function calls return some opaque Result type which isn't obvious how to progress from. Only after…

I've written like one C++ program in my life and I had no problems figuring it out. Although I write C somewhat frequently and have done a lot of Haskell stuff. I think experience with any statically typed language is going to make it easier to learn another one.

Re: My Vision of D’s Future

#113

Earlier quoted context omitted.

While I enjoy using D, I find it hard to use at times. Especially if someone isn't a C++ veteran, as soon as heavy template usage comes into play I get confused, and error messages are useless because it's several screens of errors with multiple isX() && !isY() && isZ() conditions for types. Most of the standard library function calls return some opaque Result type which isn't obvious how to progress from. Only after…

Having to use .array() on the Result of some functions is the exact same problem I've ran into as well! D is by far my favorite language but there is definitely some room for improvement in terms of documentation on how to use the standard library.

On the other hand, I like the explicitness of it instead of automatically converting to a different type. At least you know exactly what it's doing.

The python version of it would be calling `list()` on things all the time, which you might not always want to do.

Re: My Vision of D’s Future

#115

Earlier quoted context omitted.

I work in c++ and D was designed in part to address a lot of c++ complaints. so I find myself with very few issues while writing D. it's just a very enjoyable experience (subjective ik) the meta programming is very cool also

I am worried the push towards integration with C++ will just turn D into a cheap C++ clone. We already got copy constructors, just to interact with C++ code. More C++ features to come.

Nothing cheap about being way ahead of C++ in metaprogramming and compile-time programming.

Re: My Vision of D’s Future

#116
post #27
post #7

Earlier quoted context omitted.

I guess I also mean actually referring to it more as DLang (or something) so people start calling it that. "D" is so hopeless to even use in conversation. Even "Rust" is miles better, and that's not exactly a brilliant name either.

> "D" is so hopeless to even use in conversation. Not any more hopeless than one of the top-10 most popular languages, C. Except if you mean the juvenile joke it alludes to, in which case, nobody really cares between adults. No company is not gonna be use D because in some memes it means dick. Libraries, tooling, maturity, devs, speed, are the real concerns...

There's nothing wrong with juvenile jokes; we can be adults without being prudes. The only issue with D is the well runs dry pretty quick.

Re: My Vision of D’s Future

#117

Earlier quoted context omitted.

Most languages settle down with C interop and don't bother with the added complexity from C++. Rust is one of those, some of the concepts aren't even on the language right now, what would lead to very non-idiomatic imports.

The Rust bindgen tool automatically generates Rust FFI bindings to C and C++ libraries. Mozilla uses bindgen a lot to interoperate between Firefox's C++ and Rust code. IIUC, Rust and C++ code can't seamlessly call each other unchanged, but bindgen adds FFI glue that makes it much easier. https://github.com/rust-lang/rust-bindgen

The C++ on the documentation is there for the few places where there's nothing on the interface not supported by Rust. Notice it says it generates biding for "C (and some C++) libraries".

A C interface on C++ code is how most people do interoperability with C++ libraries. It is pretty much C, so you can just use the FFI. But it's not really a C++ compatible FFI.

Re: My Vision of D’s Future

#119

Earlier quoted context omitted.

It's not unique. Nim offers C++ interoperability too. https://nim-lang.org/features.html

Nim does it by compiling to c++, which means it's dependent on c++. D isn't.

And what exactly is the bad thing about that?

Re: My Vision of D’s Future

#120

I have to say, I like what I read there. I'm glad they're working more on c++ interoperability. I've ported some c++ code to D before, it wasn't not too bad, it wasn't a lot of code, but it would be great to be able to work directly with c++ libraries in D similarly to C libraries. It always makes me sad D hasn't picked up more. Usually comments I see about D seem pretty ambivalent to dismissive. It's a great languag…

The main reason that D hasn't been picked up by anyone is mostly because it is an evolution of C++, not a revolution. Discarding an entire ecosystem for an evolution is not going to happen. Rust took a very different approach and just threw everything away. D looks and feels too much like C++, I would rather have hoped that effort would have been spent on making C++ better.

Not really, it doesn't feel like C++. D fixes many C++ annoyances, has a GC, doesn't have the annoying preprocessor, header files.

Walter Bright did try to make C++ better, remember that D came along after he wrote the Digital Mars C++ compiler.

C++ has also improved in the meantime.

Post reply on HN