Comment

Comment by tptacek

I really don't see the Golang influence at all. The multiple- return- value semantic is closer to Ruby's than to Golang's; you're returning a tuple, which happens to have natural syntax in the language.

Defining Golang features that don't exist in Swift:

- Interface types with implicit adoption (Swift takes explicit protocols from ObjC)

- Error types

- Relatedly, the "damnable use requirement" and its interaction with error types and multiple value returns (ie, the reason Golang programs in practice check errors more carefully than C programs).

- Slice types

- Type switching (though, like Golang, it does have type assertions)

- "defer"

- Of course, CSP and the "select" statement.

Swift features that don't exist in Golang:

- Generics

- Optionals

- A conventional, full-featured class-model

Of the languages you could compare Swift to, Golang seems like one of the biggest reaches. Even the syntax is different.

(I like what I've read about Swift and expect to be building things in both Golang and Swift, and often at the same time).

parent tptacek 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton