Why do you continue to use D?
Russel Winder
russel at winder.org.uk
Sat Jun 6 08:50:51 UTC 2020
On Fri, 2020-06-05 at 10:22 +0000, Cogitri via Digitalmars-d wrote:
[…]
> Same for me, writing in D is just so much more fun and quicker
> than writing it in Rust (at least for GTK applications since the
> GTK concept doesn't really map well onto Rust). Most advantages
> of Rust are kind of moot when using GTK anyway since that means
> refcounting all the things and trusting upon the D GC to handle
> the refcounting works really well for that. I do have to admit
> that I miss how infrequent SIGSEGVs are with Rust (read: somewhat
> impossible unless you have bad bindings/C libs), but since I
> don't have to manually manage memory in D too often it's not too
> bad in D either and in return I save loads of time while coding
> due to the capabilities I have in D that Rust takes away from me.
> Also, static-if and static-for rocks and at least in the way I
> use it doesn't cause my compilation times to easily go into the
> minutes for small programs (right, Rust? :)
I get the feeling that there is a bit of a fight going on between the C++,
Rust, Python, and Vala camps as to what is the replacement for C for GTK+ – it
has been going on since C++ created a binding and Vala was created, but I
think GTK+ 4 is reopening things obviously.
For so many Python is a non-starter, and yet it gets used for so much stuff.
Interesting.
Clearly there are people saying C is the one true language that shall never be
replaced, which is fine for them but not for me.
Vala has a following but is just a bit too niche to get real traction, but
maybe I am wrong.
C++ had lost the race till C++11, but didn't really get moving after that
except amongst the C++ lovers. C++20 may change that, but maybe not.
Rust is being seen as the replacement for C for application developers and a
lot of effort is going into it.
Of course D is the "happy place" between C++, Vala, and Rust. (And Python?) It
has inheritance of classes so beats Rust, It is less niche so beats Vala. (It
is static and not dynamic so beats Python?) Whilst a big language D is simpler
and easier than C++ so beats C++.
GTK+ does all it's own garbage collection of GTK+ objects, so none of the D GC
gets used there. This provides ammunition for the GC haters to say Rust (and
C++?) is better that D. Obviously they are wrong but as the saying goes
"haters going to hate". Python has it's own GC and no-one treats that as a
downside of using Python for GTK+ work. Clearly then D having a GC means just
the same as Python having a GC: managing memory is the last of your worries as
an application programmer.
Regarding SIGSEGV, I get none from Rust, some from D, but most from the C
libraries all my stuff gets build on. This is just going to be a problem until
all the libraries get written in Rust, D, or Go.
The big problem for me staying with D for GTK+ stuff, and I may just be
repeating myself here, is that whilst D has GtkD, rust had gtk-rs, and Python
is dynamic. The issue here is that GtkD is a pure automated translated
binding, whereas gtk-rs is an automated translated binding with added extras.
gtk-rs is just that little bit more Rust-y that GtkD is D-y. But most
importantly gtk-rs has a lot more support for asynchronous working using event
loops. D has the tools, but compared to the Rust tools, D is just a little bit
more clunky, enough to get irritating. Irritation leads to fear and thence
"Fear Leads to Anger. Anger Leads to Hate. Hate Leads to Suffering". Or
something like that.
So for pure GTK+ stuff D is great, so why hasn't it wiped Vala off the map? I
guess because Vala is a GTK+ home grown offering, and very few GTK+ folk look
outside the C++, Rust, Vala, C, Python, bubble.
Clearly the problem is resource. C, C++, Python and Rust have it, D and Vala
don't. And that is the problem at the end of the day, Rust and Python support
for GTK+ working evolves as people complain and use it, D support does not. :-
(
PS Thanks to Mike Wey for all he does with GtkD, I just there were ways of
getting more people working on it.
PPS Thanks to Samael for all he does with IntelliJ-DLanguage, I just wish
there were ways of getting more people working on it.
--
Russel.
===========================================
Dr Russel Winder t: +44 20 7585 2200
41 Buckmaster Road m: +44 7770 465 077
London SW11 1EN, UK w: www.russel.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20200606/936306ea/attachment.sig>
More information about the Digitalmars-d
mailing list