9 ms·
Supporting Linux is a surprise, but I think it's a great move on their part. Think: How many iOS apps are frontends to a server API? And how many of those API
by sjackso 11y ago
Supporting Linux is a surprise, but I think it's a great move on their part.
Think: How many iOS apps are frontends to a server API? And how many of those APIs are running on Linux servers? Swift on Linux means ~all the code for a client-server iOS app can be written in the same language.
- lukeh 11y agoBe interesting to see if they support @objc on Linux, the Apple runtime is difficult to support because it requires the dynamic linker to notify libobjc when an image is loaded.
- astrodust 11y agoThe Objective-C support on Linux is already great, the compiler handles it well. The problem is the Foundation library isn't ported so you're left using old, unsupported relics from the OpenSTEP project.
- david-given 11y agoIs Apple's dialect supported, or only the NeXT version? (Which, TBF, has absolutely nothing wrong with it and is a great language; but it's not what people are writing these days.)
- bri3d 11y agoObjective-C 2.0 via Clang and the GNUStep ObjC2 runtime supports blocks, GCD, fast enumeration, declared properties, introspection.
- lukeh 11y agoIt's always just a SMOP, but my hunch is that Swift is way too integrated with the Apple runtime to not use it. I wouldn't be surprised if they have limited support for ObjC in their Swift Linux port, but happy to be proven wrong. (I started porting the Apple runtime to Linux last year but ran into the aforementioned linker issue. A way around it is to change the Apple runtime ABI on Linux of course.)
- gsnedders 11y agoCoreFoundation has a MakefileLinux[1] for versions since 635 (corresponding to 10.7, if I'm not mistaken) — anybody know the status of that? It obviously relies on Clang (as it uses various extensions), but does it build, is it useful? [1]: http://www.opensource.apple.com/source/CF/CF-1151.16/MakefileLinux http://www.opensource.apple.com/source/CF/CF-1151.16/Makefil...
- lukeh 11y agoIt's not all of CF and some of the ObjC glue is missing, particularly in the last few drops. Apportable put most of if back in though.
- biturd 11y agoWhat language is that link written in? It looks like bash sort of but not really?
- stephenr 11y agoIt's a Makefile.. for.. Make.
- notduncansmith 11y agoI feel like this reply could have been much more helpful and less snarky. Some people are still learning - we all were, at one point.
- keeganpoppen 11y agoeveryone is always learning (hopefully) ;D
- 72deluxe 11y agoSome people aren't learning to be helpful or less snarky though.... :-)
- 11y ago
- pjungwir 11y agoI've been wondering for a while now why no one builds an Obj C backend for their apps: https://news.ycombinator.com/item?id=9500855 https://news.ycombinator.com/item?id=9500855 Being able to deploy on Linux might be what it takes!
- themartorana 11y agoIt's exactly because of server support. I'd LOVE to write obj-c on the backend - libgcd and the dispatch syntax alone makes it worthy, not to mention ARC, the ability to write pure C inline (not in an unsafe block or the like).
- lobster_johnson 11y agoI long dreamed of using Objective C to build server apps. The compiler support has been there for years (GCC, later Clang), but there's no standard library. All the stuff you would want from Foundation is missing; strings, sockets, file I/O, encoding support, threads, etc., it turns out you'd have to reimplement a lot from scratch. There's GNUstep, but last I looked it, it was stagnant, and also very much geared towards GUI apps. Swift on the backend would be even better, I think. Between all the languages that have evolved lately (including Go and Rust), Swift has struck me as the one that feels the most like my ideal language.
- alkonaut 11y agoAgree. Feels like a reasonable language to get things done and still readable. Much cleaner in design than Go, and let's not even discuss JS.
- MCRed 11y agoThe best Web development framework of all time was WebObjects, which started at NeXT. It was basically Cocoa for the web. It was wonderful. When Apple bought NeXT they continued it for awhile and ported it to Java to try and make it more cross platform. That didn't really take, as it was a commercial product and despite lowering the price dramatically many times and loosening the licensing restrictions this was the point at which open source solutions like Ruby on Rails, despite being terrible in comparison really started to take off because they were free. There was a great community around WebObjects and it's a shame that Apple didn't open source it in a timely fashion-- they could have changed things quite a bit. It is still used in heavy production- for instance the iTunes store is a WebObjects Application as is, I believe, the App Store.
- aaggarwal 11y agoI agree, with the type of growth Swift has shown in the past, there is going to be a big demand for Swift developers now. Swift could possibly rule the mobile/web. I have already added it on my #TODO list :)
- untog 11y agoI doubt Swift will rule the web. Javascript has yet to be dethroned by any other language coming before it, after all.
- ignorabilis 11y agoIf you ask me, no chance to rule the web. JavaScript has been the standard for a very long time now. Because JS is not a flawless language dozens of js precompilers have been created till now, so the competition is pretty rough. Swift tries to be functional and provides you a way to use immutable data structures, but it is neither functional nor opinionated enough to force immutablity. With that said I personally don't think that it brings something new to the already existing web ecosystem. It sure is a nicer alternative to obj-c though.
- aaggarwal 11y agoWhen I was referring to web, I mainly considered the web-backend on web-servers. JavaScript is the standard for frontend, no doubt.
- dmishe 11y agoSo here's the thing. They will release Apple Music for Android... and there's full stdlib of Swift support for Linux? Could it be that the Android app is partly Swift?
- deleted 11y ago[deleted]
- krschultz 11y agoI wouldn't read too much into that. Android ships with Bionic libc, which is different from the glibc that is usually shipped in a Linux distro. There are definitely some differences between the two. Plus the average Android app is very far from the average Linux app. If they were aiming at supporting Android, I think they would have said that instead of Linux.
- lukeh 11y agoPossibly talking about different things when you say "stdlib"?
- abalone 11y agoThe key word here is "partly" Swift. I would not put it past Apple to use an intermediary framework that hosts a Swift runtime and calls into native Android APIs. That keeps the non-UI logic in one codebase.
- eropple 11y agoThat's more or less what they do with iTunes, isn't it? I recall there being an incomplete library packaged with iTunes once upon a time (with stuff like a stub implementation of Grand Central Dispatch that was neither grand nor dispatching).
- m_mueller 11y ago> stub implementation of Grand Central Dispatch that was neither grand nor dispatching Thanks for the chuckle, almost r/programminghumor worthy ;-)
- mozumder 11y agoApple needs to get the rest of OS X onto the server. They could build their own servers again (unlikely), or at least license OS X Server to Dell/HP/IBM/VMWare/etc..
- Zenst 11y agoI think Apple who did do servers at one time have found the consumer side of things more profitable. That said, they by not doing servers are seemed less hostile in server providing vender partnerships and this I believe would be more profitable for Apple than going into servers. Now with the move of things into just the app bare bones style docker VM's in which the app is a service upon a server then maybe some form of runtime that enables some applications would be useful, maybe. But if they went into the server market, then the trust of doing partnerships with server focused vendors would diminish. Though VMWare would probably be just as happy, if not more and that would be about it. IBM, for the arrangements they have now, work for both of them too well to upset I feel.
- digi_owl 11y agoBack when they did servers they did it for two things, render farms and studio networking. Render farms have largely been supplanted by Linux, and studio networking can either be handled by a Mini on the shelf or a Windows server in the closet.
- Zenst 11y agoVery true and probably more so when Job was somewhat into computer render animation. That and attention to a good working audio driver setup and API's have helped keep Apple still in the audio DAW industry. AS you say much has changed and can see why they shifted focus. Though I do as many wish they at least had a server flavour, more so given would not be much to change I feel as to what is already there. But exposure to a consumer messing up and a sever messing up can be vastly different in support/costs to make sure 100% right and less customers. Still they do like consumerising things and who knows, personal home iCloud that sits in your home would perhaps be a likely server offering if any they may take as targeting consumers. That if any route is maybe the one that could happen.
- alkonaut 11y agoIt's great news. Hopefully there will be a node-like ecosystem for writing small services on Linux soon. With F#, Swift and C# available, hopefully the proliferation of Javascript can be slowed on the server (without people running to Go).
- eatonphil 11y agoJust curious, why do you say that (about Go)?
- alkonaut 11y agoIt feels much too pragmatic for my taste. Exactly the kind of thing to come out of Google, to solve their type of problem (scalability, deployment are much more important than the code itself). Personally I don't have googles problems (few of us do!) and I really like a good type system, with algebraic types/pattern matching/generics
- TheMagicHorsey 11y agoI use Go a lot for backend stuff, and I agree with you. There is a lot of stuff you can do with interfaces to ameliorate the lack of generics--but you still end up missing generics and algebraic types.
- aikah 11y ago> It feels much too pragmatic for my taste It doesn't feels pragmatic at all. It relies on users to do the compiler's job(type assertions) , because "You dont need that with Go"TM ...
- girvo 11y agoIt feels "pragmatic" in that Go follows "YAGNI" almost to a fault. It makes the argument that repeating yourself can sometimes be a better choice than more abstraction to increase code clarity. Some disagree with that, which is why it's nice to see other languages taking on similar areas that Go tackles but with differing choices in that area.
- kristopolous 11y agoThe fact that I don't use OSX has been a barrier to getting better at iOS development. Hackintoshing has proven to be quite elusive and the vmware and vbox USB layers in Linux don't convince virtualized OSX enough to transfer over apps to my iDevices. I'm not convinced you can get to high quality by testing strictly on emulators. If anyone has an old mac that can run modern xCode (you probably know what this constitutes more than me) and wants to donate it to a dedicated open-source developer for completely unspecified future projects, feel free to email me at (my handle on hn)@(googles email service). thanks
- r618 11y agovirtualisation of OS X on non Apple OS (and hence hardware) is not allowed by Apple
- ratfacemcgee 11y agoXcode is written Xcode, not xCode. Thank you and good night. ps. if you have any friends who work in Apple retail, twice a year or so they have a big clear out of some of the internal use machines. You can pick up fairly good machines for very very cheap. They had 2009 white MacBooks for 170 bucks or so the last time.
- shabbyrobe 11y agoThis is a great tip. My main laptop is a 2009 white MacBook with an SSD I cannibalised from another old laptop. The only thing I miss is Civilization V, everything else is fine.
- ekianjo 11y agoDoesn't Civ V run on Mac as well ?
- provemewrong 11y agoYes, but probobably not on a 2009 MacBook.
- bsimpson 11y agoSo we can start writing articles about isomorphic Swift! ...I'll show myself out.
- tomelders 11y agoI'm going to double down on my bet that Apple will position Swift as the lingua franca to replace javascript. Front end and backend.
- pluma 11y agoGood luck with that. One of the reasons JS is the lingua franca is that every browser comes with a JS runtime, all you need to get started is a plaintext text editor and all you need to publish an "app" is cheap/free web space. Mark my words: Swift won't replace JS, not even PHP. EDIT: Also, what's the point of writing Swift code in Linux if you aren't developing for iOS? As a non-iOS developer nothing at all compels me to learn Swift. It doesn't bring anything to the table that JS, Python, Ruby etc don't already do better. Except iOS support. HN tends to forget that just because iOS is the default in the US it's not internationally. Apple is a luxury brand, not a commodity one.
- herval 11y agoThe point on having Swift on other platforms means you can write software for things other than iOS/OSX. It's a fun, modern language that brings A LOT to the table that js/py/rb don't (type checking and the ability to distribute binaries, for starters).
- pluma 11y agoBut programmers don't want better languages[0]. Programmers mostly just want what they already have. You can't overcome that kind of resistance just by saying "look, here's a language that's more fun and modern". Programmers say they want better languages, but good luck trying to convince them to switch to a new language just by its merit. The only tangible benefit of Swift is that it can be used instead of Objective-C for iOS -- which is important for iOS because Objective-C poses an even bigger hurdle by virtue of its unfamiliar syntax. Swift wins on iOS because it competes with a language nobody wanted to learn to begin with. Even as far as familiarity goes, the only thing Swift looks familiar to (based on first impressions) is Ruby, except it uses a more familiar C-like syntax (i.e. braces). While Ruby programmers are extremely visible (especially in startup/valley crowds) there aren't that many of them -- not to mention that some have already moved on to Rust or JS. 0: https://www.youtube.com/watch?v=JxAXlJEmNMg https://www.youtube.com/watch?v=JxAXlJEmNMg