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 Node developers

22 pointsby stevelacyalmost 9 years ago

2 comments

ilakshalmost 9 years ago
Didn&#x27;t really see a ton of substance in that, it seemed to mainly add up to a long-winded explanation of printing out a text file using two different languages in convoluted ways.<p>Here is my much shorter version of basically the same thing with a different language:<p>Nim for Node.js Programmers<p>I love Node.js programming, especially because of the massive ecosystem of modules available, but Nim has some advantages in many cases. Here are three: it uses very little memory, creates code that is very fast, and interfaces extremely easily with C and C++.<p>### Node.js<p>How to set up Node<p>Since you are a Node programmer, you already have it set up.<p><pre><code> const fs = require(&#x27;fs&#x27;); fs.readFile(&#x27;hello.txt&#x27;, &#x27;utf8&#x27;, (err, data) =&gt; { if (err) { console.error(&#x27;Problem reading file:&#x27;, err); } else { console.log(data); } }); </code></pre> How to set up an editor&#x2F;IDE<p>Since you are a programmer, you already set it up.<p>### Nim<p>Install Nim -- thoroughly explained here: <a href="http:&#x2F;&#x2F;nim-lang.org&#x2F;download.html" rel="nofollow">http:&#x2F;&#x2F;nim-lang.org&#x2F;download.html</a><p>Enter into readfile.nim:<p><pre><code> try: echo readFile(&quot;hello.txt&quot;) except: echo &quot;Problem reading file.&quot; </code></pre> Run command &#x27;nim c readfile.nim&#x27; then &#x27;.&#x2F;readfile&#x27;<p>### Package Management in Nim<p>The `nimble` command handles packages in Nim. Please read the excellent and thorough documentation here: <a href="https:&#x2F;&#x2F;github.com&#x2F;nim-lang&#x2F;nimble" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nim-lang&#x2F;nimble</a><p>For more information, see the great documentation at <a href="http:&#x2F;&#x2F;nim-lang.org&#x2F;documentation.html" rel="nofollow">http:&#x2F;&#x2F;nim-lang.org&#x2F;documentation.html</a>, the new book Nim in Action, <a href="https:&#x2F;&#x2F;www.manning.com&#x2F;books&#x2F;nim-in-action" rel="nofollow">https:&#x2F;&#x2F;www.manning.com&#x2F;books&#x2F;nim-in-action</a>, or many other resources online such as those listed here: <a href="http:&#x2F;&#x2F;nim-lang.org&#x2F;learn.html" rel="nofollow">http:&#x2F;&#x2F;nim-lang.org&#x2F;learn.html</a>
Yhippaalmost 9 years ago
After using Firefox for the first time in forever I noticed that I&#x27;m liking a lot of what Mozilla does to try to educate people on web development practices. I am curious as to how others find Rust to use in practice. Looking to augment my knowledge in Java with another language that&#x27;s quite different.