6 ms·
OK...stupid question. Why not use Flutter? Even React Native is cross platform. Why are we still using a programming language for a phone app that means we hav
by patientplatypus 8y ago
OK...stupid question.
Why not use Flutter? Even React Native is cross platform. Why are we still using a programming language for a phone app that means we have to write the darn thing twice? Even a RN webview pointing at an IP with code written in whatever-lang is seemingly a better choice.
- Eric_WVGG 8y agowho said anything about phone apps?
- coder543 8y agoSwift is not seriously useful for server-side applications at this point. None of the web frameworks have even remotely great performance, and Swift is compatible with almost nothing on Linux, since Apple has put minimal effort into anything but macOS and iOS... so anything you do would be much more painful than using Go, Rust, or even C# (.net core) on Linux. So, maybe you're just talking about desktop macOS in addition to phone apps?
- favorited 8y ago> None of the web frameworks have even remotely great performance Source for that claim? Vapor has some pretty great benchmarks. https://medium.com/@codevapor/vapor-3-0-0-released-8356fa619a5d#1097 https://medium.com/@codevapor/vapor-3-0-0-released-8356fa619...
- bsaul 8y agoi think the techempowered benchmarks [https://www.techempower.com/benchmarks/ https://www.techempower.com/benchmarks/] don't show a pretty picture for swift-based web framework. But hopefully swift nio will change all that..
- coder543 8y agoIt literally only compares itself to slow, interpreted languages and other, even slower Swift frameworks, with the singular exception of Go, where they're using Gin, which is a rather slow Go framework. Gin is at literally 10% of the performance of the fastest Go framework, as shown here: https://www.techempower.com/benchmarks/#section=data-r16&hw=ph&test=plaintext https://www.techempower.com/benchmarks/#section=data-r16&hw=... So, when you cherry pick benchmarks, it can _look_ kind of fast... but then the unbiased TechEmpower benchmarks show Vapor operating at 20% of the speed of Gin. Which is 2% of the speed of the fastest Go or Rust web framework. "50x faster to pick a different language" != "even remotely great performance."
- merlinsbrain 8y agoI’m not sure this is a great benchmark (detailed in a comment above), but I think it’s undair to criticize a web framework for comparing itself to Django, node/express, Elixir/Phoenix. While dynamic languages, there’s billions of $ running on those frameworks and to present yourself as a fair alternative to those is good enough. (I have no personal interest in Swift on the server, I use Go/echo)
- merlinsbrain 8y ago> We were pleasently surprised to see Vapor coming in first as being asynchronous does not really help with plaintext benchmarks. Plaintext benchmarks are really only good at testing how fast a web framework is capable of parsing and serializing HTTP headers. I did not look if other benchmarks were released but this is probably not the best representative.
- helge5 8y agoSwift on server may not have "great performance", but compared to mainstream stuff it definitely has "pretty good performance" while still providing a somewhat nice language. I guess the key selling point is, well, being able to use Swift on the server (some people do like the language). It is pretty useful for sure. Certainly not the only choice. That Swift is compatible with almost nothing on Linux sounds strange, not sure what you mean by that. E.g. I find it particularly nice for writing Apache modules (the Swift C integration is really neat). P.S.: While Apple puts minimal effort in anything but macOS and iOS, others put significant effort into Swift on Linux. Like IBM.
- bsaul 8y agoHave you ever developped anything serious with swift ? Honestly, this is by far the best language i've developped in (including go, java, c#). Note that i'm talking about the language here. The libs are of various quality. But powerful enums & switch + null safety + generics while retaining the ability to be learned easily by any "regular" developer makes it a category of its own. My secret hope is that someone somewhere is working on a flutter equivalent coded in swift.
- phreack 8y agoThen you ought to try Kotlin! It's a lot like Swift but with great libs and tooling.
- bsaul 8y agoExcept kotlin doesn't have anything close to swift regarding enums + switch (like : enum with associated values of various arity, and a switch that makes sure you're handling all the cases), nor regarding null safety. And, it still has java underneath, which means everytime you're using a java lib, you have absolutely no idea what the null safety is going to be underneath (which is also the case with swift and objc libs, but which diminishes the attractivness of using the java libs ecosystem) EDIT: also, value-based programming is highly encouraged by the full support for structs, either mutable or immutable. That's also a huge plus for safety against race conditions.
- dualscyther 8y agoKotlin has sealed classes (enums), when expressions (switch checking) and absolutely does have null safety. It also reinforces null safety when using Java libraries if they have nullability annotations.
- saagarjha 8y agoKotlin might look like Swift on the surface, but under that they're very different in how they're designed.
- 8y ago
- paulddraper 8y agoSwift compiles natively and runs on iOS, Android, Linux, MacOS, and there is a community project for Windows. Most of the iOS platform libraries are only available in Objective C and Swift. Most of the Android platform libraries are only available in Java (or other JVM languages).
- scarface74 8y agoBecause every cross platform solution is better for the developer but worse for the user. Also when the platform vendor makes changes, you have to wait for the cross platform solution to catch up.