This is my first post - and I confess I've not used Nim -- but I LIKE what I see: it looks like Python. And I'm aware of the benchmarks showing run speed incredibly close to C. What stops me from getting really excited is that there doesn't appear to be good GUI support, nor any clearly specified roadmap to prioritize that.
I'm specifically looking for a language which will allow me to do C# like enterprise development for the Linux top - bringing together a lot of GUI input/output and a lot of database access. I'm considering Lazarus; it's probably the best currently obvious bet.
But I confess I prefer Python-like clean and readable syntax. And Nim certainly has that!
Forgive me if this is an ignorant question, or if it has been asked and answered, but Lazarus is open source. Has there been any thought of adapting it to self-reflectively work with Nim? Or, if it is just too hard to mix the languages, would it be worth using Lazarus as a model to follow to speed the develop a totally Nim-based Delphi-like IDE?
I could be wrong, of course, but it seems that could be a real game changer for Nim...looks like Python, acts like Delphi, and dominates on Linux.
If this is improbably difficult or there is a better plan I'd like to better understand. Actually, I'd appreciate any clear statement of the roadmap re this possibility -- it will let me know when to come back.
We had example code showing how to import the produced object files into a Lazarus project, this code later got removed as we have to ensure our examples continue to work. ;-) But it's definitely possible to do that but then you have the usual problems of mixing languages: FPC's strings are not Nim's, TStringList is not seq[string] etc.
So a Nim specific solution would be nice and while there are a couple of Nimble UI packages they all seem to lack a UI builder. That is not as bad as it sounds though as Nim focuses on DSLs so usually you get some DSL for building UIs quickly. For this to become more viable incremental compilation and "hot code reloading" are important and these are on our agenda, see https://github.com/nim-lang/RFCs/milestone/1
But the real problem IMO is that desktop UI development has become a niche to the point where it's often cheaper (= more developers know the technology) to develop web applications even if it's just for internal business needs...
Nim-based Delphi-like IDE?
There is https://github.com/ba0f3/uibuilder.nim -- but I am not sure what it really is about and it seems its author has retired.
And you can of course use https://glade.gnome.org/ to build GTK GUI's. I was told that Glade is not that bad, but it has not much documentation. I have a small section explaining how to use the Glade generated XML files in GTK in the gintro readme. Will add one more example soon. You may say that most people do not like GTK -- but that is true for Delphi/Lazarus GUI as well. And GTK can be used on Windows, it is only that most people do not try it at all.
Theres UI Builder. NimQML can use the tools for Qt5 too.
I recently try all the most popular GUI libs on Nimble, they all had updates <1 year, they all work and compile a Hello World or Example GUI provided.
NimX is great is fast and compiles to lots of platforms, has a YAML like DSL, GPU render.
Webview is simple and tiny, just 1 .nim and 1 .h file, GUI with JavaScript ala Electron, you can use Nim target JavaScript for it too, GPU render?, few Kb hello world, no dependencies, no DSL but Nim Frontend has DSL so you can just use that DSL anyways.
NimQML are Qt5 QML native widgets for Nim, uses a C lib, is fast and even takes the desktop themes, GPU render?, 42kb hello world, no DSL but QML is like CSS-ish.
UI Builder already described above.
And theres more on Nimble too. So it seems theres good GUI support. 🤷♀️
Has there been any thought of adapting it to self-reflectively work with Nim?
Well, I had played with this idea a bit. Then I've realized I cant reconcile their exceptions. I had to wrap all inter-calls with expensive try-except blocks or your program will crash at first run-away exception.
Thank you all for the friendly and very encouraging responses. Congratulations,also, to the developers for your recent 1.0 achievement! I expect I would have looked at Nim before now (as all I've ever heard about the effort has been good) but there's typically a huge gap between alpha and 1.0, which most languages never bridge successfully.
I should have a few weeks of free time after the 20th and I will attempt to, at least, get some basic orientation.
So are NimQML and NimX the two safest bets for a noob right now? Native look and feel doesn't matter to me, but an easy process of install and getting a first widget working with Nim are very important. I'll be working on a Mac and on Mint Linux; it looks like those are both covered by package managers -- so that is very encouraging. If I can get to the point where the UI is basically working I'll be very encouraged to redouble my time; for some reason I have a tough time motivating myself through the learning of a new language if I can't get something "real", even if quite humble, working pretty quickly. I tried to learn Haskell once, but 2 weeks in I was still agonizing over the pretty much mandatory libraries...and then I hit the Monad! :-/
Thanks again for the advice!
Holiday Greetings @Araq and all! It's been a year since I created this thread and I was just reading about the release of GTK4 while, notably, it looks like Glade is still stuck at GTK2 with no evidence I could find that they have any energy to take on GTK3...much less GTK4. A sad state of affairs.
But that got me thinking again in terms of strategic breakthrough for a great language like Nim. Araq's interest in the gui topic (2nd entry from top, above), and - in particular - the Linux-based gui / enterprise application development space.
Would anyone here with the necessary Nim chops consider the possibility of developing a GTK4-focussed "Glade-like" (Actually, I don't really care if it is like it or not, I do care that it be of solid quality, highly usable, GUI designer) GTK4 designer in Nim FOR Linux? (Or, at least, for Linux as a primary target - so it not get bogged down in other OS issues).
I know it isn't much, but I would be willing to commit $1000 to incentivize/seed the project IF Araq had, at least, an oversight role (not so he would be further overloaded but so I could feel confident the project would be seen through to a reasonable conclusion and folded into the Nim ecosystem properly).
It seems like a win-win-WIN opportunity, for NIM-LInux-enterprise/foss promotion if it can be pulled off. But timing and quality is everything: The landscape is strewn with abandoned and unpolished GUI projects using, mostly, 2nd or 3rd tier GUI frameworks. The ideal, IMO, would be for the the Nim code to eventually find its way into a "Lazarus/C#-like GUI-designer IDE" (which is where I started with this thread a year ago). I would also be nice if the code, using Nim's DSL capabilities and a clean slate/ fresh look at the future, could be well architected to keep it generally a model for elegant Nim code. But I would start with the more straightforward, closer goal of leapfrogging glade to GTK4.
I'm serious about the donation to seed the start, but I can't lead this project myself. So I thought I would revisit this thread and open it up for feedback from the community.
I know it isn't much, but I would be willing to commit $1000 to incentivize/seed the project IF Araq had, at least, an oversight role (not so he would be further overloaded but so I could feel confident the project would be seen through to a reasonable conclusion and folded into the Nim ecosystem properly).
If volunteers show up, I'm willing to do code reviews.
it looks like Glade is still stuck at GTK2
Of course Glade supports GTK3 since 2011, see
https://en.wikipedia.org/wiki/Glade_Interface_Designer
On 11 June 2015 Glade 3.19.0 was released. It depends at least on GTK+ 3.16.0.
But indeed as Mr. Bassi recently wrote there are no plans to adapt Glade to GTK4.
if you use Windows, here is an idea<https://github.com/khchen/wNim/issues/74> and I have posted a minimal code too.
if fact, this idea works for any GUI lib which supports relative position and size no matter on Windows, Linux, and so on.
the 2 tedious problems now are
The problems of Glade may be true, but saying Glade is still GTK2 is not really fair considering all the work its authors had put into it.
I have never used Glade, and in the GTK4 book I do not recommend using Glade. I still have to add a stronger note that it currently do not work at all with GTK4 without manually tuning the XML files. Personally I do not see much benefit in using XML files in GTK at all, but I know and respect that GTK core authors generally recommend using XML instead of creating GUI elements directly in code.
@steph Let's say you have hundreds of programs and hundreds of displays to do business management.
Galde become important now the builder behavior is very interesting have xml and integrate it into the source then compile
But that doesn't remove the need to write GTK code not everything is resolved with Glade.
Difficult thing as it is on PC I also looked at the Object on GTK I think that's where you have to turn to get there to achieve the designer (this to contain the GTK modeling)
I made a designer for the terminal (all in pure nim) it has not finished but works not bad for the moment I leave it aside I need to take a step back ... I still have to do the grid with placement ect ... and the grid by hand everything works but I need to visualize the thing to finish my code generator (designer)
I think that is, at least, similar to what they are working toward with https://avaloniaui.net/. Unfortunately (perspective I guess) it is for C# and .net and I believe it is only browser based (I may be wrong about that). I'd like to see a fully compiled alternative, especially for Linux. And, as I said at the top, I'd most of all love to see a NIM IDE with WYSIWYG for form design - but that's a further ideal. And I'd like Santa Claus to be real, too.