Earlier quoted context omitted.
My point was not that Rust creates better template code, but that a lot of things one uses dynamic dispatch for in C++ use templates instead. There are plenty of times when one knows the full derived type of a class in C++, but one throws away that information virtual calls are used anyway. I think this is because Rust makes it far easier to use generics; they're type-safe and don't need to be pushed to header files.…
> but one throws away the information ... With the mythical smart enough compiler with god like devirtualizer it would be less of an issue but gratuitous use of virtuals annoys me no end. CRTP isn't that hard for the simple use cases but you are beholden to the god of compiler error messages when things go wrong. One great thing that clang has done (among others) is make g++ get their shit together. Contrary to the p…
D 2.069.0 released, compiler automatically ported from C++ to D
31–40 of 131 posts
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#32Daniel Murphy is the man behind getting the sources converted from C++ to D. He wrote a program called "magicport" to do the bulk of it, with some manual tweaking. The back end is still in C++, showing that you can mix D and C++ code :-)
Now all we need is some E to celebrate!
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#33How's the memory-safety model in D without a GC, last time I looked at it, it seemed to me that C++ 11/14 has the better model here and now with the C++ core guidelines, it may be even better.
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#34I'm wondering, is there an advantage of using D over Rust?
Some things D has that Rust doesn't: compiler-checked function purity annotations, higher-kinded types, variadic functions/generics, types parameterised by numbers, compile-time function evaluation, mixins, a fast compiler (the reference DMD compiler), powerful and convenient compile-time reflection (I think technically Rust can do anything D can at compile time, but it requires writing a syntax extension to do so).…
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#35Earlier quoted context omitted.
I guess D feels more like a better C++ and Rust like a better C, but I may be under the wrong impression.
I wish the ObjC was supported for Windows x86 (>= 7) for linking with Gnustep. In any case, congratulations. I wonder if the C++ to D translator could be used in other codebases, like Fltk for example.
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#36 /bin/bash: line 1: 82501 Segmentation fault: 11 ./main
while I try to call a method on a null variable, which is not that friendly to newcomers.Sample code:
import std.stdio;
void main()
{
Greetings g = null;
g.hola();
}Re: D 2.069.0 released, compiler automatically ported from C++ to D
#37Re: D 2.069.0 released, compiler automatically ported from C++ to D
#38Earlier quoted context omitted.
How is the compiler bootstrapped now (i.e. compiled from source without a working D compiler)? Via the gcc D implementation?
Using the previous version write on C++. Like all compilers of other languages did when change to be write on his own language. Or do you think that the first version of C compiler was write on C ?
Niklaus Wirth did write many of his compilers in the original language (kind of).
He would write down on paper the code, using the bootstrap version 0 code style, as it was supposed to be.
Then he would manually translate that code into Assembly.
So when the compiler for the basic language was working, he could use the same code again, without additional efforts and relying on third party languages.
Specially important back in the day where each computer system had its own systems programming language or dialect of an existing one.
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#39How's the memory-safety model in D without a GC, last time I looked at it, it seemed to me that C++ 11/14 has the better model here and now with the C++ core guidelines, it may be even better.
However you can write gc free code regions by marking them as @nogc and the compiler will make sure you only call code that is @nogc compatible.
Additionally, there is some ongoing discussion how to improve the language to depend less on the GC.
The C++ core guidelines are great, and me being a C++ fan even with its warts, welcome them and all the work the C++ community is doing.
However them being opt-in, relying on static analysis and the quality of the code I usually see at companies, which tends to be C with Classes from developers that don't even know what CppCon is, I am not sure how the adoption will be like.
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#40How's the memory-safety model in D without a GC, last time I looked at it, it seemed to me that C++ 11/14 has the better model here and now with the C++ core guidelines, it may be even better.
Could you elaborate? What about the C++ 11/14 model improves memory safety?