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 for Clojurists

151 pointsby lshabout 8 years ago

9 comments

hacker_9about 8 years ago
Good article. He missed out the main pro though (and literally the only reason I ever use any Lisp): hot swapping. The ability to change code on the fly as the program is running. For this to actually work you need 2 things:<p>1. No explicit types: Everything in Clojure is just a list or hash map, so I can add extra members to anything at runtime no problem. The amount of static checks Rust does at compile time makes this non viable.<p>2. Fully immutable data structures: If my changes cause exceptions, then the program can just rewind and throw away the new state it was building, let me fix the error I made, and then continue on as if I never committed the broken code. In Rust an exception would mean I&#x27;ve potentially mutated state in a bunch of places, and now can&#x27;t get back to the previous working state at all.
评论 #14226567 未加载
评论 #14226366 未加载
评论 #14230734 未加载
评论 #14226361 未加载
评论 #14229019 未加载
charlieflowersabout 8 years ago
+1 for this gem right here. Well done!<p>&quot;Many people try to compare Rust to Go, but this is flawed. Go is an ancient board game that emphasizes strategy. Rust is more appropriately compared to Chess, a board game focused on low-level tactics. Clojure, with its high-level purview, is a better analogy to the enduring game of stones.&quot;
评论 #14227446 未加载
1_playerabout 8 years ago
&gt; Rust chose to call its [package] format &quot;crates&quot;. This reflects the language&#x27;s industrial roots and the humble, blue collar town of its sponsor: Mountain View, California.<p>Nice :)
评论 #14227027 未加载
delegateabout 8 years ago
Some funny gems:<p>&gt; You will remain a replaceable silhouette with no discernible identity.<p>&gt; This isn&#x27;t C or C++, where you just include files like a caveman.<p>&gt;The upside is, you will curse it at compile-time instead of at runtime. The downside is, &quot;exploratory programming&quot; means exploring how to convince the compiler to let you try an idea.<p>After that it gets a bit more serious, but still a very good Saturday afternoon read.
zcdziuraabout 8 years ago
&gt; You&#x27;re in an industry reaping disproportionate benefit from loose money policies, leading to a trend-chasing culture of overpaid nerds making web apps. You feel guilty about this, but there is nothing you can do about it because you have no other talents that a rational person would pay you for.<p>&#x2F;r&#x2F;2meirl4meirl<p>But in all seriousness, this was a great article and an exceptionally fun read!
StreamBrightabout 8 years ago
Nice. My biggest problem with Rust is the poor performance and lack of complete &amp; sane libraries, especially for HTTP.<p>I was running into serious issues with the following code:<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;l1x&#x2F;5678c0fdfc2c1a6034b8bcc3800de93c" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;l1x&#x2F;5678c0fdfc2c1a6034b8bcc3800de93c</a><p>Its performance is saturated around 60K req&#x2F;s on a 32 core box with 10G networking while wrk was more than happy to do 3M req&#x2F;s. I was trying to dig further into why it is slow and it seems that hyper is the culprit. However, I was not able to come by this issue and just used wrk2 for testing. Let me know if anybody has insight into how to go beyond this perfroamance or what are the issues with my code.
评论 #14227330 未加载
评论 #14227341 未加载
评论 #14227369 未加载
评论 #14227286 未加载
edemabout 8 years ago
They are called __clojurians__.
评论 #14226133 未加载
coldteaabout 8 years ago
While I understand this kind of guide (showing how things are done in one language&#x2F;ecosystem vs another), is there such a thing as a Clojurist that would have benefited from it?<p>I&#x27;m not asking whether there are Clojurists. Of course there are.<p>I&#x27;m asking whether there are people that primarily and only know Clojure, and thus would benefit from a translation guide between Clojure and Rust, instead of say between C or Java or Python or Ruby etc and Rust.<p>I&#x27;d think that anybody who uses Clojure was already familiar and&#x2F;or proficient in some other language before, much more major than Clojure.
评论 #14227319 未加载
评论 #14227401 未加载
评论 #14227684 未加载
akhilcacharyaabout 8 years ago
Not even a clojurist, but this is the best Rust intro I&#x27;ve seen so far.