Cross platform GUIs and Nim macros
serv.peterme.net
serv.peterme.net
Contrary to what the linked (more interesting) survey article suggests, Qt is usually the answer to most issues when it comes to cross-platform UI.
Gtk is not bad, but Gtk is what it is: it was created because Qt couldn't be used for licensing concerns (at the time) by people unexperienced with the matter (compared to the Trolltech staff), and is maintained by people who, for the most part, care about Linux. Qt on the other hand is supported commercially, and puts far more effort into supporting more platforms better. [Also the tooling and docs are really nice].
Back when I did Win32 packaging of cross-platform applications, I never liked InnoSetup much, mostly because of the many levels of unpacking into temporary directories, but also because it was relatively slow and not as compact as it could be. Instead, I always preferred NSIS using the makensis command.
Among others, NSIS can be compiled on *nix systems, but still produces a Windows executable file (like a cross compiler), so you can put it in your cross compiling toolchain. That way, you can create your full Windows port including installer without ever having to touch a Windows.
They still could've tried to contribute to LessTif or at least created a new Xt-based toolkit instad of creating yet another overly verbose C OO system...
In fact, Gimp stayed on GTK1 years after everyone else moved to GTK2.
Then I used the BGRABitmap's BGRACanvas as a component to draw the bitmap images (frames of data). To this I added some crosshairs. There is also a chart component that displays the data that makes up our range calculation.
It came to ~5MB executable, one non portable function (I asked Windows the size of the file Octave is writing until it returns the correct value, and I block on it - not bright, but easy to do. I prime the message pump with Application.ProcessMessage in that loop so the user doesn't see the blocking action.
I compressed the executable down to 1.5MB, just to see how far it would go. The project is portable to Linux except for the one function (which will go in an ifdef when I get around to it).
All of this with visual feedback, no make files, and 100% free as in freedom, Borland/Embarcadero can't take it from me, can't "change directions to focus on Enterprise", whatever.
The community is amazing, and answered all of my questions, and many of them really know their shit.
I can't recommend it enough.
My only experience with Pascal has been really old-school Pascal, which is a pointers-and-explicit-allocation language like C; if you want a map of things, you need to build one from scratch, track pointer lifetimes, remember to free stuff explicitly, etc.
Does FreePascal do better?
If you don't want to track pointer lifetimes, you can use interfaced objects, which are reference counted. There are tradeoffs there, but you get to choose them.
The Lazarus IDE is setup out of the box to have debug builds include heaptrc - running your program in debug mode gives you a printout of anything you forgot to free. This is what I've been using.
Do you have a particular example or data structure you're interested in? I'd be glad to help determine if FPC/Lazarus fits your use case.
edit: ...And it produces working GUI applications on *PI boards too (ARM). That's one big step beyond being Linux+Mac+Windows only.
Every Delphi-based app I have used has been a horrible bodge of bugs.
Delphi's pretty good. You should try it out: https://www.embarcadero.com/products/delphi
It's been a while, but I think my main complaint about Delphi was grid-based layouts and the static interfaces it creates. Fast, but usually don't respond well to resizing.
more and more people are talking about it again now - even though most of the current tooling hotness is focused on mobile
maybe something will come out of the .NET Core projects now it's all open source - it feels like that has most potential right now
there is a huge gap in the enterprise software market for a simple cross-platform app framework with intuitive ways to interface to SQL and web APIs - suitable for accounts juniors to build small data apps (instead of bending Excel macros round the problem) but also suitable to build high-function business apps (instead of pretty but barely usable web apps every business I know has on life-support which nobody dare touch)
I'd say that's the target market for Delphi. It's expensive but effective.
Non-native breaks consistency, rendering 'pretty' fairly meaningless.
Not personal but I can't resist: "A foolish consistency is the hobgoblin of little minds." (Emerson)
(Case in point: the very website's scrolling. Works great on desktop Firefox, not obviously distinguishable from any other website. On iOS... a sad joke, made at the user's expense.)
Spotify
Microsoft Office
NetFlix
Chrome
FireFox
...the list goes on. There is no such thing as a standard UI or behaviour at this point.
Any one that owns a mobile device already has to be used to a mixture of UIs every time they switch between devices or specific applications.
Then all the text appears, even without any JS running.
Save the page to disk (Firefox: File->Save Page As).
Then open the saved html file in a text editor and delete all of the <link> tags in the <head> section that reference style sheets and save the changes.
Then open the edited html page from disk, and the result will be printable.
Frankly, this is a non issue. Windows users are used to this. It comes with the territory. Toolkits like GTK and Qt are full featured, densely documented, fast, look good, and work well in any OS.
then I got it -- the ability to use code generation to be declarative is incredible.
having the ability to mix declarative (HTML / data structures) and imperative (javascript) is what makes react so powerful. The ability to do that almost-natively inside the language is amazing.
Rebol & Red are examples of this, there's a GUI dialect called VID [1][2] and in companion with this is a Draw dialect [3][4].
1. http://rebol.com/docs/easy-vid.html
2. https://doc.red-lang.org/en/vid.html
This approach lets you blur the lines between MVC responsibilities. If you wanted to create a widget that had some traditionally 'business-logic' role (like network sync or database interaction) you could do that. I'm not recommending that but there's value in flexibility.
The FB/google share buttons on websites totally break MVC. It's just a button but it has cookie & network traffic.
I hate those buttons, people often argue they 'break the web' because of weird privacy/performance side effects, but developers use them because it's convenient to 'drop in' the platform integrations.
By comparison -- integrating an android app with GMS requires modifying a bunch of files (xml layouts, java source, multiple build dependency files). You can't just 'drop it in'.
So far, you're making your entire UI in code (Like WxWidgets), having to use an app like XamarinStudio to even get fully packaged OSX apps, along with requiring an external framework such as https://github.com/picoe/Eto, (its official package is broken in Xamarin though)
I understand that win forms may not be great when you start to build a bigger application with a lot more presentation and data, but it makes building simple apps easy and convenient. We need something like that cross-platform.
If anyone knows more about re-creating windows form apps cross-platform in a nice manner, I'd appreciate the info.
1 - https://github.com/AvaloniaUI/Avalonia 2 - https://github.com/AvaloniaUI/Avalonia/issues/314#issuecomme...
I tried flicking the page right above the code fragment, but it turns out the scroll hijacking disables iOS's native inertial scrolling, so there's no way for me to read the rest of the article until I get back to my desktop.
I don't see the need for down-votes here: clearly many authors (in absolute terms, if not relative terms) tease their viewers with 30 minutes of reading, only to frustrate them by making the rest of the page inadvertently unreachable. I would think of these kinds of comments as a courtesy to the author.
This was a proposal/prototype/intro video for IUP for iOS & Android for the IUP community.
https://www.youtube.com/watch?v=UvrEfOg3Nyk
Repos:
https://github.com/ewmailing/IupCocoaTouch
C++ and its co conspirator Javascript have done so much to hinder programming development over the past 20 years.
Linux has been round for over and there isn't a decent opensource graphical debugger for Linux that Visual Studio will have to step in some time in the future. All this is soooo depressing.
Nevertheless, this DSL reveals how powerful Nim actually is. It seems many developers have not realized it yet. With Nim they get C performance, seamless C FFI, and a very expressive pythonic syntax. I am using Nim for years now, and it's amazing how productive coding can be.
That's because it doesn't actually do anything...
The right(TM) way to do it is to write a GUI for each platform separately.
OpenGL would be a good candidate for rendering.
I know I'm getting old (in IT terms) and grumpy but I'm unconvinced our current frontend web stack are the right tools for modern web development; albeit it's what we're stuck with. So I'm even less convinced that it's the right stack for "native" desktop applications.
Complaining about electron being bloated now is just like complaining about gtk being bloated back in the 90s.
FLTK's major problem is that it is too much of a C++ system; while wrappers for some languages exist, a lot of the properties that make it desirable in C++ are lost through those wrappers.
I'm honestly not sure what was causing it, but I know that it only happened when the system was swapping a lot. So something that expected something else to be done or take a short amount of time didn't.
For all I know it could be the way FLTK is using Xlib (I don't think it uses XCB yet).
http://www.adacore.com/gtkada/
http://compgroups.net/comp.lang.ada/gtkada-for-macos-x/14082...
Thanks for bringing it to my attention.
tl;dr: there's a great deal to like about it, but its quirks are very quirky.