Autogenerated based on the args, but configurable and the widgets and menus can be defined in JSON.
Idea would be to define UI structure that outputs (and executes) essentially a string (command) to run.
The best language to write a program in is a Turing-complete programming language specially designed for that task, not some cobbled together UI-definition language with ad hoc add-ons to processing.
Like it or not, the whole low code movement is about this.
Let's say your GUI has several input boxes. You want to validate those boxes. You need something Turing-complete to do this, because if it isn't Turing complete and the tool is used by lots of people, someone's GUI will require it.
> the whole low code movement is about this
That's OK provided you accept that it limits what can be done.
And yet, most people wear mass-produced clothes.
Each type of wood is used for aging different spirits. Oak is most common in whiskey and wine making. Sometimes the barrels are even smoked near a fire to impart a unique flavor into the alcohol that will be held in the barrel. A used barrel is very desirable and can go for higher prices on the open market than even a quality new barrel. This price parity is due to the unique flavor that can be impacted by using a used wine barrel for whiskey, used whiskey barrel for wine, or some other unique alternation of barrel contents.
Barrels that are hundreds of years old, and thick with aged bacteria are used for making traditional Japanese soy sauce. These special family heirloom barrels will be used for many generations before they are eventually retired. [4]
[1] https://youtu.be/ccoHCSKMf-E
[2] https://youtu.be/GE7QA1chUzw
I think that's the wrong goal. The goal should be really simple definitions and ok quality apps. Simple JSON (or XML, don't care).
{ control: checkbox, flag: c, label: "Compile" } <section name="Options"><checkbox flag="c" label="Compile" /></section>
It shouldn't be a hassle at all to convert a man page to a UI that speeds up actions and avoids common errors.Anyway, this idea is free, so feel free to take it and do whatever, even full HTML (:
The suggestion was a simplified subset of HTML.
I built a GUI-builder ages ago (in Python, compiling to Python which calls Tkinter to build the GUI). Here's a sample of what the UI-definition language looked like: https://github.com/cabalamat/parrot/blob/master/simple2.par
I'm definitely biased being a web dev but JSON is just so widely used and supported... seems ideal for small bits of config like this.
Yes it could. But writing the UI descriptions would be harder in JSON than in my bespoke language.
My goal in writing the tool was to maker UI descriptions as easy to write as possible. If I hadn't cared about that I wouldn't simply continued to hard-code them in Tkinter.
> I'm definitely biased being a web dev but JSON is just so widely used and supported
JSON didn't exist when I originally wrote this. If i was doing it today, it's entirely possible I would use JSON as a data interchange format.
For example, this:
menu "File" {
menuItem @New "New"
menuItem @Open "Open..."
menuItem @Save "Save"
menuItem @SaveAs "Save as..."
menuItem @Exit "Exit"
}
Might become something like this: {'widget': 'menu', 'text': 'File', 'contents': [
{'widget': 'menuItem', 'id': 'New', 'text': 'New'},
{'widget': 'menuItem', 'id': 'Open', 'text': 'Open...'},
{'widget': 'menuItem', 'id': 'Save', 'text': 'Save'},
{'widget': 'menuItem', 'id': 'SaveAs', 'text': 'Save as...'},
{'widget': 'menuItem', 'id': 'Exit', 'text': 'Exit'}
]
}
Which would turn writing a UI from something that's a pleasure to something that's a chore. People who would deliberately write software that's a chore for others to use ought not IMO be writing software that will be used by other people.What you want for something like a GUI specification is a DSL designed for the task (e.g. QML), or a suitable general purpose language like HCL or YAML.
Except in comparison with XML :-)
I think a better approach is to figure out how to make Electron more performant in the various OSes.
I haven't gotten into the internals of Electron, so I'm not the one to reflect on the approach, but seeing some of the improvements that MSFT made with Edge over Chrome in memory usage gives me hope that this is achievable, even if it doesn't happen immediately.
Back in the 1990's we faced a similar thing, where web "apps" were ugly and slow, and not as powerful as the desktop apps that many corporations had developed in C++ or VB or Delphi. Today of course, the situation is much different, and we use web apps all the time. I really truly believe that Electron (or perhaps a successor - like how VS Code superseded Atom) will not go away, and in the future we will be much happier with it.
And when's the last time you loaded an app with the Java VM on the desktop, unless it was Eclipse and you were about to use it to write more Java?