4 ms·
Have 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 ta
by bsaul 8y ago
Have 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.
- millstone 8y agoSurely the question of using Kotlin is dominated by whether or not you can tolerate the JVM.
- singularity2001 8y agoyou can compile to native with kotlin-native but compilation times are even more abysmal than the jvm kotlin.
- izacus 8y agoWhat difference does that make?
- pjmlp 8y agoSwift is quite good for developers on Apple platforms, but isn't unique in language features nor tooling. F#, Ocaml and Haskell come to mind.
- dep_b 8y agoSwift has a nice mix of features that allows you to write pretty close to functional while also allowing you to write code that compiles to the same code as equivalent C (albeit a bit more verbose). I don't think there are any languages out there outside of Rust (which has it's own niche since Swift is ARC and Rust is more or less manual) that does the same. F# should get a bit more love by Microsoft.
- pjmlp 8y agoARC is just a GC implementation algorithm with a couple of compiler optimizations to reduce counting operations. Plenty of GC books describe such algorithms, including the canonical "The Garbage Collection Handbook". All the languages I referred do compile to native code as well. So you can also check the generated Assembly, just like with C. They also do provide ways of doing C pointer style tricks, use value type allocations or manual memory management. Then there is ATS and ML Kit as well. As language greek I do like Swift, but it isn't really meaningful outside Apple's ecosystem.
- bsaul 8y agoI honestly never understood why F# has never managed to get more popular. Ocaml style type system with .Net lib support would have make it an absolute killer language if it were really advocated by MS, but they probably thought the language was too different from C style to be really mainstream... Or are there any other reason, more technical ?
- DennisP 8y agoI haven't done .Net for a couple years but Microsoft never really supported F#. It wasn't a full-fledged citizen in their web frameworks; you could include compiled modules that you made with F# but couldn't use it the way you use VB or C#. And you'd think a functional language would be great for data transformations in SSIS, but same deal there, just VB or C#. Microsoft always positioned it as "use F# for the hard stuff and C# for the rest." The trouble is that C# isn't that bad for the hard stuff, and if you're spending most of your time with C#, then for you it's probably better than F#.
- yxhuvud 8y agoHave you looked at Crystal? It has a lot of the same strengths you note that swift has, but with stronger Linux support and a more rubylike expressibilty and stdlib.