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.

Using Rust with Elixir for code reuse and performance

121 pointsby NiklasBegleyover 3 years ago

4 comments

Zababaover 3 years ago
&gt; Unsurprisingly, Rust outperforms Elixir by 2 orders of magnitude.<p>That seems very surprising to me. Is this a common result? I&#x27;ve heard that the BEAM is not the best for &quot;number crunching&quot; code, is this one of those scenarios? Is this really just the raw performance of the languages, or a difference in algorithms? There&#x27;s also no mention of the version of Elixir and the OTP. Did the JIT change anything?
评论 #28237702 未加载
评论 #28241785 未加载
nickjjover 3 years ago
I wonder if they looked into using <a href="https:&#x2F;&#x2F;github.com&#x2F;asaaki&#x2F;cmark.ex" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;asaaki&#x2F;cmark.ex</a> which is an already made Markdown Elixir NIF written in C. No glue code needed since the package already exists.<p>Back when I was writing Elixir, it&#x27;s what I used to process Markdown and it was also substantially faster than the native Elixir Markdown library (Earmark).
评论 #28235216 未加载
评论 #28234239 未加载
评论 #28234671 未加载
评论 #28234188 未加载
latchover 3 years ago
One thing to keep in mind is that even the simplest Rust NIF will significantly slow your builds and increase your repo&#x2F;artifact sizes.
评论 #28236680 未加载
评论 #28236872 未加载
评论 #28241214 未加载
bb1234over 3 years ago
For someone who does not know much about NIFs, will it be a lot slower if the Rust service is coded as a command line application and then invoked using System.cmd? Is that a good alternative?
评论 #28237223 未加载