9 ms·
Now, with swift 3 around the corner, I will ask some most experience fellow developers the following question. There is golang, swift, rust, dlang. If you will
by claudiug 10y ago
Now, with swift 3 around the corner, I will ask some most experience fellow developers the following question.
There is golang, swift, rust, dlang. If you will put some energy, what language will be, and why? :)
- AlexeyBrin 10y agoThe answer is obvious: Swift if you target iOS. Otherwise, use what is best for you.
- pbnjay 10y agoSwift for GUIs on OSX / iOS. Go for everything else. Haven't had much reason to play with Rust or D, but also haven't seen nearly as much of them in the wild...
- coldtea 10y agoGo for everything else? Swift is moving for everything too, with the cross platform support, IBM adoption, etc...
- geodel 10y agoCross platform is not yet there Swift 3. I don't know what to make of IBM adoption of Swift, maybe Websphere Business Component are still a thing and a Swift version might enthrall enterprise users. IBM is already bringing Go on s and z series and writing software in Go like full blockchain implementation.
- pbnjay 10y agoCross platform isn't there yet though. I'll definitely give it more thought, especially if it does cross-platform GUIs (something Go does not have good libraries for). That said, Go's tooling, documentation, and ecosystem are much friendlier than Swift's. And since most of us spend more time doing that stuff than actually typing code, it's an important point for me in the comparison.
- pjmlp 10y agoSwift, most likely. Go I don't like the design, but I will always suggest it to anyone wanting a simple safe C like language. D, the community is great, but they still need to decide which direction the language is supposed to grow. Rust community and language are great, but I think they need to get into an OS SDK to really accomplish the goal of replacing C++. Swift is replacing C and Objective-C as the official systems language on Apple platforms. It has the necessary tooling for full stack applications, IBM is already pushing it on their cloud services and Microsoft will eventually support it on their iOS bridge. So in what concerns OS vendor support I am betting on Swift. For the use cases where that isn't relevant, I would say Rust is also a very good candidate.
- swsieber 10y agoCould you expand on an OS SDK in relation to Rust?
- pjmlp 10y agoIf you look at the history of computing, since the early 60's, there were tons of system programming languages. But the ones that kept surviving between OS generations were the ones being sold by the OS / hardware vendors for their systems, not the ones being sold by third party software companies. You just need to compare the tooling offered for the programming languages that are part of an OS SDK, with the platform support for other programming languages not part of the SDK. Bringing an external systems programming language means additional development effort, spent in wrapping OS libraries, integration with debugging tools, compiler toolchains. Hence why many companies are willing only to work with programming languages that have first class support on the platforms they are targeting. However, there are also some companies for which such issues don't matter. So if there is a big number of such companies, eventually an OS vendor does pay attention and adds such a language into their offerings.
- thawkins 10y agoThere are also rumors that Google may be looking at using Swift as an alternative interface to android, that sounds a bit nutty, given that they have golang. But.... 1) go is not a suitable candidate for android, as most of the api's are object orientated and involve subclassing sdk classes, which would be awkward and painfull on golang, but not so hard on swift. 2) they would pick up a bunch of companies and devs that are currently building high quality apps for iOS, if swift does succeed in abstracting the foundation classes and provide a reasonable abstraction of the UI classes, it would open up the potential of a universal "app" language, for Mac, Linux, android and iOS. This may be wishful thinking, but it's worth pushing a few Braincells in that direction.
- eridius 10y agoSwift if you're targeting iOS or OS X and either need GUI or integration with system frameworks, Rust otherwise.
- Scarbutt 10y agoIn the long run, Swift, IMO. It has all the advantages of Go but with a more expressive language, much better C interop and a platform that will create a community around it very quickly, the other day I saw somewhere that there are already more Swift books and courses than Go. Swift will also let you do everything Rust can, very low level stuff.
- nardi 10y ago> Swift will also let you do everything Rust can, very low level stuff. Not quite. Swift requires a runtime, so you probably won't see people writing OS kernels in Swift.
- 31reasons 10y agoSwift uses LLVM as backend, so as far as I understand it can generate standalone binaries. No ?
- kibwen 10y agoGenerating standalone binaries is orthogonal to the presence of a runtime. Go also generates standalone binaries (even more standalone than Rust and Swift) though it indisputably has a runtime.
- grayrest 10y agoAll languages add a bit of code to a binary to make the code you write runnable. Rust [1] and C add almost none, language like Swift and Go have to add their GC support code even if it's in the same binary, and jit+scripting languages generally come with an external runtime. [1] https://www.rust-lang.org/faq.html#does-rust-have-a-runtime https://www.rust-lang.org/faq.html#does-rust-have-a-runtime (also mentions what's in the C runtime)
- autoreleasepool 10y agoSwift doesn't have a GC and you can use it to program like C with malloc and free via UnsafeMutablePointer<T>. IIRC, Swift's runtime is like C++'s with v-table lookup for dispatch on functions that do not involve Objective-C objects.
- joeblau 10y agoI've only used Golang and Swift fairly extensively with a cursory use of Rust. I'm also extremely biased because I'm an iOS engineer, so I'm going to advocate Swift. I really love Golang's concurrency model and the way the dependency system is implemented. It just seems like the Swift team is making more progress at a faster pace right now. The tools surrounding swift like the REPL are also extremely useful for education, documentation and examples.
- grayrest 10y agoI've been putting time into Rust. There will always be a need for a C-level language and I think Rust has a strong long-term future. The language as it exists today isn't going to be my all-purpose default but it might be. There are a couple major ergonomic wins coming (trait-based exception handling, impl trait) and a set of first-party language services for IDE support. I think IDE-supported Rust has the potential to be a very productive language, particularly since it's okay without IDE support. Since this is a Swift thread, I will say that I like Swift except for the parts that are clearly there to interact with Objective C. I have no interest in doing apple os interface development but I'll be seeing how it goes as a server development language when the 3.0 preview happens in June. If Rust for all things doesn't work, core Rust + Swift scripting is the planned fallback.
- kibwen 10y ago> trait-based exception handling I'm obligated to mention that Rust isn't growing an exceptions system, that RFC was just poorly named. :P
- yarrel 10y agoD isn't going to happen. Go is a wonderfully boring language. That's its technical strength and social downfall. Rust is the anti-Go. It's an adoption cult with a good language attached. Swift is pleasantly surprising me with its evolution and cross-platform direction. I'd recommend Rust, Swift or Go in that order. Personally I'm most interested in Go but I don't think it's the most useful intellectual exercise or career move to learn it at the moment.
- claudiug 10y agocan you give more details why dlang is not a good bet. I actually like the language and feature set :) I have the feeling that is to much noise on dlang, and they do not have a clear path, but still :)
- coldtea 10y agoMostly because it's been going on for a decade, and while itself is not catching (much adoptions), other languages that have appeared since have already gotten much more traction, including Go and Swift -- and potentially Rust.
- gcr 10y agoThat could be a function of the marketing rather than the language.
- ori_b 10y agoI've been using D in production at work. I can't say that it'll never happen, but it's up against some very strong competition, and given its age, I'm not optimistic about it catching up. D has been going for a long time, and still needs a decent more work before I'd call it mature. Its garbage collector still has global locks around every allocation and scan. On top of that, I've had memory leaks where it turned out that some anonymous closure just wasn't being released by the garbage collector. The fix for that memory leak was giving the anonymous closure a name to eliminate the environment capture. For that matter, the tooling around things like taking heap snapshots and profiling is rather painful -- there are no good runtime tracing solutions, and the memory profiler built into the GC breaks down allocations by type, and not by allocation site, which is generally not all that useful. Valgrind dies when I try to debug invalid memory use in C code bound to D. Symbols in the local stack frame are spotty in gdb. And, in general, debugging support could stand to be much better. The threading library (std.concurrency) can't send objects between threads without lots of lying to the type system to make things happy: You can't send shared references by default (we've hacked around this at work, still need to upstream the patch), and you can't send unshared references unless they're immutable. Sounds ok from a safety perspective until you realize that D is built around mutable objects, and there's no way to declare a value class. There are lots of things to like about D, but I would be very antsy about using D for a system that I had to rely on in any critical capacity, as things stand. At least, not without a willingness to commit to changing the libraries and runtime. I haven't used Go, Swift, or Rust in production enough to have an opinion on them and their production readiness.
- zzzcpan 10y agoNeither one of them is worth putting your energy into. But Go and after that Swift are important for better employment opportunities somewhere down the road.
- matt_m 10y agoMight be worth considering C# here too. The open-source cross platform tooling is new and still immature, but it's getting serious resources lately, with new language features (including more null safety) coming, cross platform IDE from Jetbrains in development, Mac / Windows / Linux / Android / iOS support, good concurrency features for server side development, JIT and AOT compilers + runtime, development mostly on github etc. They seem to be serious about making a first class cross platform language, I wouldn't be surprised if it displaces Java some in a few years.
- rubber_duck 10y agoAnd F#/other .NET languages. As for displacing Java - this is never going to happen - I prefer .NET but soo many companies have invested man-milenias probably in to Java deveopment - it might losr popularity, especially with Oracle at the helm.
- matt_m 10y agoSure, I agree Java isn't going anywhere, I just meant it might grow some at Java's expense since it has some of the same strengths (and while the ecosystem might not be up there with Java it's surely competitive with some of the other languages used for backend development).
- protomyth 10y agoLooking at it, and who is backing it and what support they have, I think Swift has a pretty good shot at being an "it" language for a while. Let's face it, Swift is the iOS programming language and it looks like IBM is putting some effort into porting it. Now, historically IBM and Apple are a bit hit and miss (with a lot more misses), but I think they will succeed with this one. I do wonder if IBM is getting a bit nervous about Java these days. If Swift had its own Rails or meant for a container deployment framework then things would be a lot clearer. This does not come from a Swift fanatic as I view Swift as my next Transact-SQL. A language I will do work in and become very proficient, but I'm not loving it.
- jug 10y agoI like Go. The language is sane and small, the standard library is great, and the tooling is nice, the community is getting quite large. It's a bit too high level for me to call it a C successor, but I get similar joy from coding in it as I do with C. It's just so clean and neat, and I still get native code, and with no dependencies either. Pretty great. Go is so good thanks to the sum of all its properties. I think it will be around for a long time. I'm not too much into Rust, but sure, if you absolutely cannot have even a low latency garbage collector involved or do very low level work like drivers, I guess it is useful. As soon as I don't, I feel like the pragmatic nature of Go is very appealing. I wonder about Rust's future, where it will be in 5-10 years. I'd prefer Swift more if stuff started happening here as for cross-platform support. I hear the Linux support isn't even quite there yet, and as for Windows, it just recently saw _any_ kind of progress. I feel like it will take a long time until Swift feels like a natural general purpose choice across the largest three operating systems, rather than an iOS / OS X development platform ported to said platforms. But sure, Swift as a language feels modern and just great. Sometimes like a merge of Rust and Go, with the similar focus on safe code of Rust from guards, optionals, seeing the good in immutability, pattern matching. I wish Swift was much more popular and with much better cross-platform support. I have played just very little with D and it has a bit much feature creep and bad traction for my taste (community _does_ matter). It had a chance of becoming more popular before, but I can't really see it anymore with these new languages. They already seem to have overtaken it in popularity, leaving D as a used but very niche language.