I've been learning Swift lately, and I have to say I've *really* come to enjoy it. Sure, it has it's problems, but I feel like you always can find a solution to them, and I just really appreciate the sheer pragmatism.

Also: result builders are my favorite way to define UIs that I've ever used. It *actually* feels like a programming language that takes UI programming seriously and is willing to prioritize making UI programming ergonomic!

#swiftlang #programming

@torb result builders?

@RosaCtrl Result-builders let's you very easily make embedded DSLs (so still Swift code). They excel at nested datastructures (which UIs typically are).

So for instance, with a Swift result builder created for HTM you could do something like:
ul {
for post in posts {
li {
a(.href("/posts/\(post.id)") { post.title }
}
}
}

So it's declarative, but it still feels like native Swift.
In some ways I consider it a better and more constrained
take on Kotlin's lambda's with receivers (which is also a cool language feature).

@torb ah! The thing SwiftUI is build upon! I forgot it even existed! Never had the need to build my own DSL, but I’ll keep it in mind! Thanks!
@RosaCtrl I haven't built my own DSL, I'm using ElementaryUI for my static site generator.