Sorry - but sending a bunch of static bytes through a TCP socket without even reading something from the input is not even a basic HTTP implementation.
I think this opens up the possibilities for Swift to be used as a web language, not just a iOS language. I have to say, Swift syntax is very similar to PHP 7. Interesting times for sure. I'll be keeping a close eye on Swift in terms of its adoption as a web language.
Unrelated, but is this a common practice in Swift?<p><pre><code> #if os(Linux)
import Glibc
#else
import Darwin.C
#endif
</code></pre>
Feels a bit nasty.
Interesting to see if an Express like framework comes about. Does it even make sense to write a backend http RESTful API in Swift? Wonder what the performance is vs node.js and go?
I don't think Swift is a very good choice for the web - we already have much better options. Swift compiler don't care about memory leaks, runtime errors and race conditions. And it's really easy to get runtime error - just unwrap optional value without check.<p>So I think Swift is good for something what can run few minutes and be restarted easily in case of failure - mobile and desktop apps. Not web server daemons.
Aeon is an HTTP server written in Swift that has an API that looks like Sinatra. <a href="https://github.com/Zewo/Aeon" rel="nofollow">https://github.com/Zewo/Aeon</a>