title: What enables SwiftUI's DSL?
body: <p>It seems like Apple's new <code>SwiftUI</code> framework uses a <strong>new kind of syntax</strong> that effectively builds a tuple, but has another syntax:</p>
  
  <pre><code>var body: some View {
      VStack(alignment: .leading) {
          Text("Hello, World") // No comma, no separator ?!
          Text("Hello World!")
      }
  }
  </code></pre>
  
  <p><strong>Trying to tackle down what this syntax really is</strong>, I found out that the <code>VStack</code> initializer used here takes a closure of the type <code>() -&gt; Content</code>
  as the second parameter, where <code>Content</code> is a generic param conforming to <code>View</code> that is inferred via the closure. To find out what type <code>Content</code> is inferred to, I changed the code slightly, maintaining its functionality:</p>
  
  <pre><code>var body: some View {
      let test = VStack(alignment: .leading) {
          Text("Hello, World")
          Text("Hello World!")
      }
  
      return test
  }
  </code></pre>
  
  <p>With this, <code>test</code> reveals itself to be of type <code>VStack&lt;TupleView&lt;(Text, Text)&gt;&gt;</code>, meaning that <code>Content</code> is of type <code>TupleView&lt;Text, Text&gt;</code>. Looking up <code>TupleView</code>, I found it's a wrapper type originating from <code>SwiftUI</code> itself that can only be initialized by passing the tuple it should wrap.</p>
  
  <p><strong>Question</strong></p>
  
  <p>Now I'm wondering how in the world the two <code>Text</code> instances in this example are converted to a <code>TupleView&lt;(Text, Text)&gt;</code>. Is this hacked into <code>SwiftUI</code> and therefore <strong>invalid regular Swift syntax?</strong> <code>TupleView</code> being a <code>SwiftUI</code> type supports this assumption. Or is this <strong>valid Swift syntax?</strong> If yes, how can one <strong>use it outside <code>SwiftUI</code>?</strong></p>