Live data from Hacker News

Chris Lattner on the Realm WWDC 2017 Swift Panel

oleb.net

11–20 of 120 posts

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#11
post #10

> What irritates me is when people say classes are bad. Or subclassing is bad. Thatʼs totally false. Classes are super important. Reference semantics are super important. If anything, the thing thatʼs wrong is to say, one thing is bad and the other thing is good. These are all different tools in our toolbox, and theyʼre used to solve different kinds of problems. Couldn't agree more

The issues with inheritance based OOP are that it fits very few problems well, that it usually causes lots of problems and that many programming languages only have inheritance based OOP in their toolbox.

Java is the extreme case of this. Patterns like abstract visitor factories are hacks to express situations that cannot be expressed in an obvious way.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#14
post #8
post #5

Earlier quoted context omitted.

That feature size is why Swift is so scalable. Writing useful programs is easy to do for beginners with a very limited subset of the language. But as you expand your knowledge Swift is rich with features that make complex apps much easier to write for professionals.

I don't think the problem with a large syntax is for writing - it's for reading . What happens when those same beginners are thrust into a professional production codebase and struggle to figure out what's going on? It's interesting to note that Google has taken the deliberately opposite approach with Go: small syntax, learn 90% of the language's ins-and-outs in a few weeks, so that the average fresh college grad Goo…

Indeed, there is a debt to Go's simplicity:

https://dave.cheney.net/2017/06/15/simplicity-debt https://dave.cheney.net/2017/06/18/simplicity-debt-redux

And slowly, the language is expanding in very obvious conclusions.

Personally, I think there needs to be a balance in a language, where it should not be too restrictive in its syntax, but on the other hand, it should not be overly complex and has too much syntax. I am on the fence with Swift, but it does seem to come on the complex side.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#15
post #9
post #8

Earlier quoted context omitted.

I don't think the problem with a large syntax is for writing - it's for reading . What happens when those same beginners are thrust into a professional production codebase and struggle to figure out what's going on? It's interesting to note that Google has taken the deliberately opposite approach with Go: small syntax, learn 90% of the language's ins-and-outs in a few weeks, so that the average fresh college grad Goo…

There is some truth to what you are saying. I'm not a beginner so I probably can't appreciate how hard it is to learn new syntactical features. My experience is I've found it pretty easy to learn new ones from my peer's code, but I struggle with actually forcing myself to teach myself new and more complex language features when the existing ones work so well for me. I'd say Swift is probably harder to learn than it c…

I have to wonder if pandering to "fresh college grad" only is the way forward with new languages. We were once beginners - did you see challenges when you were studying the languages you are now fluent in?

I have a feeling like the computer world is being torn between two extremes - either go all-out complex or "think of the children" simple approach. Not just in programming languages, but in software development in general. If forced to pick out of those two, my personal preference would be the complex, but I would like to see a middle ground of "moderate" technologies.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#16
post #10

> What irritates me is when people say classes are bad. Or subclassing is bad. Thatʼs totally false. Classes are super important. Reference semantics are super important. If anything, the thing thatʼs wrong is to say, one thing is bad and the other thing is good. These are all different tools in our toolbox, and theyʼre used to solve different kinds of problems. Couldn't agree more

The issues with inheritance based OOP are that it fits very few problems well, that it usually causes lots of problems and that many programming languages only have inheritance based OOP in their toolbox. Java is the extreme case of this. Patterns like abstract visitor factories are hacks to express situations that cannot be expressed in an obvious way.

> The issues with inheritance based OOP

Inheritance is just one of multiple facets of safe code reuse in OOP. Aggregation, composition, encapsulation are as are much as fundamental notions in OOP as inheritance. So i think reducing OOP in general, and java in particular to "inheritance based OOP" is a miss characterization

> are that it fits very few problems well, that it usually causes lots of problems and that many programming languages only have inheritance based OOP in their toolbox.

Do you have any objective way to measure that ?

> Patterns like abstract visitor factories are hacks to express situations that cannot be expressed in an obvious way.

But isnt that the reason to have a pattern ? An easy way to expression a non obvious recurring situation ?

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#17
post #8

Earlier quoted context omitted.

I don't think the problem with a large syntax is for writing - it's for reading . What happens when those same beginners are thrust into a professional production codebase and struggle to figure out what's going on? It's interesting to note that Google has taken the deliberately opposite approach with Go: small syntax, learn 90% of the language's ins-and-outs in a few weeks, so that the average fresh college grad Goo…

Indeed, there is a debt to Go's simplicity: https://dave.cheney.net/2017/06/15/simplicity-debt https://dave.cheney.net/2017/06/18/simplicity-debt-redux And slowly, the language is expanding in very obvious conclusions. Personally, I think there needs to be a balance in a language, where it should not be too restrictive in its syntax, but on the other hand, it should not be overly complex and has too much syntax. I am…

Don't get me wrong, Go's simplicity comes with considerable tradeoffs and I'm not sure I'd use it in most cases again (started a greenfield codebase with it 3 years ago which is now around 200kloc).

Just pointing out that syntactic edge cases can make writing easy, but most of programming (beyond one-off scripts) isn't writing. See: Scala and C++. Companies using these languages in production frequently disallow entire subsets of syntax or language features because they're hard to maintain.

Balance certainly is key.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#19
Could someone explain why I should build a language developed entirely by and for writing Apple ecosystem products? It seems like if I'm not targeting MacOS or iOS directly, the long list of benefits suddenly looks much, much smaller compared to e.g. JVM, .NET, Go, etc etc.

"letʼs start hacking, letʼs start building something, letʼs see where it goes pulling on the string" feels scarily accurate, and it's unclear where the language will be in 5 years.

Among other things, there's no way to disable objective-c interop, even though it complicates the language and feels like someone merged smalltalk, C++, and ML—not a pretty combination. But—literally the only reason you'd enable that would be to work with Cocoa/UIKit.

I'm still out on ARC—it was much less of a problem than I expected on my last project, but it never feels like an optimal solution, and you can never just "forget about it for the first draft" the way you can a VM's GC.

Re: Chris Lattner on the Realm WWDC 2017 Swift Panel

#20
post #7

Interesting interview. Java is mentioned many times as language Swift aspires to replace. He is right about Kotlin: "Kotlin is very reference semantics, itʼs a thin layer on top of Java, and so it perpetuates through a lot of the Javaisms in its model. If we had done an analog to that for Objective-C it would be like, everything is an NSObject and itʼs objc_msgSend everywhere, just with parentheses instead of square…

For that to happen Swift needs to be usable at Java level in all OSes where JVM/JDKs (some of them with AOT support since the early days of Java) do exist.

I am still waiting for first class support on Windows on the download page.

Right now Rust has much better OS support than Swift.

Post reply on HN