Not sure what I do wrong every time I try D again, I wanted to see the new backtraces worked but I still get: /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(); }
D 2.069.0 released, compiler automatically ported from C++ to D
41–50 of 131 posts
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#42Not sure what I do wrong every time I try D again, I wanted to see the new backtraces worked but I still get: /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(); }
Did you compile with debug info (-g I think)? It needs to read the DWARF info to get the line numbers.
$ dmd -g main.d && ./main
Segmentation fault: 11
is there anything else I can try?I'm OSX El Capitan 10.11.1
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#43How'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
#44Re: D 2.069.0 released, compiler automatically ported from C++ to D
#45Re: D 2.069.0 released, compiler automatically ported from C++ to D
#46[deleted]
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#47Earlier 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 disagree. D is an improved C that does a lot of the same things as C++, but in order for it to be a better C++, it would need to start with C++ as a foundation and build on it. D has more of a scripting language feel to me.
I'm curious about this, although I don't think this is the first time I've heard D described as having a script-y feel to it. It sounds along the same lines as people describing Go as almost a scripting language, or comparing it to them. Neither Go nor D seem especially dynamic, both have compilers for reference implementations, both look more like C than Python. (To my eyes at least; I've never tried either one. Thus this question.)
Is it primarily the speed of the compilers? Both DMD and g6/g7/g8 boast very fast compiles, and Go uses somewhat script-y tools... but #!/usr/local/bin/tcc -run hasn't changed C's reputation. Fast compiling and memory safety, maybe?
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#48D is a really amazing language that manages to correct the mistakes of c++ but still retain its good parts. it's a shame that it's not more popular.
In addition, the D authors are generally opposed to disciplined approaches, e.g. type classes, region-based memory management, which are being added to C++. Especially regarding the former, while "design by introspection" may have its merits (Andrei Alexandrescu's presentation on allocator is worth watching[2]), I think many still prefer explicit interfaces over implicit ones, so I don't see D take off in the near future, at least until the wanted features are added to the language.
[1] http://forum.dlang.org/thread/htmkdnmlqyvkidkrsmri@forum.dla...
Re: D 2.069.0 released, compiler automatically ported from C++ to D
#49Earlier quoted context omitted.
Did you compile with debug info (-g I think)? It needs to read the DWARF info to get the line numbers.
I think so: $ dmd -g main.d && ./main Segmentation fault: 11 is there anything else I can try? I'm OSX El Capitan 10.11.1
import etc.linux.memoryerror;
shared static this() {
static if (is(typeof(registerMemoryErrorHandler)))
registerMemoryErrorHandler();
}Re: D 2.069.0 released, compiler automatically ported from C++ to D
#50Earlier quoted context omitted.
How would you consider Rust's generics as being part of a better C rather than a better C++?
C translates almost 1:1 to Rust, but when converting C++ to Rust you'll run into impedance mismatch between OO hierarchies and traits, and generics being narrower in functionality than templates. In Rust you still can do "clever" things with generics to make them feel like C++, but the rest of the language is still closer to C: errors returned rather than thrown, no inheritance (but the "flat" OO and enums map well t…
WHATT??? did they do the same mistake as Go?