vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.67k stars 2.15k forks source link

Declarative UI: Swift/Dart vs Qt/QML approach #2065

Closed medvednikov closed 4 years ago

medvednikov commented 4 years ago

Hi,

Update

V UI has been released, V itself is used for declarations.

I'm working on declarative UI right now.

Which approach do you think is the best: Swift/Dart (using the same language for declarations) or Qt/QML (using a smaller cleaner different language)?

It's nice to have only one language, but the "VML" approach looks cleaner to me.

Also, I'd need to modify V a lot, for example to allow things like [TextBox{}, Button{}].

iampato commented 4 years ago

Declarative UI is the way to go but this is my special request deal with state management in "this" framework because dart failed on that

dumblob commented 4 years ago

@medvednikov thanks for letting me know - I'm totally out of time and thus can't dedicate any time to V since the end of September and probably during the next few weeks/months. I think imgui is a decent choice for V, so I'm glad you did it :wink:.

If you want to contact me, just ping me explicitly using @dumblob syntax so that I'll know it's high-priority and I'll try to answer as soon as possible (yeah, I'm primarily thinking about parallelism in V).

da7a90 commented 4 years ago

the Dart/Flutter approach is better but it can be improved by maybe adding more computability

akrymski commented 4 years ago

I'd like to point out another option - building an alternative to Electron. If you're willing to sacrifice the idea of a platform-native look and feel (which frankly is an outdated concept these days) then I would suggest looking at using HTML & CSS to implement a GUI lib.

Implementing an HTML rendering engine in V has a number of advantages:

It may not be as difficult as it seems, there are a few other Russians working on this: https://github.com/lexborisov/Modest https://github.com/litehtml/litehtml

Remember the goal wouldn't be to support all possible websites, but rather the latest HTML & CSS standards (eg flexbox alone is probably enough for layout).

This is somewhat similar conceptually to what React Native is doing. A web browser implements only the most basic components natively, and frankly besides the TextBox everything else can be easily implemented in HTML/CSS. As long as V has access to the DOM then web designers will be able to build great looking interfaces with ease.

shaxxx commented 4 years ago

Stand on the shoulders of Giants. I believe Flutter/Dart kind of aproach is the way to go. Would be nice to actually utilize Flutter engine to render controls. If you really want to have more cobtrol you can always use Skia engine directly.

manhnt9 commented 4 years ago

Was about to comment on Flutter and I saw @shaxxx did. I would write my next cross-platform desktop GUI app with Flutter. Please target V's UI library to web more, it's hard to compete with other desktop GUIs and we're still lack of fast and easy to use, responsive WebUI. I'd love to have a faster ReactJS-like framework for Web.

lygstate commented 4 years ago

@akrymski How small it would be

nedpals commented 4 years ago

@cristian-ilies-vasile Can you state the relation of Kai Krause and this issue?

medvednikov commented 4 years ago

V UI has been released, V itself is used for declarations.