News for hackers. Stuff that matters.
Re:“Swift will be open source later this year” by sjackso on Monday June 08, 2015 @02:46PM (#9681281)
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.

Re:“Swift will be open source later this year” by dmishe on Monday June 08, 2015 @03:37PM (#9681723)
So 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?
Re:“Swift will be open source later this year” by krschultz on Monday June 08, 2015 @04:35PM (#9682193)
I 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.

Re:“Swift will be open source later this year” by abalone on Monday June 08, 2015 @07:48PM (#9683224)
The 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.
Re:“Swift will be open source later this year” by eropple on Monday June 08, 2015 @09:01PM (#9683487)
That'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).
Re:“Swift will be open source later this year” by pcwalton on Tuesday June 09, 2015 @05:23PM (#9688642)
iTunes (used to, at least) have a lot of Mac OS 9/Carbon stuff partially ported to Windows, in fact.
Re:“Swift will be open source later this year” by m_mueller on Monday June 08, 2015 @11:32PM (#9683932)
> stub implementation of Grand Central Dispatch that was neither grand nor dispatching

Thanks for the chuckle, almost r/programminghumor worthy ;-)

Re:“Swift will be open source later this year” by lukeh on Monday June 08, 2015 @07:31PM (#9683166)
Possibly talking about different things when you say "stdlib"?
Re:“Swift will be open source later this year” by alkonaut on Monday June 08, 2015 @05:15PM (#9682485)
It'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).
Re:“Swift will be open source later this year” by ignorabilis on Tuesday June 09, 2015 @09:41AM (#9685796)
With the .NET Framework actually declining, Swift still being far away from the server and frameworks like Meteor, JS seems to have a really good position.

With that said I will root for Clojure + ClojureScript. One could theoretically build a framework much more advanced than Meteor, on the same code-sharing principles.

Re:“Swift will be open source later this year” by Yuioup on Wednesday June 10, 2015 @11:32AM (#9692941)
How so is .NET declining? I haven't heard this.
Re:“Swift will be open source later this year” by ignorabilis on Thursday June 11, 2015 @07:04AM (#9698878)
This is purely based on numbers, but still might be a little subjective. Nevertheless here it is: https://onedrive.live.com/view.aspx?resid=1E5AA35A965D3234%2...
Re:“Swift will be open source later this year” by eatonphil on Monday June 08, 2015 @05:57PM (#9682738)
Just curious, why do you say that (about Go)?
Re:“Swift will be open source later this year” by alkonaut on Monday June 08, 2015 @06:11PM (#9682820)
It 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
Re:“Swift will be open source later this year” by danieldk on Tuesday June 09, 2015 @02:46AM (#9684392)
It feels much too pragmatic for my taste.

C was unprincipled and pragmatic too, it was created with the goal of making UNIX portable. Still, C became one of the most popular and influential languages.

While I prefer ADTs/generics too, let's not forget that many people are less principled and pragmatic factors influence language choice as much (toolchain, ecosystem, popularity, familiarity).

Re:“Swift will be open source later this year” by pjmlp on Tuesday June 09, 2015 @03:44AM (#9684522)
> Still, C became one of the most popular and influential languages.

That was a side effect of successful startups (Sun, SGI...) adopting UNIX as their OS.

Re:“Swift will be open source later this year” by danieldk on Tuesday June 09, 2015 @04:21AM (#9684608)
The success of UNIX is inseparable from C and vice versa. C made UNIX one of the first portable operating systems and, by virtue of being low-level, provided performance.
Re:“Swift will be open source later this year” by pjmlp on Tuesday June 09, 2015 @04:26AM (#9684621)
The same could be said of OSes using Algol and Mesa. They just hadn't successful startups using them.
Re:“Swift will be open source later this year” by danieldk on Tuesday June 09, 2015 @06:51AM (#9685055)
There are good reasons that these startups weren't using OSes using Algol and Mesa. You seem to imply that the success of C and Unix is some historical accident as a result of two startups picking Unix randomly, and their choice was bit a function of the technical properties of UNIX and C. Which, is of course, nonsense.

Sun used Unix because Sun was co-founded by Bill Joy. By that time, Joy was already deeply involved in Unix (per BSD). If he didn't find Unix and C likeable and up to the task, they would have made different choices.

SGI and Sun were just one of many catalyzers, like a lot of programming languages have catalyzers.

Re:“Swift will be open source later this year” by pjmlp on Tuesday June 09, 2015 @07:09AM (#9685117)
You just confirmed what I said.

The startups that have chosen UNIX, did so because the owners were part of the American UNIX university culture.

A different background would have mean a very different history in mainstream OSes and their respective system programming languages.

In Europe C had very little meaning until most enterprises started to replace their mainframes by UNIX servers from those companies.

Re:“Swift will be open source later this year” by kayamon on Wednesday June 10, 2015 @10:22AM (#9692392)
Having had exposure to both C and Pascal at around the sane time, I vastly preferred working in C.

I do think there's something intrinsically good about it compared to other contemporary systems languages - I don't think it's just that it tagged along with Unix.

Re:“Swift will be open source later this year” by TheMagicHorsey on Monday June 08, 2015 @06:30PM (#9682923)
I 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.
Re:“Swift will be open source later this year” by aikah on Monday June 08, 2015 @07:59PM (#9683273)
> 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 ...

Re:“Swift will be open source later this year” by girvo on Monday June 08, 2015 @11:19PM (#9683903)
It 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.
Re:“Swift will be open source later this year” by dmacvicar on Tuesday June 09, 2015 @03:59AM (#9684560)
If you write Go code, you will realize you will actually not hit that problem often at all.

Right now the annoyance I hit more often is the inability to map a []Foo on an attribute .Name (string) to get a []string. I do that in ruby all the time, and with Golang it really sucks to do a for loop to collect stuff appending to a new array.

  people.map(&:name) => ["Joe", "John"]
vs

  a := make([]string, 0)
  for _, p := range people {
    a = append(a, p.Name)
  }
Re:“Swift will be open source later this year” by pjmlp on Tuesday June 09, 2015 @03:45AM (#9684528)
It is not pragmatic at all, it is a language for mine workers that are too stressed to think.
Re:“Swift will be open source later this year” by sacado2 on Tuesday June 09, 2015 @04:35AM (#9684647)
Hah, I precisely use Go when I have to think deeply, i.e. about a difficult to solve problem.

When the problem is boring, use a fun & challenging language. When the problem is fun and challenging, use a boring language.

Re:“Swift will be open source later this year” by indubitably on Monday June 08, 2015 @09:25PM (#9683559)
javascript is awesome
Re:“Swift will be open source later this year” by lukeh on Monday June 08, 2015 @03:02PM (#9681418)
Be 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.
Re:“Swift will be open source later this year” by astrodust on Monday June 08, 2015 @03:59PM (#9681944)
The 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.
Re:“Swift will be open source later this year” by gsnedders on Monday June 08, 2015 @07:04PM (#9683069)
CoreFoundation 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/Makefil...

Re:“Swift will be open source later this year” by lukeh on Monday June 08, 2015 @07:34PM (#9683177)
It'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.
Re:“Swift will be open source later this year” by biturd on Monday June 08, 2015 @10:20PM (#9683729)
What language is that link written in? It looks like bash sort of but not really?
Re:“Swift will be open source later this year” by johnmaguire2013 on Tuesday June 09, 2015 @12:45AM (#9684134)
It's a Makefile[1]. They are quite simple really. They're defined like this:

  target: dependencies
      command
The command is run by a shell (e.g. bash!) when the target is called to be run. For example...

  all: hello world
      echo "!"

  hello:
      echo "Hello"

  world:
      echo "World"
Now if you run "make", you will see each command being run. By default, if you call "make" with no arguments, the "all" target will be run. You can also call "make world" for example, to have it only run the "world" target. As you can see, first the dependencies of the target are called, then the command of the target is run.

It's often used by C/C++ projects in order to manage dependencies, but can be used for anything really.

Here's a short tutorial you can walk through if you're interested in how it works and why it's useful: http://mrbook.org/blog/tutorials/make/

1. https://en.wikipedia.org/wiki/Makefile

Re:“Swift will be open source later this year” by sova on Tuesday June 09, 2015 @03:56AM (#9684554)
wow thanks for breaking that down. years of playing and prodding on linux and this helped me a lot. funny and funky what slips through the cracks. kudos friend
Re:“Swift will be open source later this year” by stephenr on Monday June 08, 2015 @10:31PM (#9683760)
It's a Makefile.. for.. Make.
Re:“Swift will be open source later this year” by notduncansmith on Monday June 08, 2015 @11:26PM (#9683921)
I feel like this reply could have been much more helpful and less snarky. Some people are still learning - we all were, at one point.
Re:“Swift will be open source later this year” by keeganpoppen on Tuesday June 09, 2015 @12:58AM (#9684158)
everyone is always learning (hopefully) ;D
Re:“Swift will be open source later this year” by 72deluxe on Tuesday June 09, 2015 @05:12AM (#9684743)
Some people aren't learning to be helpful or less snarky though.... :-)
Re:“Swift will be open source later this year” by lukeh on Monday June 08, 2015 @05:40PM (#9682645)
It'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.)
Re:“Swift will be open source later this year” by david-given on Monday June 08, 2015 @04:50PM (#9682290)
Is 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.)
Re:“Swift will be open source later this year” by bri3d on Monday June 08, 2015 @05:17PM (#9682503)
Objective-C 2.0 via Clang and the GNUStep ObjC2 runtime supports blocks, GCD, fast enumeration, declared properties, introspection.
Re:“Swift will be open source later this year” by pjungwir on Monday June 08, 2015 @03:11PM (#9681498)
I'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

Being able to deploy on Linux might be what it takes!

Re:“Swift will be open source later this year” by lobster_johnson on Monday June 08, 2015 @04:51PM (#9682301)
I 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.

Re:“Swift will be open source later this year” by zeckalpha on Tuesday June 09, 2015 @12:07AM (#9684021)
The Étoile OS folks have been working on top of GNUStep for a while: http://etoileos.com/

Here's a recent thing that came out of that group, which I'm interested to see in a server-side project: http://coreobject.org/

Re:“Swift will be open source later this year” by MCRed on Monday June 08, 2015 @11:01PM (#9683841)
The 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.

Re:“Swift will be open source later this year” by pjmlp on Tuesday June 09, 2015 @03:48AM (#9684532)
At the time Sun was working together with NeXT for having Objective-C in Solaris (before Oak became Java) and got their base ideas for J2EE from WebObjects.
Re:“Swift will be open source later this year” by alkonaut on Monday June 08, 2015 @05:34PM (#9682612)
Agree. 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.
Re:“Swift will be open source later this year” by themartorana on Monday June 08, 2015 @03:46PM (#9681810)
It'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).
Re:“Swift will be open source later this year” by kristopolous on Monday June 08, 2015 @06:55PM (#9683042)
The 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

Re:“Swift will be open source later this year” by ratfacemcgee on Monday June 08, 2015 @10:39PM (#9683778)
Xcode 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.
Re:“Swift will be open source later this year” by codazoda on Tuesday June 09, 2015 @09:19AM (#9685712)
The cheapest official retail option is the Mac Mini for $499. It's not a laptop but it will run the latest Xcode. Might be just the thing you need for that first app that makes you a bazillionaire.
Re:“Swift will be open source later this year” by shabbyrobe on Monday June 08, 2015 @11:52PM (#9683981)
This 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.
Re:“Swift will be open source later this year” by ekianjo on Tuesday June 09, 2015 @01:12AM (#9684193)
Doesn't Civ V run on Mac as well ?
Re:“Swift will be open source later this year” by provemewrong on Tuesday June 09, 2015 @06:52AM (#9685057)
Yes, but probobably not on a 2009 MacBook.
Re:“Swift will be open source later this year” by jedrek on Tuesday June 09, 2015 @07:58AM (#9685324)
> Hackintoshing has proven to be quite elusive

I've been using a hackintosh since 2008. It's literally never been easier to get one up and running.

Re:“Swift will be open source later this year” by kristopolous on Tuesday June 09, 2015 @10:17AM (#9686013)
So many people report success but a half dozen attempts with 20 years of computing to back me up has been nothing but abysmal failure.

I don't know what kind of magical book of voodoo spells these people are using.

I wonder if the web is just biased towards success because generally the people who haven't succeeded have nothing to say.

If so, it would be nice to get insight on the whole picture here somehow

Re:“Swift will be open source later this year” by aikinai on Tuesday June 09, 2015 @11:48AM (#9686591)
Skyline OS X is a great resource for getting a solid And simple Hackintosh install. I'd recommend trying the guides there.

http://skylineosx.com

Re:“Swift will be open source later this year” by mcmahoniel on Wednesday June 10, 2015 @04:45PM (#9695234)
It's not hard. Apple computers are still using commodity hardware - that is, you can buy very similar parts off the shelf to build your own system. The closer you get, the easier it is, but there are forums revolving around tweaks and updates to make just about anything work. Even AMD CPUs, which Apple has never used.

It _does_ take some tinkering, though, and if you aren't comfortable with that (or if your time is valuable enough), you should invest in the real deal. :)

Re:“Swift will be open source later this year” by Ezhik on Wednesday June 10, 2015 @04:41PM (#9695201)
If you have the right hardware it can work as good as a real Mac.

But some hardware is just not compatible and that's it, nothing you can do about it.

Re:“Swift will be open source later this year” by wyclif on Monday June 08, 2015 @11:50PM (#9683973)
I have an old white Macbook running SL, but it won't run modern XCode. It's great for doing things like Python dev, though.
Re:“Swift will be open source later this year” by bsimpson on Monday June 08, 2015 @07:57PM (#9683267)
So we can start writing articles about isomorphic Swift!

...I'll show myself out.

Re:“Swift will be open source later this year” by mozumder on Monday June 08, 2015 @04:45PM (#9682257)
Apple 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..
Re:“Swift will be open source later this year” by tammer on Monday June 08, 2015 @05:47PM (#9682694)
Why when the aftermarket will do it for them?

http://photos.imgix.com/racking-mac-pros

Re:“Swift will be open source later this year” by jlawer on Monday June 08, 2015 @06:15PM (#9682840)
OS X Server is really a shell of the former product. It used to be a great small business / design studio server, but it has lost most of its use-case and I really question its use outside of a few Apple Device Management scenarios.

Almost all the documentation and best case expects Macs to be tied to an Active Directory / MS environment for management.

As a typical Web / LAMP host, OS X really is not that performant. Unix tools execute faster on a RHEL/CentOS box then an OS X (even if the OS X box has higher specs). MySQL is particularly bad if it hasn't been tuned, and most of the literature seems to indicate that OS X (or more specifically MACH) doesn't have the level of optimisation for server workloads.

That being said, if your using the OS X frameworks, there can be some great value with exceptional performance (just look at the startup using Mac Pros as image manipulation servers).

Re:“Swift will be open source later this year” by Zenst on Monday June 08, 2015 @05:33PM (#9682606)
I 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.

Re:“Swift will be open source later this year” by digi_owl on Monday June 08, 2015 @05:36PM (#9682624)
Back 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.

Re:“Swift will be open source later this year” by Zenst on Monday June 08, 2015 @05:47PM (#9682691)
Very 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.

Re:“Swift will be open source later this year” by digi_owl on Monday June 08, 2015 @05:50PM (#9682705)
Don't they already offer that via their Airport range of routers? I seem to recall they offer file storage/backup, perhaps even with a iCloud link.
Re:“Swift will be open source later this year” by wiredfool on Tuesday June 09, 2015 @12:23PM (#9686798)
I really wish that the airport extreme routers would expose an itunes home sharing service, so that those of us with laptops and way too much music/videos could stream to airport express/appletv/itunes home sharing without having to have a machine dedicated to the task.
Re:“Swift will be open source later this year” by Zenst on Monday June 08, 2015 @06:13PM (#9682830)
I knwo you can add discs via the USB port and with hub can have a fair few and can network share and backup to them. But not apple user fully and did look but found nothing to enable sync with iCloud beyond a desktop option, though may of missed something. Though did find this: https://support.apple.com/en-us/HT204618 which pertains to remote desktop and related functionality done via your iCloud account, so maybe, though still need to access via iCloud, which if just athorisation would be ok if you had a fallback option.
Re:“Swift will be open source later this year” by aaggarwal on Monday June 08, 2015 @03:18PM (#9681544)
I 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 :)
Re:“Swift will be open source later this year” by untog on Monday June 08, 2015 @07:19PM (#9683123)
I doubt Swift will rule the web. Javascript has yet to be dethroned by any other language coming before it, after all.
Re:“Swift will be open source later this year” by ignorabilis on Tuesday June 09, 2015 @09:32AM (#9685778)
If 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.
Re:“Swift will be open source later this year” by aaggarwal on Tuesday June 09, 2015 @02:33PM (#9687717)
When I was referring to web, I mainly considered the web-backend on web-servers. JavaScript is the standard for frontend, no doubt.
Re:“Swift will be open source later this year” by tomelders on Tuesday June 09, 2015 @04:29AM (#9684629)
I'm going to double down on my bet that Apple will position Swift as the lingua franca to replace javascript. Front end and backend.
Re:“Swift will be open source later this year” by pluma on Tuesday June 09, 2015 @04:50AM (#9684680)
Good 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.

Re:“Swift will be open source later this year” by herval on Tuesday June 09, 2015 @06:17AM (#9684956)
The 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).
Re:“Swift will be open source later this year” by pluma on Tuesday June 09, 2015 @06:55AM (#9685072)
But 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

Re:“Swift will be open source later this year” by tomelders on Tuesday June 09, 2015 @08:20AM (#9685415)
I'd counter this

> But programmers don't want better languages

With TypeScript and/or ES6(7)+Babel. These have a pretty healthy userbase between them and there's a lot of excitement around ES6 which leads me to think that developers do want better languages.

Also... I want a better language. I'm not sure how you'll convince me otherwise and I don't think I'm alone in this sentiment.

Do they want a "different" language... maybe, maybe not. I suppose my comment about Apple "positioning" (and I'm careful to use that word) Swift as a replacement to Javascript can make a lot of sense to Apple and people who develop for iOS and OS X.

Firstly, Apple doesn't need buy in from other browser vendors. They can supply a Swift runtime with Safari (desktop and mobile) and I think it would be no more difficult to write a Swift to ES5 transpiler than it is to write an ES6/7 to ES5 transpiler, meaning that web devs can be agnostic about what browser their web app is running on and make demote Javascript to simply being a build task.

Secondly - Swift is going to have a lot of developer support. Because native apps are are increasingly dependent on a corresponding Web API - I think it's reasonable to expect people to be happy about sharing code between the front and back ends of their apps. I think nodes biggest advantage over any other server-side languages is that I can use node packages in both place.

Thirdly - I don't think Apple really cares wether "web developers" have an issue with this. They care about providing tools and solutions for people who develop for and use their platforms. If they can make the case that Swift is going to be "better" than Javascript by some metric we don't know right now, then that's what they'll do. Everyone else can go cry in a corner.

Also, Down-votes? Really? It's not the most radical idea in the world and I fail to see how someone could take offence from it.

PS: Apologies but I don't have time to watch that video right so I hope I haven't got the wrong end of the stick.

Re:“Swift will be open source later this year” by pluma on Wednesday June 10, 2015 @06:19AM (#9690998)
I agree, in part.

Programmers do want better languages, but they are extremely allergic to friction.

Parts of ES6/7 are relatively low friction thanks to Babel. But even so moving the majority of JS devs to modern JS is a very slow and long process.

Swift may make a dent if Swift-to-JS becomes a thing, but compile-to-JS languages are mostly a failed experiment (see the lack of success of "serious" languages like Dart or the decline of CoffeeScript). The advantage of Babel over other to-JS compilers is that you're just compiling JS to JS and it carries the promise that one day you won't need the compilation step at all.

The "JavaScript is the ASM of the Web" idea, while enticing, has time and again failed to come true. I don't think Swift can succeed where others have failed, even if it would allow iOS developers to write web apps.

At the risk of having to swallow my words, I don't think Swift-in-the-browser poses any risk to JS. I also don't think Swift-on-the-server will have a major impact, although I can imagine iOS-heavy shops wanting to use Swift when developing server APIs for their apps.

I agree that Apple will carry on regardless. Apple is all about controlling their ecosystems, so I wouldn't be surprised if they try to pose Swift as an alternative to JS (much like their unilateral CSS extensions back in the day).

About the video: basically Douglas Crockford (of JSON fame and JSLint infamy) argues that history has proven that developers (as a whole) favour similarity over "betterness" when it comes to the success of programming languages. They're more likely to pick something that is nearly exactly like what they already know than something that requires them to adjust their mental model, even if it is superior in nearly every way. The entire series is worth a watch IMO, and helps appreciating why and how JS got to the point where it is today.

Re:“Swift will be open source later this year” by herval on Tuesday June 09, 2015 @04:38PM (#9688393)
Following your logic, Javascript just started growing on the server-side due to a number of frontend devs "just wanting what they already have". There's a huge number of mobile devs out there that have to, one way or another, write server-side code. Guess what'd be their language of choice then (when the Apple-backed open-source Swift is out)?
Re:“Swift will be open source later this year” by pluma on Wednesday June 10, 2015 @06:31AM (#9691039)
There's vastly more people who write JavaScript than people who write iOS apps in Swift.

I agree that server-side Swift may become a thing for iOS developers writing their own server APIs, but I'm only inclined to believe that it will at best become yet another alternative alongside Node, Ruby, Python and PHP. After all, Swift will only be a logical choice if you're already using Swift as the primary language -- i.e. only if you're writing native iOS apps.

For the "Swift in the browser" narrative it's also important to remember that the web is not just JavaScript. Even if you can abstract away DOM manipulations as in React, you still have to be aware of HTML and CSS and how everything comes together. Replacing JS with Swift only provides another layer of indirection, you still have to be a web developer to write web apps.

Considering how previous attempts to pretend you're not actually writing JS worked out (Ruby developers using CoffeeScript, Java developers using Dart or GWT, Python developers using PyJS, etc) I don't think JS in the browser is going anywhere, no matter how much some people would wish it.