3 ms·
Importing the discussion from previous posts on this topic [0]: I hope all new UI systems aim for SwiftUI's syntax. Not to copy Apple, but because you can't re
by Razengan 7y ago
Importing the discussion from previous posts on this topic [0]:
I hope all new UI systems aim for SwiftUI's syntax. Not to copy Apple, but because you can't really get more succinct that this:
ZStack() {
Rectangle()
.foregroundColor(.unicornPuke)
VStack() {
Text("Hello")
Text("World")
}
}
If you can make it nicer and cleaner than that, go for it. The specific constructs for specifying view modifiers and properties could of course be slightly different in each language; for example we could do away with the {}s in Python, or the ()s might be []s. And maybe we could reduce the impression of "magic" that SwiftUI's @State, @Binding etcetera seem to give.
It would just be a model for describing the UI, that a hypothetical engine backend would take to spit out OS-native widgets. For another OS, you'd plug in a different engine.
Having a universally agreed-upon syntax would provide the benefit of "learn once, write anywhere", greatly reducing the friction in building cross platform apps with native APIs.
[0] https://news.ycombinator.com/item?id=21495338 https://news.ycombinator.com/item?id=21495338 - Rust 2020: GUI and Community
- antihero 7y agoWhat if we used JSX? It's got quite a high level of adoption and is pretty readable.
- paulddraper 7y ago> pretty readable Not in a million years would I have guessed JS devs would praise XML for readability.
- antihero 7y agoThere have been many surprises. Microsoft making C# dockerizable, making the best lightweight opensource IDE, and having a literal version of Linux running inside windows, have been some of the big shockers for me. And yeah, I totally hate XML, would still never use it for data or config, but for some reason JSX just kinda feels good.