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 and Go: Building a Fast Future

90 pointsby rohamgover 10 years ago

10 comments

Roboprogover 10 years ago
As much as I dislike that most of the &quot;language shootout&quot; benchmarks are mostly numeric wanking, the binary tree benchmark actually makes, uses and disposes of quite a few data structures, and seems more like a real application program to me.<p>Go isn&#x27;t yet faster than Java, but it is closing the gap, at least on multi-core: <a href="http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?test=binarytrees&amp;lang=all&amp;data=u32q" rel="nofollow">http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u32q&#x2F;benchmark.php?t...</a><p>Single core doesn&#x27;t fare so well (Go vs Java), though: <a href="http://benchmarksgame.alioth.debian.org/u32/benchmark.php?test=binarytrees&amp;lang=all&amp;data=u32" rel="nofollow">http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u32&#x2F;benchmark.php?te...</a><p>Perhaps the authors should have used Rust, or Ada, rather than Go? Hell, on a single CPU machine, FreePascal seems to do better than Go :-)<p>Actually, from a &quot;performance, w&#x2F;out turning off all the safeties&quot; standpoint, it really looks like Rust is owning that space.<p>Now I gotta learn Rust... :-)
评论 #8626233 未加载
评论 #8626869 未加载
评论 #8627651 未加载
bsaulover 10 years ago
Just trying go for some real project, and frankly i wouldn&#x27;t use it for anything else but network-related middleware ( or low level services), which is what i&#x27;m using it for, and almost every tutorial i&#x27;ve read about this language mentions.<p>As long as you&#x27;re building something very technical, everything&#x27;s fine. But once you go out of this path, you can see the walls getting dangerously closer. For example, i was surprised to see how many runtime errors i got while coding, for a statically typed language. Surprised as well to see that error checking made me wish for a goto statement again ( what&#x27;s the pattern for handlings all errors in a block with the same code ? Please tell me..) Then i started to code against a sql db, and boy did it bring me old memories back. Manual transaction scope handling ( annotation where are thou ?), manually counting bound variables in a statement, finding mismatched types between nullable ones and regular ones.... What a mess...<p>Now it <i>may</i> only be a matter of waiting for advanced librairies to mature, but somehow i doubt it.
评论 #8628784 未加载
评论 #8628135 未加载
twicover 10 years ago
&gt; I&#x27;m pretty darned sure that Rob Pike (creator of Go) and Chris Lattner (creator of Swift) know a few things about computer languages that the rest of us haven&#x27;t sussed out yet. If these guys think the world needs a new language, it&#x27;s worth finding out why. (And if you do know more about programming languages than these two? Well, it&#x27;s honor to have you reading my article, Mr. Wall!)<p>Larry Wall is the <i>ne plus ultra</i> of programming language design. This is satire, right? Please tell me this is satire.
评论 #8626589 未加载
评论 #8626539 未加载
评论 #8627249 未加载
coldteaover 10 years ago
&gt;<i>By now, you may be asking yourself why we would choose to use such nascent languages in a production environment.</i><p>No, we realy are not. If anything, both are quite safe bets.<p>Swift had been in secret development for years and came out almost fully formed (as far as languages go), with a full API, tooling, documentation, etc. Besides it&#x27;s the Apple blessed way to do things on iOS going forward.<p>As for Go, everybody and its dog are using it for production, left and right. Including very big names. It&#x27;s pretty much a given that the language is already production-proven, and will do well in the future.
评论 #8627213 未加载
Jokyover 10 years ago
Yes! Two modern languages that are 1) statically typed and 2) statically compiled. At least some people still get it that &quot;modern&quot; and &quot;nice to use&quot; does not implies scripting-like dynamically-fancy typed language &quot;à la&quot; PHP&#x2F;Python&#x2F;Javascript&#x2F;... And the author did not mention Playground for Swift which is just incredibly useful to start experimenting with the language! (Edit: of course Rust is another one as well, but I was in the context of the article)
评论 #8625974 未加载
gnufiedover 10 years ago
I have been playing a lot with QML lately and I am loving what I see there. Their approach of animations or graphics seems simple and very approachable - <a href="http://qmlbook.org/ch05/index.html" rel="nofollow">http:&#x2F;&#x2F;qmlbook.org&#x2F;ch05&#x2F;index.html</a> .<p>The reason I bring this up is, while I like swift (and own more than one macbook pro), I can&#x27;t bring myself to code for a platform which ties myself further with Apple eco system.<p>If you are looking to build a cross platform 2D game for Android&#x2F;iOS&#x2F;OSX&#x2F;Linux - QML seems like a very good choice.
nathan_f77over 10 years ago
Hi @rohamg, I was wondering if you could please share the libraries and frameworks you are using? I&#x27;m also building a mobile app in Swift with a web backend in Go. I&#x27;ve done a bit of research, and I think I&#x27;m going to use the following:<p>iOS:<p>* MagicalRecord - CoreData abstraction (<a href="https://github.com/magicalpanda/MagicalRecord" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;magicalpanda&#x2F;MagicalRecord</a>) * mogenerator - better CoreData class management (<a href="https://github.com/rentzsch/mogenerator" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rentzsch&#x2F;mogenerator</a>) * RestKit - with REST API endpoint (<a href="http://restkit.org/" rel="nofollow">http:&#x2F;&#x2F;restkit.org&#x2F;</a>)<p>Go:<p>* Gin - Web framework. I really like the focus on performance, and that it seems to include all the features you need for an API (authorization, route grouping, etc.) (<a href="https://gin-gonic.github.io/gin/" rel="nofollow">https:&#x2F;&#x2F;gin-gonic.github.io&#x2F;gin&#x2F;</a>) * gorm - for most CRUD operations &#x2F; queries (<a href="https://github.com/jinzhu/gorm" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jinzhu&#x2F;gorm</a>) * sqlx - for more complex queries (<a href="https://github.com/jmoiron/sqlx" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jmoiron&#x2F;sqlx</a>) * apns - push notifications (<a href="https://github.com/anachronistic/apns" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;anachronistic&#x2F;apns</a>) * gingorelic - New Relic integration (<a href="https://github.com/q1t/gingorelic" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;q1t&#x2F;gingorelic</a>) * APIBlueprint - API documentation (<a href="http://apiblueprint.org/" rel="nofollow">http:&#x2F;&#x2F;apiblueprint.org&#x2F;</a>)
评论 #8630347 未加载
notduncansmithover 10 years ago
How does a language without generics claim to &quot;do more with less code&quot;? Don&#x27;t get me wrong, I like Go, but it&#x27;s hard to get behind any language with that low of an abstraction ceiling. Then again, I work in a web shop, building CRUD apps for a living, so maybe it doesn&#x27;t matter for people who only have to build one version of something.
评论 #8626482 未加载
评论 #8626149 未加载
评论 #8627299 未加载
评论 #8626209 未加载
yvsongover 10 years ago
Which database do you Go for? Is the driver production ready?
评论 #8627496 未加载
评论 #8627217 未加载
Dewieover 10 years ago
&gt; Go compiles very quickly, but that actually didn&#x27;t impact us very much since we have largely been using interpreted languages on the backend. I&#x27;ll betcha those poor Java programmers get pretty excited about this, though!<p>Oh?
评论 #8626190 未加载