News for hackers. Stuff that matters.
Re:Masonry 0.1 (Rust GUI framework) by KRAKRISMOTT on Sunday February 05, 2023 @09:22PM (#34672477)
I want a proper, visual studio style, drag and drop GUI builder.
Re:Masonry 0.1 (Rust GUI framework) by capableweb on Sunday February 05, 2023 @09:30PM (#34672540)
Not at all overkill: Unreal Engine.

On a more serious note, would be interesting to see an app builder inspired by the UI and Blueprint editors of UE but tailored for apps rather than games.

Re:Masonry 0.1 (Rust GUI framework) by cyber_kinetist on Sunday February 05, 2023 @11:09PM (#34673221)
I've heard people using the Godot Engine to make complex UI applications. So I've tried myself writing a simple app (it required multiple windows support which was added in Godot 4 beta), and the experience was really solid. It has its own slot/signal system like Qt but because it's much more well integrated into the language/editor. The node system in Godot is similar to the DOM, and editing layout was much easier than expected. (Compared to Unity's UI system which was built on top of a component system and is more finicky to use because of this. And no and I don't want to talk about UIElements, it's unfinished and unusable in its current state). And most important you don't need to wait for C++/MOC compiler to build, because of the scripting langauge (GDScript) changes can be tested instantaneously.

Unreal Engine might be a bit overkill since it has too many dependencies built in (you don't need a state-of-the-art 3D renderer and physics engine for UI). Godot is much more lightweight than that (about 40~50 MB from my tests, at least better than Electron), but some might still think that's too much though.

Re:Masonry 0.1 (Rust GUI framework) by schaefer on Sunday February 05, 2023 @11:37PM (#34673408)
I’d love to read the code. Any chance either your project is published open source or you can cite a similar open source UI application?
Re:Masonry 0.1 (Rust GUI framework) by cpeterso on Monday February 06, 2023 @12:10AM (#34673608)
The Godot IDE is itself developed in Godot, according to https://medium.com/swlh/what-makes-godot-engine-great-for-ad...
Re:Masonry 0.1 (Rust GUI framework) by forgotpwd16 on Monday February 06, 2023 @07:30AM (#34676381)
Re:Masonry 0.1 (Rust GUI framework) by splix on Sunday February 05, 2023 @09:25PM (#34672495)
Or maybe some Figma plugin/client that generates the code from a UI designed there.
Re:Masonry 0.1 (Rust GUI framework) by pas on Monday February 06, 2023 @04:20AM (#34675187)
uh there are a bunch of those, locofy, teleportHQ, etc.

They are okay-ish, if you know the rules of the target code system/platform. (Ie. if you know React, and so you already create components in the UI builder.)

So basically my big problem is that these UI builders don't force/encourage the conventions that result in nice code.

The potential is there, of course, maybe even throwing a chatGPT-like AI in the loop can help with recognizing what the user wants and emitting and maintaining the resulting code base.

Re:Masonry 0.1 (Rust GUI framework) by rtpg on Sunday February 05, 2023 @10:57PM (#34673160)
I believe Qt Quick is this!

A lot of this stuff is out there, it's just usually requiring things like dealing with C++ or some other language.

Re:Masonry 0.1 (Rust GUI framework) by PoignardAzur on Monday February 06, 2023 @06:04AM (#34675841)
Yeah, Qt Quick is definitely my favorite part of Qt.
Re:Masonry 0.1 (Rust GUI framework) by armchairhacker on Sunday February 05, 2023 @11:10PM (#34673232)
WYSIWYG UI builders are very underrated.

I don't even need it to be interactive: all I want is a UI-oriented DSL with live-preview. Which is why I personally think SlintUI is currently way ahead of the competition.

The author basically suggests a DSL themselves despite this framework's UI being Rust constructs, as they note the importance of fast iteration and then say that because of Rust's slow compile times it's probably not the ideal language.

A DSL provides more than fast iteration too. It also encourages good code quality by forcing you to separate the app's UI from the rest of the logic. And complete language control means that a true DSL with its own syntax will always be more readable than anything you can embed in Rust's.

Re:Masonry 0.1 (Rust GUI framework) by PaulDavisThe1st on Sunday February 05, 2023 @11:26PM (#34673338)
> It also encourages good code quality by forcing you to separate the app's UI from the rest of the logic.

This concept of separation is always interesting to me.

In the 1990s, when MVC was first conceptualized, a GUI was (a) native (b) playing the dual role of both View and Controller. It is quite hard (not impossible, but hard) to separate the app's UI from "the rest of the logic".

Consider trivial interactions (i.e. the Controller side of the UI element) like drags. What does a drag do? How do you conceptualize limits on the motion? How do you convey semantics between the Model and the Controller? How do you handle the differences between clicks (essentially drags with no movement) and actual drags? How does the Controller handle both axes? Gestures? etc.

Remember: the UI is the thing that receives input events from <somewhere, and in its capacity as the Controller, alters the Model state, which in turn causes changes in the appearance of the UI (as the View). This then creates additional issues if changes to the Model state are expensive (i.e. the Model contains/controls heavyweight resources), and thus Controller interaction must first work on a "pseudo-model" which is also represented by the View aspect of the UI, until the interaction is complete, at which time, the Controller propagates the actual change(s) into the "real" Model.

Yes, quite a bit of this has been revised/extended/expanded (e.g. Microsoft's View-Model concept), but the basic issues remain, and make the kind of separation you're thinking about hard to do in practice for all but basic data presentation applications.

Re:Masonry 0.1 (Rust GUI framework) by KRAKRISMOTT on Sunday February 05, 2023 @11:58PM (#34673528)
We are back to two-way data bindings if you see frameworks like Svelte and Solid
Re:Masonry 0.1 (Rust GUI framework) by PaulDavisThe1st on Monday February 06, 2023 @12:20AM (#34673673)
Most webdev stuff that I've seen completely fuzzes the distinction between View and Controller, or changes it into something quite different from the original concept in MVC.
Re:Masonry 0.1 (Rust GUI framework) by lmm on Monday February 06, 2023 @12:52AM (#34673866)
The original concept was never very clear, or at least never very clearly communicated.
Re:Masonry 0.1 (Rust GUI framework) by PaulDavisThe1st on Monday February 06, 2023 @01:33AM (#34674080)
I used to work downstairs from one of the UW CS&E faculty who helped push MVC, and I would disagree quite harshly.

The problem, such as it is, is that the original examples they tended to use involved systems where the View and Controller were physically separate systems. Consider a medical scan data viewer with (a) a screen (b) a series of controllers to manipulate what appears on the screen.

In this context, all 3 of MVC are clearly identifiable and easy to talk about and understand.

But as it got applied to GUIs where there are no distinct physical controllers and all the interaction occurs intimately tied to the View (i.e. what's on the screen), it is harder to find the boundaries between the V and C parts (and to some extent even the M).

Re:Masonry 0.1 (Rust GUI framework) by dcow on Monday February 06, 2023 @01:01AM (#34673916)
Try xcode and swiftui.
Re:Masonry 0.1 (Rust GUI framework) by sticksmite on Monday February 06, 2023 @12:30AM (#34673735)
Could SceneBuilder (Gluon) be adapted?
Re:Masonry 0.1 (Rust GUI framework) by darthrupert on Monday February 06, 2023 @02:02AM (#34674228)
Yes! It's incredible how many steps backwards the UX world has taken in the last 20 years, and all we've got from it is some shaky sort of platform independence.
Re:Masonry 0.1 (Rust GUI framework) by reflexco on Monday February 06, 2023 @02:33AM (#34674431)
Shaky? Full-blown professional tools like Figma running almost flawlessly on 5 different operating systems is not shaky. We've never had a better developer story before.
Re:Masonry 0.1 (Rust GUI framework) by mlindner on Monday February 06, 2023 @04:54AM (#34675410)
Question... What happened with Interface Builder on Mac OS X? What made it not successful and why did it end up falling out of popularity? That was one of the features that was championed when Mac OS X was just starting and it was going to be the future of all GUI development on OS X. (Honestly GUIs have gone steadily downhill on OS X for quite some time as it's being overtaken by GUIs that look like they're designed for the iPhone.)
Re:Masonry 0.1 (Rust GUI framework) by interactivecode on Monday February 06, 2023 @07:28AM (#34676369)
With swiftui previews you can press the + plus icon in the top right and get the drag and drop component builder[0]. On the right side bar you also get a bunch of ui builder options that will generate code for you. [1]

[0] https://imgur.com/BUm1MOt

[1] https://imgur.com/BX7G7Ys