www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Rust, D, GTK+, and asynchronous working

Hi,

Background: I chose to rewrite a Python/PySide2/Qt application in
X/GTK+. After much dithering I was pushed to Rust/gtk-rs/GTK+ and set
to it. Then I decided to do D/GtkD/GTK+ as well.

Totally unscientific, biased, and indeed prejudiced result is that D is
a nicer programming language to work with than Rust for doing GTK+
related UIs.

BUT=E2=80=A6

Now I have to add the networking.

GTK+ (and therefore both gtk-rs and GtkD) has APIs for all the socket
stuff so as to be harmonious with the Glib/GIO/GTK way of the world.
The Big Question=E2=84=A2 is how to add monitoring a read socket stream in =
the
event loop.

Qt just does it automatically as far as I can tell, but GTK+ appears
not to. Which is totally bizarre.

Rust now has async/await and futures such that you can create something
to put on the GTK+ event loop very easily. It also has very nice tools
for doing "reactive programming" using classic programming constructs
that turn into event loop manangement with futures.

Does D have anything similar or has it missed the "programming with
event loops" boat. Currently I am having a hard time finding ways of
doing what is easy with Rust/gtk-rs/GTK+ using D/GtkD/GTK+ and this is
rather frustrating given how much nicer D is for working with GTK+ than
Rust is.

=20
--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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
Apr 27 2020