TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Swift vs. Go

37 pointsby supsterabout 9 years ago

11 comments

pkalerabout 9 years ago
The list doesn&#x27;t mention optionals in Swift. Optionals are a substitute for nil&#x2F;NULL and handle the absence of a value in a type-safe manner. It is similar to the Maybe type in Haskell.<p>(BTW, if you&#x27;re interested in Swift, I send a weekly newsletter at <a href="http:&#x2F;&#x2F;swiftnews.co" rel="nofollow">http:&#x2F;&#x2F;swiftnews.co</a>)
评论 #11408601 未加载
评论 #11408429 未加载
评论 #11408392 未加载
评论 #11408434 未加载
r0flsabout 9 years ago
Is Swift a general purpose language? I thought it was for iOS and Mac development. I understand it is open source, but so is C#, and I don&#x27;t see a lot of people using that outside of Windows (I could be wrong though).
评论 #11408415 未加载
评论 #11408499 未加载
评论 #11408366 未加载
评论 #11408652 未加载
评论 #11408419 未加载
halosghostabout 9 years ago
&gt; inferred strong static typing<p>“strong” compared to what? Go&#x27;s duck-typing actually makes it weaker than a lot more type systems than you might expect, and compared to something like Haskell or Rust, both of these type systems are incredibly weak. If you&#x27;re comparing to C, then sure, but “strong” and “weak” typing mean nothing without reference to another language.
评论 #11408323 未加载
评论 #11408467 未加载
评论 #11408636 未加载
评论 #11408452 未加载
stcredzeroabout 9 years ago
I just got out of a work presentation on new features in C++11 and C++14. The two presenters went into what&#x27;s apparently the standard debate about noexcept. This makes me appreciate Go&#x27;s pragmatic decision not to have exceptions! When you start getting into the nitty-gritty and epiphenomena around implementing APIs, multiple return values with error codes looks pretty darn good.<p>Error codes are explicit and devoid of implicit automagic. You&#x27;re not going to break a lot of contracts and alter semantics by adding a keyword. The error codes are explicitly part of your function signature, in the most stupidly straightforward way possible. If you&#x27;re going to be a bad developer and ignore error codes, this is going to appear explicitly in your code. (As opposed to being rewarded with &quot;cleaner&quot; code when you sweep exceptions under the rug.)
评论 #11412156 未加载
评论 #11409228 未加载
Apocryphonabout 9 years ago
Would Kotlin be a better comparison to Swift, given they&#x27;ve both got huge potential for writing mobile apps?
评论 #11408644 未加载
pbnjayabout 9 years ago
I&#x27;d argue optionals are just a variation of Go&#x27;s interfaces (e.g. io.Reader versus io.ReadCloser)... and enums are basically typed constants in Go (you just don&#x27;t see the name &quot;enum&quot; anywhere).
评论 #11408786 未加载
评论 #11408735 未加载
评论 #11408962 未加载
评论 #11408780 未加载
jorgecastilloabout 9 years ago
&gt;I hope they take a look at Swift as it matures in the next few years.<p>Maybe when binary packages are available for non Ubuntu Linuxes?
评论 #11408228 未加载
评论 #11408281 未加载
pcwaltonabout 9 years ago
It&#x27;s important to not only take compilation speed but also code quality into account. Swift and Go made very different tradeoffs here with SIL+LLVM compared to Plan 9.
评论 #11408710 未加载
vram22about 9 years ago
Only looked at Swift a little so far, but liked something about the syntax.<p>Seems clean.<p>Going to check it out more over time. Hope the Linux support improves.
ngrillyabout 9 years ago
What do you mean by &quot;scripting mode&quot;?
sdegutisabout 9 years ago
Off topic rant about Svbtle: While browsing the article, I hovered my mouse over something, which told me to hold still, and then suddenly it gave the article an irreversible upvote, which I certainly never intended to give. Now that poor author thinks another person liked the article. Who knows, maybe all previous 12 upvotes were the same situation?<p>Can we go back to Web 1.0 please? Everything was simple, everything worked, everything was <i>fast</i>. Or at least can we compromise and have a few reasonable design choices from Web 2.0 and Web 3.0 merged back in with Web 1.0, and just go with that? The current Web is just too broken, but there&#x27;s nowhere to file a bug report.
评论 #11408954 未加载
评论 #11408275 未加载
评论 #11408249 未加载
评论 #11408333 未加载
评论 #11408564 未加载
评论 #11408276 未加载