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.

Rust as a gateway drug to Haskell

358 pointsby miqktalmost 8 years ago

15 comments

slaymaker1907almost 8 years ago
Something that I found about going from Haskell to Rust was that Rust provides many powerful abstractions without compromising on performance. It was very frustrating to try reasoning about performance in Haskell due to its laziness. Every language has quirks about how to write performant code, but Haskell is notorious in my mind for being quite easy to write obscenely slow code in.
评论 #14550983 未加载
评论 #14551083 未加载
评论 #14551020 未加载
评论 #14551015 未加载
评论 #14554178 未加载
评论 #14551891 未加载
评论 #14551046 未加载
评论 #14550917 未加载
评论 #14558542 未加载
评论 #14551866 未加载
评论 #14553438 未加载
评论 #14559193 未加载
评论 #14551551 未加载
评论 #14553329 未加载
评论 #14552892 未加载
评论 #14551667 未加载
评论 #14552458 未加载
评论 #14554679 未加载
评论 #14553182 未加载
le0nalmost 8 years ago
Haskell&#x2F;GHC will soon have an extension for linear types, which will bring the languages much closer: <a href="http:&#x2F;&#x2F;blog.tweag.io&#x2F;posts&#x2F;2017-03-13-linear-types.html" rel="nofollow">http:&#x2F;&#x2F;blog.tweag.io&#x2F;posts&#x2F;2017-03-13-linear-types.html</a>
评论 #14551216 未加载
评论 #14553387 未加载
toprerulesalmost 8 years ago
The similarities are striking. Both have a problem with undocumented or experimental modules for everyday tasks, both use compiler plugins to make sure that every package is using its own superset of the language (although in Rust this only applies to nightly), both tout lofty goals while rarely producing production grade systems. Rust is the first toe dip into the world of blog posts heralding the&quot;coming of the age of reason&quot; when we all see the error of our ways for writing dangling pointer references and impure functions. To be a complete cynic, I hope Rust runs right away from over generalized abstractions and the Haskell indifference to achieving real success by overcomplicting even the most mundane of problems.
评论 #14551977 未加载
评论 #14552322 未加载
评论 #14551869 未加载
评论 #14551232 未加载
评论 #14551622 未加载
评论 #14551236 未加载
vesakalmost 8 years ago
I wonder if Idris could some day take Haskell&#x27;s place. It sports default eager evaluation. Seems like the tooling (package managers etc.) isn&#x27;t quite there yet, though.
评论 #14552989 未加载
评论 #14553085 未加载
kbutleralmost 8 years ago
Isn&#x27;t the most significant line: &quot;For work-related reasons, I had to recently get up to speed on programming in Haskell&quot;?<p>I was somewhat disappointed not to have a followup to what work-related reasons there might be. Note also that the About page says &quot;work at Facebook&quot;.
评论 #14557790 未加载
sandGorgonalmost 8 years ago
I have heard the same thing about Kotlin now - <a href="https:&#x2F;&#x2F;hackernoon.com&#x2F;kotlin-functors-applicatives-and-monads-in-pictures-part-1-3-c47a1b1ce251" rel="nofollow">https:&#x2F;&#x2F;hackernoon.com&#x2F;kotlin-functors-applicatives-and-mona...</a>
评论 #14553253 未加载
leshowalmost 8 years ago
I have found them to be very similar too. I started learning Haskell in earnest last September, following along with the exceptional &quot;Haskell: First Principles&quot; which I highly recommend. I had been toying with Rust around this time and I found a confluence of ideas between the two languages. Most things I learned in Haskell I was able to carry over to Rust.<p>The inverse was not quite as true. But I still love Rust. Any time I need something performant, or I just want to play around, it&#x27;s my first choice.
asdfaoeualmost 8 years ago
&quot;the legacy C++&quot;<p>Interesting reading but the author seems intent on pushing some buttons.
评论 #14551138 未加载
评论 #14556122 未加载
spullaraalmost 8 years ago
Maybe the other way around.
allengeorgealmost 8 years ago
The article references using trait objects for dynamic dispatch. FWIW, I found them extremely limited: you can&#x27;t use generics, can&#x27;t return Self... I wonder how often people use them.
评论 #14552156 未加载
pjmlpalmost 8 years ago
&gt; More advanced type systems, however, allow to specify the generic constraints explicitly.<p>Well, Java allows it, even if it looks a bit unglier than the Rust example.<p><pre><code> &lt;T extends Comparable&lt;T&gt;&gt; T min (T a, T b) { if (a.compareTo(b) &gt; 0) { return b; } else { return a; } } </code></pre> And even without general availability of concepts (already in gcc 6.x), one can achieve it in C++ via <i>if constrexpr</i>.
评论 #14551197 未加载
v0ltaalmost 8 years ago
That&#x27;s the most HN post title in a while
timwaaghalmost 8 years ago
i imagine they both provide a similar hipster code high. while being fairly hard to do something useful in or make money with.
decafbadalmost 8 years ago
Rust and Kotlin destroy any previous claims about practical usages of Haskell.
评论 #14551668 未加载
评论 #14551617 未加载
评论 #14551786 未加载
partycoderalmost 8 years ago
Rust still allows imperative programming whereas Haskell doesn&#x27;t. This makes a big difference.<p>Rust is closer to Alan Turing than it is to Alonzo Church.
评论 #14551141 未加载
评论 #14551124 未加载
评论 #14551168 未加载