News for hackers. Stuff that matters.
Re:Minimum Viable Declarative GUI in C++ by jcelerier on Wednesday March 23, 2022 @06:57AM (#30777125)
Not really an interface in the OOP term, just trying to define the concepts, which are much more open-ended.
Re:Minimum Viable Declarative GUI in C++ by smaudet on Wednesday March 23, 2022 @12:32PM (#30780247)
I find it telling you need to distinguish - I do think interface has come to mean closer to "contract".
Re:Minimum Viable Declarative GUI in C++ by UncleEntity on Wednesday March 23, 2022 @09:18AM (#30778139)
So you have to write a library that can parse struct definitions?

Like a DSL but without the “domain specific” part?

I mean, umm… dunno?

Re:Minimum Viable Declarative GUI in C++ by krapp on Wednesday March 23, 2022 @09:27AM (#30778231)
Step two: code the rest of the fucking owl.
Re:Minimum Viable Declarative GUI in C++ by jcelerier on Wednesday March 23, 2022 @09:39AM (#30778320)
you don't have to: the code compiles and is valid C++ as-is without issues, unlike when you are using a normal library, say Qt, JUCE or similar.

Each user can then choose what they want to do with it. For instance, the same code can be put on some embedded chip without any UI processing and will be able to be plugged to hardware pretty easily by writing a few lines of simple glue code.

Re:Minimum Viable Declarative GUI in C++ by UncleEntity on Wednesday March 23, 2022 @10:30AM (#30778800)
Ah, I think I understand now — basically what you’re describing is a schema for defining UI code as a tree of c++ structs.

…which, honestly, horrifies me.

I remember for a time I was adding drag and drop to various parts of blender (Ton went on his yearly vacation and this is what he brought back) and every little change required a rebuild to test which wasn’t the quickest on my little netbook. Mind you there was zero documentation and I was pretty deep in the innerds so there was a lot of trial and error involved. I literally spent most of the time waiting on the compiler because, well, I’m not the best coder out there.

Working on the UI code was a dream in comparison — edit code, reload python module, see changes, rinse and repeat.

Re:Minimum Viable Declarative GUI in C++ by jcelerier on Wednesday March 23, 2022 @10:38AM (#30778880)
> Ah, I think I understand now — basically what you’re describing is a schema for defining UI code as a tree of c++ structs.

yes :-)

> I literally spent most of the time waiting on the compiler

well, it being a tree of plain structs without 200kloc of header files to parse also means that it's possible to implement very fast live-recompilation, like this: https://youtu.be/fMQvsqTDm3k?t=87