OpenWL/DL - two foundation libraries for building a cross-platform GUI with non-C++ languages
DanielG
simpletangent at gmail.com
Thu Apr 18 05:39:13 UTC 2019
Well, I have some time on my hands so I guess I'll answer "Why
not write this in D?"
1) The easiest way to access platform-native stuff is to use
platform-native tools (Xcode/Objective-C, Visual Studio/C++/COM,
etc). At a minimum I would have to translate header files, and
rely on D having perfect Objective-C and COM support, or whatever
else some future/exotic platform might require. By doing it this
way, I completely bypass all that extra work, and I can always
utilize the latest platform SDKs with a few simple clicks. "When
in Rome..."
2) I intend to support other platforms where D currently doesn't
exist, which means I would either have to port it myself, or wait
for somebody else to do it. But this way I can go pretty much
anywhere that Cairo/Pango can be built (and someday hope to even
drop the Pango requirement).
3) If I used D, then invariably the GC haters would complain and
refuse to depend upon my libraries purely on superstitious
grounds. And if they aren't using them, they certainly aren't
going to help porting/bugfixing/etc. And I consider it more than
a little likely the D crowd would reject my work if I wrote it
all in pure D, on account of being disappointed in whatever
idiosyncratic API I came up with!
4) D isn't the only language I use, and I want to be able to take
advantage of these libraries anywhere I happen to go in the
future. If I did what Qt did, and build everything at
ground-level in a specific language, then it's no longer
language-agnostic and I would keep having to reinvent the
cross-platform wheel every time I want to change languages. Or
else struggle with trying to create bindings, and we all know how
that goes (how many Qt bindings have been attempted in non-C++
languages, and ultimately abandoned?)
I'm doing this for myself, and while I'm using D for my current
project (which inspired all this), I won't be here forever. But I
will probably always need a GUI wherever I go, and I'm doing my
part to make that available for my future self. I know from
experience, 20 years ago, that writing a GUI from scratch in a
single language / for a single platform (or in this case, for a
platform abstraction) is reasonably realistic for one focused
individual. And with modern languages and tooling? Heavenly.
More information about the Digitalmars-d-announce
mailing list