News for hackers. Stuff that matters.
Re:Chris Lattner on Swift by Arjuna on Tuesday June 03, 2014 @03:11PM (#7842163)
Chris demonstrated Swift and Playgrounds at WWDC 2014:

"I can build anything with Swift... from a social media application, all the way up to a high-performance, 3D game using Metal."

https://www.youtube.com/watch?v=nKMAV6owYh4#t=6436

He wrote this chapter (entitled LLVM) in the book, "The Architecture of Open Source Applications":

http://aosabook.org/en/llvm.html

* * *

On the general topic, I wrote this [1] a little earlier in another thread; I'm just impressed with how Apple is becoming a gaming powerhouse.

[1] https://news.ycombinator.com/item?id=7841744

Re:Chris Lattner on Swift by diminish on Tuesday June 03, 2014 @04:05PM (#7842405)
Did he mention anywhere Swift will be open sourced, the way LLVM has been? If not, why?
Re:Chris Lattner on Swift by lstamour on Tuesday June 03, 2014 @04:32PM (#7842541)
I find when Apple employees leave something important out, like licensing, it's because others haven't yet made the decision -- in other words, it's not final. I personally would have expected that if Apple were not making the code open source, they would mention its exclusivity and emphasize it as a training program for schools, etc. Realistically, it's just time -- like LLVM improvements or past work on Objective-C, expect everything up to the REPL as open source, but playgrounds and docs under proprietary license or completely closed would be my guess. If not now, some time in the future as .NET further open sources or if they want to encourage Swift as a JS competitor.
Re:Chris Lattner on Swift by mikeash on Tuesday June 03, 2014 @04:50PM (#7842641)
Or the decision has been made but it's not ready to be announced yet, for whatever reason.

Apple is notoriously secretive. They hate saying anything ahead of time if they don't have to. They could have committed (internally) to open sourcing Swift when they started on it four years ago, but they still probably wouldn't say anything until they day it happens. If they thought they could get away with it, they'd have kept the very existence of Swift secret until the public release, but they need feedback from third-party developers at this point.

Re:Chris Lattner on Swift by polutropos on Tuesday June 03, 2014 @06:19PM (#7843077)
According to Lattner himself, looks like the decision to open source has not been made yet.

"@Ahti333 right now we are focused on finishing it up for the final release this fall."

https://twitter.com/clattner_llvm/status/473907124288770050

Re:Chris Lattner on Swift by jevinskie on Tuesday June 03, 2014 @04:40PM (#7842587)
Re:Chris Lattner on Swift by dikei on Wednesday June 04, 2014 @03:25AM (#7844388)
Does it really matter ? While I think Swift is an amazing language, it would be much less useful outside the closed ecosystem of Apple. The same thing happened to C#, it never really took off outside Windows.
Re:Chris Lattner on Swift by bitpew on Wednesday June 04, 2014 @05:11AM (#7844677)
It's true that C# is not as prevalent on non-Microsoft platforms as it is on Windows but there are a handful of mid-size to big multiplatform projects using C#.

e.g.

- Xamarin (multiplatform mobile apps)

- Unity3d (multiplatform games)

- Monogame (multiplatform games)

- Unreal Engine 4 (build system)

I guess Swift could fill the same gaps. I would especially love to be able to develop multiplatform mobile apps with swift since switching between ObjC and Java all the time is quite taxing.

Re:Chris Lattner on Swift by topbanana on Wednesday June 04, 2014 @03:56AM (#7844472)
You could share code with Android and Windows Phone targets.
Re:Chris Lattner on Swift by baldfat on Wednesday June 04, 2014 @11:40AM (#7846196)
The reason why C# (edited out C3) didn't take off on Linux was:

1) It did take off like wildfire on Linux as Mono

2) People claimed Mono was a trap and not to use it. Because you can never trust Micro$oft

3) personally sad this happened to an open standard language

Re:Chris Lattner on Swift by Shebanator on Wednesday June 04, 2014 @11:40AM (#7846195)
C# is extremely popular in the gaming industry.
Re:Chris Lattner on Swift by EpicEng on Wednesday June 04, 2014 @02:55PM (#7847418)
A small sector perhaps, but it isn't that popular if you look at the entire industry, i.e., AAA games. No one is writing CoD or Witcher in C#.
Re:Chris Lattner on Swift by Vetre on Wednesday June 04, 2014 @08:17PM (#7849337)
I respectfully disagree. You can't downplay the massive indie game libraries or even AA games out there. They're not breaking records, but they make a large amount of sales.

There are several massive communities that use Monogame (even still use XNA) and Unity. It's huge in the indie community, and is basically how the XB1, PS4, and Vita expect you to make games for their systems. The Vita Tool Chain is mostly C#.

Sure, no one is writing AAA games that require maximum graphical capabilities in C#, those teams use C++ exclusively (often with a scripting language on top). At that point that is really the only language AAA games use if they are made from scratch, otherwise they are using an engine already made in C++.

Bastion, Magika, A.R.E.S., Dust, Fez, Rogue Legacy, Reus, and Terraria are just a few made in XNA/Mono. And looking at total sales amounts, some of those games definitely had revenues over a million dollars.

That's not including unity games like: Shadowrun Returns, Rust, Wasteland 2, and Hearth Stone. These games made very good amounts of money, again, not 100% AAA, but still industry veterans.

Re:Chris Lattner on Swift by EpicEng on Wednesday June 04, 2014 @10:00PM (#7849775)
I suppose you're right, I shouldn't have downplayed them. I just think you need to segregate the two groups as they are almost completely different industries. To say that "C# is really popular in the video game industry" is misleading.
Re:Chris Lattner on Swift by Vetre on Thursday June 05, 2014 @03:34PM (#7853810)
I can mostly see your argument. It makes sense. The indie and AAA industry are two different beasts, but they are the same industry.

It feels like one of those big business vs small business issues. If you have the man power and the resources, you can go much farther much faster. But not every starting company can afford the overhead of going full C++ and Engine heavy.

So C# being 'really' popular in the AAA side of the industry is a tad misleading (though can be used as a language on top of the engine, for tools (where it is probably most used), and for tool-chain), to discount it only due to the top 33% of companies usage, is a bit unfair to the quite large and growing indie and AA crowd.

Re:Chris Lattner on Swift by mnem on Wednesday June 04, 2014 @07:05AM (#7844908)
Does it really matter if a language is open source or not? Surely the most important thing is a versioned language specification?
Re:Chris Lattner on Swift by ChikkaChiChi on Wednesday June 04, 2014 @10:45AM (#7845812)
Yes, it does matter. I have little to no interest in Swift if it's walled off into the Apple infrastructure.

I would be very interested if it was opened up and available for Linux.

Re:Chris Lattner on Swift by EpicEng on Wednesday June 04, 2014 @02:53PM (#7847400)
If there is a standard available then it doesn't matter so much. With the a spec anyone may write their own implementation. Of course, will they becomes the question then, and whether or not people will adopt it on non-Apple platforms.
Re:Chris Lattner on Swift by jroesch on Wednesday June 04, 2014 @10:03PM (#7849788)
That is a nice view in theory, but doesn't mean much in reality, even if they release a spec who is going to be able to build an implementation to compare. It will end up like GNUStep. Even languages that are open like Python have trouble maintaining language compatibility across multiple versions. Written specs are also riddled with ambiguities and implicit assumptions which make the creation of a "perfect" clone very hard.
Re:Chris Lattner on Swift by vacri on Tuesday June 03, 2014 @07:55PM (#7843375)
Which languages that can produce a high performance 3D game wouldn't be able to also produce a social media application?
Re:Chris Lattner on Swift by coldtea on Tuesday June 03, 2014 @11:05PM (#7843813)
If you put it that way, then yes. You could even use assembly to do both things. Or even CPU microcode.

What they mean is that the language works at high enough abstraction and feels appropriate for writing both kinds of apps.

I wouldn't want to do a social media app with Fortran, even if it's perfectly possible.

Re:Chris Lattner on Swift by duaneb on Tuesday June 03, 2014 @08:30PM (#7843463)
C++ would be absolutely terrible for social media applications. There, the barrier isn't usually the speed but correctness and maintenance overhead.
Re:Chris Lattner on Swift by TillE on Tuesday June 03, 2014 @09:24PM (#7843590)
Is Objective C really that much better? If you have decent APIs/libraries, C++ would be just fine.
Re:Chris Lattner on Swift by Gracana on Tuesday June 03, 2014 @11:04PM (#7843809)
As an example, OKCupid uses C++ and runs on a custom webserver.

http://www.okcupid.com/about/technology

Re:Chris Lattner on Swift by 31reasons on Wednesday June 04, 2014 @01:12AM (#7844144)
I don't understand. Why would you make everything in-house especially for site like Ok-Cupid which is not exactly used to power rocket engines.
Re:Chris Lattner on Swift by jacquesm on Wednesday June 04, 2014 @06:11AM (#7844815)
They were in much the same boat as I was back then: whatever you could install out of the box was simply too slow. Inefficiency would have caused us to die on hosting costs so we had to build our own webserver and so on. It's gotten a lot easier over the last decade and a half to build a performant website.

If Ok-Cupid were started today I highly doubt they would do that the same way. But given when they did start it I figure they literally did not have a choice.

Re:Chris Lattner on Swift by logicchains on Wednesday June 04, 2014 @03:37AM (#7844417)
They did a blog post on it that I can't find right now. Essentially, they made it quite a while ago (2002? I don't recall exactly), and all other options were too slow. Their backend apparently has to do a lot of work calculating match scores when users search.
Re:Chris Lattner on Swift by logicchains on Wednesday June 04, 2014 @05:59AM (#7844790)
Found a post by one of the developers describing the decision in some detail: http://www.brightjourney.com/q/okcupid-write-web-server

They've also open sourced their server: https://github.com/okws/okws

Re:Chris Lattner on Swift by gte910h on Wednesday June 04, 2014 @09:01AM (#7845272)
Objective C is head and shoulders better to program in than C++.

It's still got the same C warts that C++ does in a lot of place, but it is far simpler and less leaky than C++.

C++ is still faster and more cross platform, than objective-c

  --Have done both professionally
Re:Chris Lattner on Swift by jeremyjh on Tuesday June 03, 2014 @11:08PM (#7843822)
C++ can be just fine. It can also be used to write software bad enough to quit over, that dozens of people will maintain for decades. And they talk about it. I don't think Objective C has that problem.
Re:Chris Lattner on Swift by alttab on Wednesday June 04, 2014 @12:27AM (#7844045)
To be fair, Objective C hasn't run billion dollar companies for decades yet either (in mass).
Re:Chris Lattner on Swift by threeseed on Wednesday June 04, 2014 @02:07AM (#7844249)
Objective-C up until the last couple years was powering the payments infrastructure for the Apple Online Store.
Re:Chris Lattner on Swift by alttab on Wednesday June 04, 2014 @02:47PM (#7847364)
Which isn't exposing Objective-C to a wide range of engineers in the industry to the point people and relate and swap horror stories about it.
Re:Chris Lattner on Swift by jeremyjh on Wednesday June 04, 2014 @01:02AM (#7844126)
Yes, that is my point but I didn't make it very well. If Objective C were routinely subjected to these sorts of projects, I think its over-all reputation would be a lot worse.
Re:Chris Lattner on Swift by SoftwareMaven on Wednesday June 04, 2014 @01:57AM (#7844222)
No, objC isn't better. While it is fine for UI stuff, I wouldn't really want I build a web app with it. What I've read of Swift is more interesting.
Re:Chris Lattner on Swift by pjmlp on Wednesday June 04, 2014 @04:04AM (#7844497)
Funny NeXT thought otherwise. WebObjects was a very good server platform.
Re:Chris Lattner on Swift by reubenmorais on Tuesday June 03, 2014 @11:04PM (#7843807)
No, but according to Chris Lattner, Swift is.
Re:Chris Lattner on Swift by epsylon on Wednesday June 04, 2014 @02:43AM (#7844305)
And Swift would be equally terrible for a high performance 3D game. (It's not because the guy from Apple said it that it's true.)

There's a reason why every single AAA studio uses C++ for their engines and titles. And that's the same reason why it is terrible for social media applications.

Re:Chris Lattner on Swift by gte910h on Wednesday June 04, 2014 @09:03AM (#7845281)
Every single AAA studio uses C++ to write the smallest portion of their game they can in C++.

Then they put a sane, modern language on top of it many places, Actionscript at EA, Python at many other places, LUA at others, C# at others, and write in a high level language that doesn't leak abstractions like a nut milk bag.

Re:Chris Lattner on Swift by pjmlp on Wednesday June 04, 2014 @07:50AM (#7845021)
Mostly because game studios don't write compilers so they get to use what the respective OS vendors SDKs offer.
Re:Chris Lattner on Swift by plg on Tuesday June 03, 2014 @10:35PM (#7843727)
Is the balloons playground he demoed in the keynote available for download?