Hacker News new | past | comments | ask | show | jobs | submit login
Swift compiler crashes (github.com/practicalswift)
98 points by epaga on Feb 9, 2015 | hide | past | favorite | 47 comments



Maybe I could get on board with this if the compiler were open source. Why are people so enthusiastic to give hours away for free to commercial projects?


> Why are people so enthusiastic to give hours away for free to commercial projects?

This is a naïve view of the situation.

You claim these people are working "for free." In reality, many of these people derive income directly from Apple's software ecosystem. Their efforts to improve this ecosystem will in turn improve their ability to make and sell software, so it's not necessarily purely altruistic.

Second, Swift/XCode is a means to an end: developing software to run on iOS, OS X, etc. If someone begins with the destination in mind (e.g. is letting the product determine the tools, rather than the tools determine the product), then the choice of tools is secondary. You imply that bettering your tools is fruitless if you're not the one making and selling the tools. This seems very shortsighted.

Also, while open source is great, I don't understand this hardline value judgement that open source is good, and commercial is bad. That's your prerogative, but it's a personal preference.


When you encounter a bug in a product you use daily, you're (marginally) more likely to find it getting fixed if you submit a decent bug report. And decent bug reports usually include a simple way of reproducing the problem. So here's a collection of reproduction steps for crashes (and presumably many of them have radar bugs that refer to them).

That's an alternative interpretation.


Because Swift will allow developers to build better apps on Apple's platforms. The quicker Apple polishes Swift, the quicker the entire ecosystem benefits.

Sure, open source is ideal but there are benefits to helping Apple or Microsoft, for example, improve their software.


Why is there such a strong belief that Apple will not open-source it?

Especially considering that their old competitor, Microsoft, and their new-ish one, Google, both open-sourced their language implementations (Go, TypeScript, V8, Dart, even C#…), and were seen as (and, I believe, were in fact) technically superior thanks to that.

Apple wants to be seen as having the very best product. It also wants to ensure its developers don't feel forced to publish something they're not proud of. The way I read this, Apple wants to open-source it, Chris Lattner is being very careful about it.

Tl;dr: beg Chris if you want Swift open-sourced.


I think the belief is based on the fact that it was released as closed source into a world where open-sourcing languages has become the default. This implies a strongly made business case for keeping it closed source at Apple. [IANAL]

I doubt that case is based on any whizbang technology that gives Apple a competitive advantage. I expect that the decision is based on opinions from the legal department and a risk assesment of the potential for being smacked with someone's patent portfolio. Unlike a from the ground up open source project, Apple has a lot of cash on hand and makes an attractive target for lawsuits.

Also unlike a from the ground up open source project, pull requests are a hassle because of licensing and patent issues...again all that cash makes Apple a target for lawsuits.

Finally, the fact that there is a user manual rather than a language specification suggests the possibility [but does not prove the existence] of kludgey implementation compromises for performance/compatibility/expediency reasons. Because Apple is a products company, this sort of code could be construed in a legal argument as Apple having knowledge of latent product defects.

Against all this, what is the upside for Apple? Love from the general development community maybe. But from their business practices in recent years it does not appear to be something upon which the corporation places a high value.


Because people have a perception of Apple as "closed" and have no interest in challenging this perception with things like "facts."

Apple is closed in many ways. But when it comes to compiler toolchains and similar technology, they're quite open. Their LLVM work remains open source. clang is open source. Lots of other tools are open source. I see no reason to think that Swift won't follow that pattern.


>Because if I make the walled garden nicer, I'll live in a nicer walled garden!

That's actually what you just said. Keeping is closed source, and reporting bugs doesn't benefit the developer at all. It benefits Apple.

They may get the secondary effect of this becoming an employable skill, someday, hopefully. But currently isn't, it almost is, but isn't (Judging from the 4-5 swift posts I've seen on HN compared to dozens of js/java/ruby/etc.).


No, I'm trying to write software on iOS, as are many other people. My app is probably over 35k lines. I'd rather have it all in Swift because I believe it would have fewer bugs, be easier to maintain, and perhaps even require less code:

https://itunes.apple.com/us/app/h4-spanish-lite/id388918463?...

Personally, I'm trying to contribute to the Swift transition by aggregating the Swift tutorials on the Internet.

http://h4labs.com/dev/ios/swift.html

At some point, if Apple doesn't open source Swift, I'd gladly help in an open source compiler.


Putting words in people's mouths is one of the most juvenile possible ways to make an argument. Please don't.


> You shouldn't report bugs you find in software you use on a daily basis. Those bugs are best left unfixed

A curious attitude!


No you shouldn't report bugs in closed source software you use. Because it has no benefit for you, only for the company. Are you being paid to make their product better? If their product failed you, find a new tool, don't fix theirs.

Now this is an ideal. You can't live like this unless you're RMS. But it is true nonetheless.

If my car breaks I don't submit a 25 page engineering report to Ford. I replace the car, or fix the problem personally and move on. My job isn't to do somebody else's job, especially when that person is paid more then me.


"Because it has no benefit for you, only for the company."

Except this is, of course, false, since you already said he would live in a nicer walled garden. Making the walled garden nicer for him is a benefit for him, regardless of whether it's a walled garden or not.

"If my car breaks I don't submit a 25 page engineering report to Ford. I replace the car, or fix the problem personally and move on. My job isn't to do somebody else's job, especially when that person is paid more then me."

IMHO, this is a very sad attitude to have towards life.

(and what does being paid more or less than you have anything to do with anything?)


Please never use my software.

> Because it has no benefit for you, only for the company.

Really?! Making a tool you use every day better has no benefit for you? Sure, I can build my own text editor if I really wanted to, but I'd rather send a bug report to BBEdit to fix a problem in an otherwise good product.


Yes, this is my attitude as well. A lot of the work I've done has required the use of proprietary tools; you might not be getting paid to improve the tool, but you are (presumably...) getting paid to produce a product, and if the tool is getting in your way somehow then you need to do something about it!

Even if you don't bother to report usability issues or suggest improvements or what have you, if you encounter a bug that's blocking progress, sitting on your hands isn't going to help anybody.

(Of course, reporting it might not do much either ;) - but that's something you need to find out on a vendor-by-vendor basis. Some are responsive.)


No, if your car breaks, you take it to the dealer, and if they find a common problem they report it to the company. If it's a common defect, they do a recall and others benefit.


HN crowd have double standards for Apple - I'm surprised you are surprised


The "HN crowd" consists of more than one person and can therefore have more than one opinion. Surprise!


it's not a surprise - the only surprise is Apple releasing semi-baked products and marketing them as 1.0


>Because if I make the walled garden nicer, I'll live in a nicer walled garden!

For certain aspects of my digital life, this does in fact sound wonderful. I've not found 'open' and 'free' to exist much at all in the mobile world, and where it does it's clunky, frustrating, and insecure. A walled garden sounds good when one is surrounded by barbarians...


"reporting bugs doesn't benefit the developer at all. It benefits Apple."

If Apple fixes the bugs how does it NOT benefit me, the developer? The fewer bugs there are the easier development is. Reporting a bug may be helping Apple but that is secondary to helping myself.

Does the benefit from the view of pure self-interest help you understand better why someone might do something that has direct benefit to themselves?

The summary of your attitude is contained in the old phrase "Cutting off the nose to spite the face".

Also, as far as not being an employable skill - I make my whole living from it currently (currently using Swift only), generally iOS has been an employable skill since the release of the App Store so again, you seem to be waving that knife way too close to your nostrils.


Why do you think that "I'll live in a nicer walled garden" isn't a benefit?

You don't approve, fine. But if someone does accept the walled garden, what's wrong with making it nicer?


Because for many of us what matters are the customers, not the tooling religion.


How nice of you to dismiss the benefits of open source projects as "religion"!


Maybe I'm being too charitable, but I didn't read that as dismissal.

Would you prefer "philosophy"?


It's not about philosophy or religion. There are clear benefits to having the source available, not the least of which being the fact that you can learn from the code.


How you assess the balance of benefits versus costs of open source is a question which reaches into your philosophical beliefs. As for the distinctions between "philosophy" and "religion", well...that's a well-trodden path I won't go down.

Open source is not free. It's charitable work, which might be purely altruistic or might be largely self-interested, or anywhere in between.

For what it's worth, I do believe that the Swift frontend "should" be open sourced. I believe that I would benefit from that happening. I also believe that Apple would benefit, but I won't pretend that it wouldn't come with costs to Apple.

Apple has decided, at the present time, that the costs outweigh the benefits. Their philosophical stance on open source does not persuade them to incur the costs, at this time -- and possibly never will, though we both hope otherwise.


There are dubious benefits. I use Emacs all the time, and have made a few contributions to it, but I won't be digging into the core C code anytime soon. First, learning enough to fix even a simple problem takes quite a bit of time. Second, the lessons learned will be mostly about Emacs, and not generally applicable; that's the way things are with most big programs.

The amount of time required to meaningfully learn from or contribute to something as hairy as a web browser or compiler is large enough that you can only engage with a few. Personally, I never want to have to look at my web browser's source code.


I believe in open source, but am not a hardline. I'm also entrepreneurial, and like to help out others make a business of making development tools.

Personally I don't think only open source projects are superior. In some domains like say design tools, paid for tools have much more choice and polish.


IMO the only things that have pushed Apple to the heights it's at right now are:

1) Steve Jobs' story 2) "Apple as a status symbol"

#1 will probably make them strong for a long time in the consumer's eye, but #2 will fade with time, as I think it's safe to say open-source is a provably stronger model than closed-source. As long as they embrace closed-source, innovation on their platforms will suffer in the long run, and as a result they will (over time) be incapable of producing a better product than their competition.


I have a hard time believing "Steve Jobs' story" factors into most consumers purchasing decisions, or that Apple products are much of a "status symbol" when more than half a billion iPhones have been sold...

EDIT: make that more than 1 billion iOS devices: http://www.macrumors.com/2015/01/27/apple-one-billion-ios-de...


Interesting points. I think any form of "underdog from the bottom to the top" stories captivate humans. With Steve Jobs you have a real-life example of it. I don't know to what extent it affects people, but I think it's impossible to completely discredit it. I wouldn't say (when they're at the Apple Store) kid goes to mom and says "Mom I want one". Mom says no. Then kid says "but mom... Steve Jobs' story"... Mom changes her mind...

I'm thinking more along the lines of: Human, at one point or another, before ever purchasing their first iWhatever, learns or hears about the Steve Jobs' story, which symbolizes something bigger than themselves. An idea they want to, in some small way, be a part of.

Also, I wouldn't say the story necessarily captivates people in the US as much because we are "living the dream" so to speak being here. But for most of the world it is only an idea that is at least an ocean away.

I don't think it's correct to say that just because alot of a certain product has been purchased that means it can't be a status symbol. Regardless, 500M is still only about 15% of the world population, and I think it would be an oversight to think that 500M number represents completely unique individuals.


I think this graphic shows how one could still perceive iPhone as a status symbol. 1 billion looks like small potatoes on the global scale:

http://www.idc.com/prodserv/smartphone-market-share.jsp


Finding novel ways to make stuff crash can be fun, open source or not.


Because not everyone has rigid beliefs about what the correct software license is. Because people like to help. Because a lot of software engineers make enough money in their career that they don't mind doing things for free. Because people use Swift daily and are frustrated by running into the same issue over and over again. Because people like Apple and want to be a (small) part of it. Because helping to identify test cases publicly (and thereby showing you don't just bitch and moan about issues, but pitch in to fix them) on Github looks great on a cover letter.

Just a couple I thought of right quick like.


As just another app developer, I would like to thank the contributors for volunteering their time to help us all out.


Swift 1.2 was released in Xcode 6.3 beta today.

PracticalSwift tweeted this : https://twitter.com/practicalswift/status/564919949995802624

"5043 crashes before Xcode 6.3 - 1314 crashes fixed (26 %) - 2896 crashes now marked as dupes (57 %) + 10 regressions (0 %) = 843 left (17 %)"


It's very interesting project. It seems that many people are interested in Swift. I am still using Objective-C for my App Store apps to avoid those kinds of weird things.


why don't people just fix the compiler instead? Oh wait...

Cool project though. I hope Apple takes notice.


Would you really want a frustrated hack from a sleep-deprived developer whose main job is not building compilers?

I'd rather have a team of people paid to work on the issues full time handle the problems and build solutions, but maybe that's just me.


I love how it's either a frustrated hack from a sleep-derived developer or a paid team. How about a patch from someone who's better at building compilers than the core team, even though he doesn't work for that company? Or how about the frustrated hack that's reviewed by the core team and still gets the feature out faster?


Just to be circumspect, Apple's main business isn't building compilers. Their business unit which does so appears to derive some of its mandate from management's aversion to copyleft licensing. The business case for the Swift compiler is not to be the best alternative in a diverse market place but to provide tooling better than objective-C for bespoke iOS and OSX development. It falls somewhere between an inhouse application and a product for the open market.

I'm not saying there is anything wrong with that. I am only extending the line of reasoning in the comment up an abstraction layer.


I would wager that most of the people that put the time to put these test cases together also get paid to handle these problems and build solutions. It's a giant misconception that open source is written by a bunch of hobbyists in their spare time on the weekends.

Most open source gets written by professionals employed to build something, and the open source work is part and parcel to their day job. I send patches upstream to the open source libraries and tools I use all the time. This is all happening while my employer is paying me to be on the job, and in fact is heavily supported by my employer.


Oh, so that's why all open source software is terrible?


Are there any good (not too ranty) posts on the state of the quality, usability, overall viability of the Swift compiler right now?


I've used Swift to make a basic keyboard framework[1] and I've found it to be extremely crashy and unstable, even in the latest versions. Also, certain Xcode features don't work in it (such as refactoring). Incredibly frustrating. With that said, I love the language, so it's almost worth the pain.

[1]: https://github.com/archagon/tasty-imitation-keyboard


This probably falls on the rant side, but it does show that companies are using Swift:

http://appleinsider.com/articles/15/02/07/apples-new-swift-p...




Consider applying for YC's first-ever Fall batch! Applications are open till Aug 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: