3 ms·
has swift made the leap to server side yet? i keep hearing mumblings about that.
by swyx 8y ago
has swift made the leap to server side yet? i keep hearing mumblings about that.
- dep_b 8y agoVapor apparently gets favorable reviews by those who drank the Kool-Aid: https://vapor.codes/ https://vapor.codes/ Never tried it though. I don't select stacks primarily based on programming language.
- willio58 8y agoI’ve used it for a few sites at this point. Haven’t used v3 but it’s been a great resource. It’s a cool experience coding a website with a compiled language, especially swift.
- abalone 8y agoVapor looks like the best so far but it's still early days. In theory it has the potential to be extremely fast and memory efficient, but for example they only just got a couple TechEmpower benchmarks up a couple days ago and they ranked very low (#162 on the json test).[1] It goes without saying simplistic benchmarks like this are flawed but at the same time, you have to start somewhere. [1] https://www.techempower.com/benchmarks/#section=data-r16&hw=ph&test=json https://www.techempower.com/benchmarks/#section=data-r16&hw=...
- dep_b 8y agoJSON performance is super important for a server, far more than for the usual macOS or iOS clients. JSON parsing might be based on the basic JSON parser found in Swift, which isn't fast at all, rather easy to use and secure instead. It's not super up-to-date but you can see there's definitely some competition even on Swift level in terms of JSON performance. https://github.com/bwhiteley/JSONShootout https://github.com/bwhiteley/JSONShootout Swift JSON encoding/decoding should approach C/C++ levels of performance when optimized for speed.
- abalone 8y agoThe plaintext benchmark was also slow, so the JSON implementation may not be the main cause here.
- thanatos_dem 8y agoIn addition to Vapor which other commenters have mentioned, Apple itself released Swift-NIO, a port of Netty to Swift that they’re actively developing - https://github.com/apple/swift-nio https://github.com/apple/swift-nio It’s somewhat lower-level than web frameworks people may be used to coming from a Ruby/Node background, but it’s pretty powerful.
- wsc981 8y agoThere's the Perfect [0] library that I recently used to develop a real-time multiplayer TicTacToe proof of concept for iOS. I used the Perfect web socket functionality on the server. Worked out well enough. --- [0]: https://perfect.org https://perfect.org