6 ms·
When Can I Code Swift on the Server?
- oddevan 12y agoI wouldn't necessarily say "never." The author says Apple has no interest in open source projects, but there is precedent with WebKit and the LLVM project. So while no one should hold their breath waiting for Apple to open source Swift's standard library and LLVM components, I wouldn't be surprised to see it happen (and wait for the inevitable Rails-like framework to sprout up. "Bullet Train" anyone?).
- pjmlp 12y agoWhich were already open source before Apple got involved.
- fred_durst 12y agoIs it possible you could give some examples of projects that were created in house at Apple that were open sourced?
- m0nastic 12y agoI would never claim that Apple is a fervent open source company, but here are a bunch of their open source projects: http://www.macosforge.org/ http://www.macosforge.org/
- aroch 12y agoClang comes to mind. You can see all their opensource stuffs on the Apple website https://opensource.apple.com/ https://opensource.apple.com/
- mikeash 12y agoClang, CoreFoundation (or rather, the CFLite subset of it), the xnu kernel, libdispatch/GCD, their Objective-C runtime, launchd, libauto (Objective-C garbage collector), mDNS/Rendezvous/Bonjour/Zeroconf, stand out as examples. Apple is definitely not afraid of closed source when it suits them (no source code available for most system APIs or bundled apps) but they also have a fairly extensive open source portfolio.
- _djo_ 12y agoOff the top of my head, clang, launchd, libdispatch, Bonjour (Rendezvous) and the ARM64 backend for LLVM.
- fuddle 12y agoSwift on the client-side and Scala on the server-side would make for a great combination.
- LinaLauneBaer 12y agoI am one of the guys behind Objective-Cloud. We will support Swift sooner than later.
- stuaxo 12y agoWow, that is interesting .. not something I will use, but interesting tech nonetheless.
- mentos 12y agoI think you guys are in a great position now to implement a server/client solution in Swift. Effectively re-create Parse in Swift but I imagine CloudKit may have these aspirations? Any comments on what sort of competition the CloudKit brings to the BaaS table?
- trurl 12y agoWebObjects used to be highly regarded. I would assume that given the Objective-C origins, Swift could use it as well?
- m0nastic 12y agoWebObjects hasn't been related to Objective-C for a while (It was rewritten in Java in 2001). While WebObjects is still apparently being used by Apple's Online store and presumably some other internal applications, I wouldn't expect any serious WebObjects integration for Swift from Apple.
- drivingmenuts 12y agoProbably when Apple has a server product that requires it?
- artificialidiot 12y agoHold my beer as I put the finishing touches on my Swift-to-node.js compiler...
- roberthahn 12y agoWow, the OP loves jumping to conclusions. I've seen on HN a couple of threads where people claim that Apple employees say they, at a minimum, need to clean up the codebase first before open sourcing the language. While I don't know if that's true, I'm prepared to wait until Apple, not this guy, says that Swift will or will not be open sourced. Just because it's not open source now doesn't mean it'll never be. Then they point out that there are 3rd party HTTP libraries, and completely ignore the possibility that maybe Swift might be just the thing to catalyze the creation of a new one. To be sure, unless you're serving from an OS X based server, it'll be hard to deploy Swift-based apps until significant supporting infrastructure has been built. But I don't see any real evidence that "never" is the answer to "When Can I Code Swift on the Server?"
- koblas 12y agoSounds like an interesting case that somebody should just start a project to add swift as a frontend to GCC - maybe a kick starter project for a grad student. GCC has support for all of the language constructs that are present in swift.
- blktiger 12y agoSwift is built on LLVM which can compile to many targets such as Linux and Windows. I'm not sure I see any reason to add Swift to GCC.
- Arjuna 12y agoOn the topic of Swift's openness, it appears to be somewhat ambiguous at this time; that is, the door is neither entirely open or closed. For example, in response to general questions on this topic, Chris Lattner responded: "We don't have anything to say about that at this point [...]" http://article.gmane.org/gmane.comp.compilers.clang.user/493 http://article.gmane.org/gmane.comp.compilers.clang.user/493 And... "Right now we are focused on finishing it up for the final release this fall." https://twitter.com/clattner_llvm/status/473907124288770050 https://twitter.com/clattner_llvm/status/473907124288770050
- mikeash 12y agoI'd give about 95% odds that Swift will be open sourced relatively soon. That's just how Apple works at this level. They kept WebKit open source. They adopted LLVM and kept their contributions open when they could have easily made a closed fork. They built and open sourced clang even though there was nothing requiring them to. But another aspect of how Apple works is that they love secrecy and hate making promises. They built an ARM64 backend for LLVM in private, and the first time anyone found out it existed was when they announced the iPhone 5S with an ARM64 CPU. They still ended up releasing the source code. Right now, even the Swift compiler binary isn't publicly available. You have to have a paid developer membership to obtain it. They wouldn't open the source at this stage regardless. They most likely will, but they also most likely won't commit to anything until the initial public release.
- eli 12y agoI thought they were compelled to open source WebKit since it was based on LGPL code?
- mikeash 12y agoIt looks like that applies to WebCore and JavaScriptCore but not WebKit, since that's built on top of the LGPL parts as a separate entity. From Wikipedia, "WebKit's JavaScriptCore and WebCore components are available under the GNU Lesser General Public License, while the rest of WebKit is available under a BSD-style license."
- justin_vanw 12y agoIf only we had Yet Another Dynamic Scripting Language (YADSL) that we could use to write web frameworks! Because there are only like 17 with full ecosystems and tools and libraries to talk to every existing database engine, yadayadayada. What we really need is another one so that we can spend our time poking at a new language instead of building useful things! Swift would be an especially good one, since it doesn't have anything new to offer (unlike Clojure or Scala or Rust or Go) and it has great interoperability with Objective C (which Apple abandoned for server side programming in like 2005) AND it doesn't run on anything other than OSX, which is awesome because Apple discontinued Xserve over 10 years ago (EDIT: Xserve discontinued a few years ago), and there are basically no hosting providers of any kind. We could spend literally tens of person years building up all that stuff instead of using the massive infrastructure already in place!
- matthewmacleod 12y agoWhat parts of Swift (a compiled, statically-typed language) make it YADSL?
- justin_vanw 12y ago"Compiled" is a pretty tricky thing, even Python and Ruby are "compiled". How about "Yet Another Syntax Without Any Interesting Semantics, With a Bonus of Being Proprietary" (YASWAISWBBP)
- reubenmorais 12y ago>Without Any Interesting Semantics You don't use a drill because of how interesting it is that the shape of the drill bit combined with its rotation lift material out of the hole. You do it because it works, and is efficient. A programming language is a tool, not a toy.
- justin_vanw 12y agoThat's literally my entire point, stated in the form of disagreement. Why would you use a new tool that has no support and no clear advantage or distinguishing features, when there are a dozen with fully fleshed out ecosystems?
- matthewmacleod 12y agoApple’s desire to provide open source products (none) This trope drives me nuts. Go here: http://www.opensource.apple.com http://www.opensource.apple.com You'll find a bunch of open-source projects that Apple has contributed code to (LLVM, WebKit, CUPS), as well as a bunch that they wrote and released (launchd, clang). They've recently released their ARM64 backend for LLVM. I will be surprised—extremely so—if Apple choose not to open-source Swift. It has no downsides for them, and it's obvious that many people will simply refuse to get involved with it if they don't.
- tptacek 12y agoApple hasn't so much contributed to LLVM and Webkit as fundamentally enabled them, right? Chris Lattner is an engineering lead at Apple, for instance. I agree with your prediction about Swift being open sourced. Among other things: as nice as Swift might be, its #1 value proposition is "easy to build iOS applications in", so the more people using it the bigger the developer base for iOS becomes. I can't see the downside to opening it. That doesn't, however, mean they'll open it up on HN's preferred schedule.
- mantrax5 12y agoApple is contributing heavily to LLVM and making the code open source. One easily visible example is Clang, a c/c++/obj-c compiler for LLVM, which is open-source and pretty much created and maintained by Apple: http://llvm.org/devmtg/2007-05/09-Naroff-CFE.pdf http://llvm.org/devmtg/2007-05/09-Naroff-CFE.pdf
- chc 12y agoLattner created LLVM before joining Apple. Apple hired him for LLVM.
- tptacek 12y ago... and then massively invested in LLVM.
- 12y ago
- gkya 12y agoIf some solution for Swift-on-the-server came out, it'll probably have to be OS X-only; as, as far as I know Swift is OS X* only. Such a dependency on OS X is not feasible, as OS X adds dependency to Apple hardware, rendering the platform infinitely expensive and unportable. I reckon that it would be the best bet for Apple to open source Swift, as it would allow a much more lively community and a much bigger set of libraries around the language. They need not open-source the OS X-specific libraries, but a closed source Swift will not succeed to survive in any area other than OS X/iOS GUI development. * ... and iOS.
- oscargrouch 12y agoSwift is a LLVM frontend, as long it does compiles source code to the LLVM-IR, all of the LLVM "ecosystem" in the backend applies here.. so its pretty much multiplatform by now, since LLVM compiles to virtually all platforms and OS's.. Only Apple specific Api's wouldnt be available.. but even this.. there are always obj-c clones here and there for the apis.. So once they release the source for the Swift frontend, the possibilities for the Swift code are endless
- chc 12y agoThe Swift standard library is Cocoa. Swift might be able to compile for all platforms through LLVM, but without the runtime and standard library, what use is the compiled code?
- cwisecarver 12y agoRight after they launch their 64 CPU, 256 core ARM64 X-serves.
- mark_l_watson 12y agoTwo things: 1. You could write an OS X application for your back end services, and use a OS X hosting company (there are some) or use a mac mini, etc. in a colo rack. But, you would not have a rich server side software tools infrastructure like JBoss, Tomcat, Yesod, etc. 2. use another language like Haskell, Java, etc. on the server.