Reading through the syntax changes they made makes me really appreciate the decisions made around JSX and how that works, syntactically. It's just javascript , and none of these weird constructs need to be added into some DSL to support it. There's the reasonably minimal html-ish syntax, then "escape to javascript" to add in conditionals or loops or whatever. I wonder if there was (or still is) a way to do something…
It’s hard to claim that JSX is more “just JavaScript” than SwiftUI. If anything I’d say it’s the opposite. Swift evolved the language hand in hand with SwiftUI so everything you see is standard there. And in my humble opinion they did a knockout job. And this is coming from someone whose spent a ton of time evangelizing React. SwiftUI is far more beautiful, pleasant to write, and well thought out. It does have a coup…
Yeah, that's fair. What I saw was that SwiftUI added special constructs to this DSL for if and ForEach statements, something which just isn't needed in JSX because it 'escapes' to JS fairly well.
Definitely think they did a pretty decent job of it - I couldn't have done better (and I can't judge whether a better job could have been done, I know next to nothing about Swift, hence my initial question), but it does strike me as unfortunate that they needed to specially re-create basic language features.