Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On 10/21/18 7:36 AM, Andre Pany wrote: While talking about bindings, do not forget Delphi. It has still a good eco system. Combining Delphi's advanced Runtime reflection capabilities with D's advanced compile reflection capabilities opens this eco system. I created a proof of concept and the results were really promising. Using Delphi components is very easy and the wrapper code on D side is very thin. Even clicking together a Firemonkey ui in Delphi and writing all code in D works fine. Delphi is available for windows, Mac os, Android and IPhone. Linux support is somehow planned. It is free for personal use. See an example here https://github.com/andre2007/delta-fmx-10-2-1/blob/master/examples/gui1/source/app.d Due to very limited time resources I have no time to work on this specific topic at the moment but everyone is free to use these base research results. Side remark: Lazarus (free pascal) is planning to add the same advanced Runtime reflection capabilities as Delphi. Interesting, thanks for the info. I'm somewhat ashamed to say I didn't know Delphi was still around! For those younger programmers out there, Delphi is a Pascal-based system that was key in popularizing what we used to call "RAD" tools ("Rapid Application Development") such as Visual Basic, and the modern GUI-builder tools they've evolved (or devolved?) into. I have to admit, I've somehow managed to write code all the way from the late 1980's through today without ever learning or writing any Pascal. But I do know Delphi was very respectable back in the day (with a somewhat Basic-like, but more capable, syntax), so it's nice to know it's still around and even supports modern mobile, which is really kinda cool.
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On Sun, 2018-10-21 at 12:54 +0200, Jacob Carlborg via Digitalmars-d wrote: > […] > As has been stated elsewhere, it's working on Windows and macOS but > looks very alien on macOS. When I was in school I wrote a program > using > C# (Mono) and GTK on macOS. GTK seemed to be the best alternative > (for > using with Mono) back then. During the development of that program a > beta or alpha version of GTK was released with support for a native > main > menu on macOS, the rest was non-native. Not sure how it looks like > now. I tried GTK+ on OSX (*) a few weeks back using all the stuff from Homebrew. It started an X server, so definitely not native GUI framework. At least not directly. (*) El Capitan. Apple in its infinite wisdom has decided my MBP is too old to have any OS more recent than that. -- Russel. === Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Roadm: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk signature.asc Description: This is a digitally signed message part
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On Saturday, 20 October 2018 at 16:37:07 UTC, Atila Neves wrote: I've also realised that there are parts of C++ that are probably unstranslatable no matter what I do. This can be solved with good gui. It need to look like meld on linux where original cpp and translated d files are side by side and parts of untranslatable code visibly marked so the user can translate it by hand.
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On Sunday, 21 October 2018 at 01:32:22 UTC, Nick Sabalausky (Abscissa) wrote: On 10/20/18 6:28 AM, Gregor Mückl wrote: Even though web and mobile UIs seem to be the rage at the moment, I believe a solid support for desktop UIs is very important for a general purpose language, if it wants to be successful in the market. I think that may be doubly true in the case of D, given D's focus on efficiency. HTML-based interfaces (whether web or app) are notoriously rife with inefficiencies: That's likely to be a major turn-off for exactly the very same audiences that D would appeal to most. While talking about bindings, do not forget Delphi. It has still a good eco system. Combining Delphi's advanced Runtime reflection capabilities with D's advanced compile reflection capabilities opens this eco system. I created a proof of concept and the results were really promising. Using Delphi components is very easy and the wrapper code on D side is very thin. Even clicking together a Firemonkey ui in Delphi and writing all code in D works fine. Delphi is available for windows, Mac os, Android and IPhone. Linux support is somehow planned. It is free for personal use. See an example here https://github.com/andre2007/delta-fmx-10-2-1/blob/master/examples/gui1/source/app.d Due to very limited time resources I have no time to work on this specific topic at the moment but everyone is free to use these base research results. Side remark: Lazarus (free pascal) is planning to add the same advanced Runtime reflection capabilities as Delphi. Kind regards Andre
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On 2018-10-20 11:25, Russel Winder wrote: GtkD works very well for me. But I guess GTK+ has a reputation of not working on Windows and macOS. Once a reputation is established it is nigh on impossible to refute. As has been stated elsewhere, it's working on Windows and macOS but looks very alien on macOS. When I was in school I wrote a program using C# (Mono) and GTK on macOS. GTK seemed to be the best alternative (for using with Mono) back then. During the development of that program a beta or alpha version of GTK was released with support for a native main menu on macOS, the rest was non-native. Not sure how it looks like now. -- /Jacob Carlborg
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On 2018-10-21 03:25, Nick Sabalausky (Abscissa) wrote: What about DWT? It seemed pretty good from what I could tell, though I still haven't ventured into D GUIs just yet myself. Are there issues people have with DWT? Or WxD? DWT is currently stuck at SWT version 3.4 and no macOS version is available yet. I'm working on a tool that will automatically port the Java code that will hopefully fix this. -- /Jacob Carlborg
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On Sat, 2018-10-20 at 16:37 +, Atila Neves via Digitalmars-d wrote: > […] > > It turns out that translating C++ is *hard*. Partly because the > language is huge and complicated, but also partly because > libclang isn't all it's cracked up to be. But... dpp is probably > a few full work days away from being to #include . > Hopefully with the translation actually working. This I can believe, but isn't the D-side problem only to be able to link to C++ libraries. Given previous emails this morning, clearly my current thoughts are creating D bindings for Qt and wxWidgets. > […] > > * std::is_reference is untranslatable: there are no reference > types in D. It's likely to get used with SFINAE, and while that > is translatable by hand, I have no idea how I'd write an > algorithm to figure out SFINAE when it happens and translate that > to template constraints in D. From what I hear at ACCU conferences, most C++ programmers can't handle SFINAE properly. -- Russel. === Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Roadm: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk signature.asc Description: This is a digitally signed message part
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On 10/20/18 6:28 AM, Gregor Mückl wrote: Even though web and mobile UIs seem to be the rage at the moment, I believe a solid support for desktop UIs is very important for a general purpose language, if it wants to be successful in the market. I think that may be doubly true in the case of D, given D's focus on efficiency. HTML-based interfaces (whether web or app) are notoriously rife with inefficiencies: That's likely to be a major turn-off for exactly the very same audiences that D would appeal to most.
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On 10/20/18 5:25 AM, Russel Winder wrote: On Sat, 2018-10-20 at 08:52 +, Gregor Mückl via Digitalmars-d wrote: […] I periodically look at how I can make use of D for small projects. Most often, I shy away because I want to build a GUI and none of the libraries that I can find look mature and well maintained enough to put my faith in. For C++ there's Qt, which is *phenomenally* good (despite some warts), but there's been at least half a dozen attempts at creating D bindings for that, all in various states of completion/negligence. GtkD works very well for me. But I guess GTK+ has a reputation of not working on Windows and macOS. And KDE. I've heard a lot of very good things about GtkD, and honestly, I have no doubts about any of it. Unfortunately though, the main problem with GtkD is simply GTK itself :( D has always had an excellent story in the "connect to C linkage libraries", has any of the work in D on C++ linkage over the last few years changed the landscape so that a D binding for Qt and QML could be as good as the GtkD binding is to GTK+? I really hope so! No idea personally though :( What about DWT? It seemed pretty good from what I could tell, though I still haven't ventured into D GUIs just yet myself. Are there issues people have with DWT? Or WxD?
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On Saturday, 20 October 2018 at 22:19:48 UTC, 12345swordy wrote: On Saturday, 20 October 2018 at 16:37:07 UTC, Atila Neves wrote: On Saturday, 20 October 2018 at 10:28:47 UTC, Gregor Mückl wrote: [...] It turns out that translating C++ is *hard*. Partly because the language is huge and complicated, but also partly because libclang isn't all it's cracked up to be. But... dpp is probably a few full work days away from being to #include . Hopefully with the translation actually working. [...] There this pull request https://github.com/dlang/dmd/pull/8787 but apparently Manu is burn out from working on it I don't want to judge, but I need to point out that we have managed to make this discussion progress from outward-facing marketing to technical difficulties and related pull requests. This is not bad, but it is also a perfect example of how inward-facing the community can be and that is a part of what started this thread.
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On Saturday, 20 October 2018 at 16:37:07 UTC, Atila Neves wrote: On Saturday, 20 October 2018 at 10:28:47 UTC, Gregor Mückl wrote: [...] It turns out that translating C++ is *hard*. Partly because the language is huge and complicated, but also partly because libclang isn't all it's cracked up to be. But... dpp is probably a few full work days away from being to #include . Hopefully with the translation actually working. [...] There this pull request https://github.com/dlang/dmd/pull/8787 but apparently Manu is burn out from working on it.
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On Saturday, 20 October 2018 at 10:28:47 UTC, Gregor Mückl wrote: On Saturday, 20 October 2018 at 09:25:58 UTC, Russel Winder wrote: On Sat, 2018-10-20 at 08:52 +, Gregor Mückl via Digitalmars-d wrote: […] I periodically look at how I can make use of D for small projects. Most often, I shy away because I want to build a GUI and none of the libraries that I can find look mature and well maintained enough to put my faith in. For C++ there's Qt, which is *phenomenally* good (despite some warts), but there's been at least half a dozen attempts at creating D bindings for that, all in various states of completion/negligence. GtkD works very well for me. But I guess GTK+ has a reputation of not working on Windows and macOS. Once a reputation is established it is nigh on impossible to refute. Gtk is clearly working on Windows from a technical point of view. Gimp on Windows is proof of that. But the look and feel are too different from what Windows users expect in my eyes and I did have a few unpleasant experiences with Gtk in the past. So I personally do not have any real desire to use it. My encounters with Qt were more involved and generally very pleasant and successful. I want to stress that this is only my personal view that I arrived at over the years. Any bias in it is purely mine. Qt appears to be C++ battering ram against all other languages other than Python. Go has failed to get a really good binding, except perhaps to QML. D has failed to get a really good binding to Qt or QML. I guess I should check out the Rust binding, except that I am in the gtk-rs and gstreamer-rs camp these days on all things GUI. Qt did have very good bindings to Java in the form of Qt Jambi, which was commercially developed back in the day by (then) Trolltech. Unfortunately for me, they killed that product off just as it reached 1.0. But a lot of the generator code was reused for PySide which was started around that time. Qt really depends on the code generated by the moc preprocessor. Even though the generated code is not really all that complicated, filling in the same gaps in bindings for other languages is quite hard. I think that Python has such good bindings only because both PyQt and PySide were commercially backed from the start. I can't think of any other currently maintained language bindings that have that luxury. Even though web and mobile UIs seem to be the rage at the moment, I believe a solid support for desktop UIs is very important for a general purpose language, if it wants to be successful in the market. D could be well suited for various kinds of applications in that area, especially those that have complex logic with some really performance critical parts and require rich user interfaces. Productivity, CAD, DCC and data processing/visualization would probably be among the extreme categories here. D has always had an excellent story in the "connect to C linkage libraries", has any of the work in D on C++ linkage over the last few years changed the landscape so that a D binding for Qt and QML could be as good as the GtkD binding is to GTK+? […] Excellent question! All I know is that Binderoo and dpp are two WIP projects that want to make binding to C++ easier. The authors are active in the forum, aren't they? It turns out that translating C++ is *hard*. Partly because the language is huge and complicated, but also partly because libclang isn't all it's cracked up to be. But... dpp is probably a few full work days away from being to #include . Hopefully with the translation actually working. The namespace hack Walter suggested doesn't work in practice, but now that extern(C++, "ns") is a thing I just need to massively refactor the code and use that instead. I've also realised that there are parts of C++ that are probably unstranslatable no matter what I do. Hopefully a pragmatic "you can #include but you can't use std::is_reference from "* approach will let us call enough of C++ in practice. Right now I'm blacklisting several things in ... Atila * std::is_reference is untranslatable: there are no reference types in D. It's likely to get used with SFINAE, and while that is translatable by hand, I have no idea how I'd write an algorithm to figure out SFINAE when it happens and translate that to template constraints in D.
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On Saturday, 20 October 2018 at 09:25:58 UTC, Russel Winder wrote: On Sat, 2018-10-20 at 08:52 +, Gregor Mückl via Digitalmars-d wrote: […] I periodically look at how I can make use of D for small projects. Most often, I shy away because I want to build a GUI and none of the libraries that I can find look mature and well maintained enough to put my faith in. For C++ there's Qt, which is *phenomenally* good (despite some warts), but there's been at least half a dozen attempts at creating D bindings for that, all in various states of completion/negligence. GtkD works very well for me. But I guess GTK+ has a reputation of not working on Windows and macOS. Once a reputation is established it is nigh on impossible to refute. Last time I tried to use GTK on windows I had to build i from source myself, from the looks of it that hasn't changed. It has a huge dependency list, and some of those dependencies have their own dependencies. They all have to be built their own different way on Windows. It's a pain in the ass to do, i tried and didn't bother after trying to compile cairo or whatever. Kind of odd they don't have any sort of build script, I guess they just use Mingw which not very many people use. It may work on Windows, but the amount of effort to set it up is not worth it at all. The developers of the library obviously don't care enough either to try to reduce that barrier. Why not provide a built shared library? Something tells me they haven't even bothered to compile it with MSVC themselves. Their guide to build with MSVC links to a 3+ year old Gnome article where someone not even affiliated with GTK wrote a powershell script to build it with MSVC. The other links to an article that is still using VS 2010 and 2008 for the build. I mean it *may* work, but that isn't the problem if the developers completely lack support for the platform. I can download Qt with prebuilt libraries and it works out of the box with MSVC. There's an obvious difference between the two developers support. As someone else said GTK look like ass on Windows, Qt is really the only crossplatform GUI API written in a native-compile-able language out there that gets most things right.
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On Saturday, 20 October 2018 at 09:25:58 UTC, Russel Winder wrote: On Sat, 2018-10-20 at 08:52 +, Gregor Mückl via Digitalmars-d wrote: […] I periodically look at how I can make use of D for small projects. Most often, I shy away because I want to build a GUI and none of the libraries that I can find look mature and well maintained enough to put my faith in. For C++ there's Qt, which is *phenomenally* good (despite some warts), but there's been at least half a dozen attempts at creating D bindings for that, all in various states of completion/negligence. GtkD works very well for me. But I guess GTK+ has a reputation of not working on Windows and macOS. Once a reputation is established it is nigh on impossible to refute. Gtk is clearly working on Windows from a technical point of view. Gimp on Windows is proof of that. But the look and feel are too different from what Windows users expect in my eyes and I did have a few unpleasant experiences with Gtk in the past. So I personally do not have any real desire to use it. My encounters with Qt were more involved and generally very pleasant and successful. I want to stress that this is only my personal view that I arrived at over the years. Any bias in it is purely mine. Qt appears to be C++ battering ram against all other languages other than Python. Go has failed to get a really good binding, except perhaps to QML. D has failed to get a really good binding to Qt or QML. I guess I should check out the Rust binding, except that I am in the gtk-rs and gstreamer-rs camp these days on all things GUI. Qt did have very good bindings to Java in the form of Qt Jambi, which was commercially developed back in the day by (then) Trolltech. Unfortunately for me, they killed that product off just as it reached 1.0. But a lot of the generator code was reused for PySide which was started around that time. Qt really depends on the code generated by the moc preprocessor. Even though the generated code is not really all that complicated, filling in the same gaps in bindings for other languages is quite hard. I think that Python has such good bindings only because both PyQt and PySide were commercially backed from the start. I can't think of any other currently maintained language bindings that have that luxury. Even though web and mobile UIs seem to be the rage at the moment, I believe a solid support for desktop UIs is very important for a general purpose language, if it wants to be successful in the market. D could be well suited for various kinds of applications in that area, especially those that have complex logic with some really performance critical parts and require rich user interfaces. Productivity, CAD, DCC and data processing/visualization would probably be among the extreme categories here. D has always had an excellent story in the "connect to C linkage libraries", has any of the work in D on C++ linkage over the last few years changed the landscape so that a D binding for Qt and QML could be as good as the GtkD binding is to GTK+? […] Excellent question! All I know is that Binderoo and dpp are two WIP projects that want to make binding to C++ easier. The authors are active in the forum, aren't they?
Re: D Binding to GUI libraries [was Interesting Observation from JAXLondon]
On Sat, 2018-10-20 at 08:52 +, Gregor Mückl via Digitalmars-d wrote: > […] > I periodically look at how I can make use of D for small > projects. Most often, I shy away because I want to build a GUI > and none of the libraries that I can find look mature and well > maintained enough to put my faith in. For C++ there's Qt, which > is *phenomenally* good (despite some warts), but there's been at > least half a dozen attempts at creating D bindings for that, all > in various states of completion/negligence. GtkD works very well for me. But I guess GTK+ has a reputation of not working on Windows and macOS. Once a reputation is established it is nigh on impossible to refute. Qt appears to be C++ battering ram against all other languages other than Python. Go has failed to get a really good binding, except perhaps to QML. D has failed to get a really good binding to Qt or QML. I guess I should check out the Rust binding, except that I am in the gtk-rs and gstreamer-rs camp these days on all things GUI. D has always had an excellent story in the "connect to C linkage libraries", has any of the work in D on C++ linkage over the last few years changed the landscape so that a D binding for Qt and QML could be as good as the GtkD binding is to GTK+? […] -- Russel. === Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Roadm: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk signature.asc Description: This is a digitally signed message part