Ideal D GUI Toolkit

Adam Wilson flyboynw at gmail.com
Mon May 20 12:41:08 PDT 2013


On Mon, 20 May 2013 12:28:16 -0700, Dmitry Olshansky  
<dmitry.olsh at gmail.com> wrote:

> 20-May-2013 22:01, Adam Wilson пишет:
>> On Sun, 19 May 2013 22:25:49 -0700, Tyler Jameson Little
>> <beatgammit at gmail.com> wrote:
>>
>>> I've been looking into trying to fix QtD, but it seems writing a
>>> binding to a C++ library is a bit complicated. I've read on the forums
>>> that a native D GUI toolkit is the most desirable long-term, so I'd
>>> like to start that discussion.
>>>
>>> First off, I've heard of the DWT project, which looks promising, but
>>> it seems like a direct port of Java's SWT instead of a reimagining
>>> using idiomatic D. I understand the allure here (works, little
>>> translation for new developers), but since it's not yet in Phobos, I
>>> can only assume it's still up for discussion.
>>>
>>> Personally, I want these features:
>>>
>>> * simple and extensible
>>>    * minimal components (something like HTMLs feature-set)
>>>    * custom components (embed OpenGL/direct frame buffer)
>>> * "native" window decorations by default, but can provide custom
>>> decorations
>>> * markup (like QML) or programmable (like SWT)
>>>
>>> Nice-to-haves:
>>>
>>> * hardware accelerated (2D OpenGL)
>>> * GUI designer (much easier with QML-esque markup)
>>> * part of Phobos
>>>
>>> I'm willing to lend a hand, but I'd like to know in what direction the
>>> community would like to go. I'd also like to know the likelihood of
>>> getting a GUI toolkit into Phobos.
>>>
>>> Thoughts?
>>
>> So I've been around D a while pushing for native D UI toolkit. And here
>> are a few trends I've seen in the community.
>>
>> * There is a deep-seated distrust of any toolkit that does not use the
>> OS Native UI widgets. The people in this community prefer native
>> toolkits to the point of jihad.
>
> It's just one crazy Nick ;)
>

Well, there are a couple vocal others.

>> Now I am a XAML guy myself, and I saw
>> the light a long time ago, but around here, the majority are still
>> command line gurus.
>
> Markup for GUI layout seems like a decent idea.
>

HTML is markup. XAML is markup. QML is markup. XUL is markup. iOS is  
markup. Android is markup. Realistically, the age of OS native toolkits  
has passed, markup is the future. *shrug* For me it's a practical thing,  
markup is extensible, OS widgets are not.

>> * There is absolutely no chance of inclusion in Phobos, and to-be-honest
>> I don't think it really belongs there.
>
> Where you take that from? I thought it was quite the opposite if written  
> in D. Even C++ guys seem interested in GUIs in std library(!)
>
> [snip]
>

I would LOVE to see it included in Phobos, but making it multi-platform  
places an pretty hard requirement that it not be OS native widgets, some  
OS's have widgets that others don't, some OS's have incompatible UI  
declaration models, for example: WinForms is Win23 API calls where iOS is  
markup. It is workable, but it is even MORE work than building a GPU based  
UI toolkit from scratch. How big is Qt compared to WPF?

>> * Nobody believes that we can do it, you'll hear a lot of moaning about
>> how much work it is. My reply to that is: And Linux is such a piece of
>> cake right? It's only the most widely used kernel on the planet.
>
> If anything D community is full of people doing things close to  
> impossible (esp given the limited spare time and other constraints).
>

Agreed. But as soon as you bring up UI toolkits then it's too much, it's  
impossible, it makes no sense, etc, etc, etc. That's kind of my point, D  
takes the "impossible" and makes is merely difficult.

>>
>> Here's the deal. Building a GUI toolkit, particularly a useful one, is a
>> massive undertaking. WPF is the single largest library in all of .NET.
>> IIRC it weighs in at 40,000 classes. Building a UI toolkit in D will
>> require something that D itself does not. A highly dedicated team of
>> people with many diverse skills. The project is simply too big for a
>> single person.
>
> I sure hope savings in amount of idiomatic D code vs C# idiomatic code  
> OOP code could help here.

You have no idea...

>>
>> Part of the problem with UI toolkits is the number of skills you'll need
>> for the team. Graphics programmers who can make GPU's sing, API
>> designers who can make it easy access, UI designers capable of
>> replicating the looks of each OS. Experts for each targeted OS. And I
>> can think of more.
>
> Well, then you'll also become an expert in a couple of cool fields ;)
> Seriously a few helping hands are sorely needed.
>

Absolutely, but my point is that some of those are entire fields of study  
and bodies of knowledge that can take years or decades a too acquire. It's  
a bit unrealistic for first time GPU coder to write an efficient shader.  
UI design is a whole field unto itself. Etc. My point here is that no one  
person has a realistic shot of being able to acquire and maintain the  
required knowledge single-handedly.

> [snip other good points]
>
>> A UI toolkit in D would be a fantastic showcase for demonstrating just
>> how powerful D is. But make no mistake, it will not be easy getting it
>> done.
>>
>
>


-- 
Adam Wilson
IRC: LightBender
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/


More information about the Digitalmars-d mailing list