TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

I rebuilt my algorithmic trading platform in Rust. I'm filled with regret

49 点作者 beefman11 个月前

15 条评论

palata11 个月前
I am not a Rust fan by any mean, but it feels like this rant is not completely informed. Things like:<p>&gt; Just give me a garbage collector, and let me do what I want to do!<p>and<p>&gt; But when compared with other languages (like Go), its “safety” to me is more of a detriment.<p>Sound like the author is not exactly clear about what &quot;memory safety&quot; is. Many languages are memory safe. The difference is that Rust aims for memory safety at zero (in practice &quot;very low&quot;) cost. If garbage collected languages could do that without sacrificing their simplicity, they would do it.<p>It&#x27;s a tradeoff. If Kotlin is fine for you in terms of performances, then use it! Rust is rather an alternative for C&#x2F;C++, where performance matters. Feel free to use Rust wherever you want if you love it, but don&#x27;t use it when performance does not matter if you hate it!
评论 #40822311 未加载
评论 #40822306 未加载
tossandthrow11 个月前
&gt; one of the safest<p>This seems to be a severe misunderstanding, basically all typed pure functional languages are more safe: haskell, sml, ocaml, etc.<p>It is safe without a garbage collector that is the core benefit.
评论 #40822225 未加载
steveklabnik11 个月前
There has been some uh, lively discussion about this post on various reddits since yesterday.<p>The author said<p>&gt; I wanted to try writing the article in an inflammatory style for engagement.<p>but to respond to some of the things claimed, for anyone curious:<p>&gt; Just give me a garbage collector, and let me do what I want to do!<p>This is absolutely a reasonable opinion to have, but it means Rust was just not the correct choice. That doesn&#x27;t mean Rust is bad.<p>&gt; Maybe I’m just an idiot and can’t figure out how to enable stack traces. But when an error happens in my application, I have no idea why!<p>Panics have an environment variable you can set to print a stacktrace. You can also grab a stacktrace yourself with the tools in std::backtrace, and many error libraries like anyhow will let you capture backtraces for Results. However, part of the pain the author is feeling here is that instead of using error objects directly, their example code shows them converting them to strings and then returning them that way. This is going to make figuring things out harder, but that&#x27;s because you&#x27;re not using the tools given.
评论 #40823608 未加载
shepardrtc11 个月前
I built an algorithmic trading platform in Python and used Cython to speed up the hotspots. No regrets.
评论 #40823612 未加载
CrimsonCape11 个月前
I&#x27;m curious as to the lifetime annotations. This is essentially the language designer&#x27;s intent to say &quot;place a marker on this data field such that the compiler can trace the usage of the field to insure it is not accessed (before,after) the memory is released.&quot;<p>Therefore, the lifetime is expressed via an additional abstraction requiring the associated language syntax, compiler design, additional rulesets, etc.<p>Why would the same concept not be expressible as it&#x27;s own data type, that would then be passed as data? In this case, you remove the additional abstraction. It seems like Jai is going that route, where you pass an arena type instance around and interact with it.
评论 #40823181 未加载
glzone111 个月前
I think this omits one item that can be relevant. It talks about rust being fast. Rust can be quite slow to compile. If development velocity is relevant, then Rust may not be as &quot;fast&quot; as go to compile as an example. Of course, some folks are chasing speed at all costs (and spending 18 months re-writing to do so). Rust may be a good fit there.
ergonaught11 个月前
I do not understand taking so long to arrive at these conclusions. Each of them smacks you in the face pretty quickly if they bother you, so it&#x27;s strange to invest so much time before deciding they are rant-worthy.
taylodl11 个月前
<i>&gt; If we compare it to C++, it’s obviously the better language.</i><p>It really depends on what is meant by &quot;better.&quot; The thing I like about C++ is its problems are well-known as is how to work around them. The thing that concerns me about Rust is we don&#x27;t know all its problems - in practice. We will eventually, sure.<p>Sometimes I don&#x27;t think we pay enough attention to how much our collective experience with a language matters.
评论 #40822960 未加载
j16sdiz11 个月前
I hate rust, but I think this article is unfair because the author has got his expectation wrong.<p>I meant, he is comparing that to pythons and typescript?
jvanderbot11 个月前
&gt; Just give me a garbage collector, and let me do what I want to do!<p>Yes - a clear sign you have not found a good application for safety, security, and low-level control vs developer speed. Systems, safety critical, embedded, etc.<p>Why it expanded beyond this is not clear to me, other than hype and falling into a gaping void in distributed systems development that Go never filled for some reason.
playingalong11 个月前
The comment about Rust community being unfriendly (well, the words used are harsher than this) might be specific to Reddit sub.
评论 #40823638 未加载
VHRanger11 个月前
I programmed in C++ before, mostly doing high performance stuff. Like anyone who used C++ for a while, I had issues with the language. Here are why I dislike it:<p>1. Compile times. There&#x27;s a big difference in user experience between &lt;10sec and &gt;30 sec between clicking &quot;build&quot; and getting feedback on what mistakes you made.<p>Above 15-20 seconds I tend to shift my focus to something else. This means when I read the error message I have to context switch back to the task. The productivity gains from fast builds (Go, D, or even Python to be honest) are immense in my experience.<p>2. The syntax is bad. It&#x27;s rare to have a meaningful line of code with fewer than 70-90 characters. Your eyes go horizontally as well as vertically. There&#x27;s a lot of coginitive overhead in learning which stuff to skip reading, because it&#x27;s boilerplate or language quirks.<p>3. Building C++ is nonsense, everyone has their own different solution, so getting external libraries into a project that aren&#x27;t header only is hell. And header only libraries make problem #1 even worse.<p>C++ being insecure is not my problem. Rust focuses hard on that thing which is not my problem, but Rust puts little focus on problems #1 and #2. They do solve problem #3, they have a package manager, great, but every other language also does that so it&#x27;s not a competitive advantage for me.<p>I seriously doubt if most people listed their priorities with languages they would align with Rust&#x27;s. Few people are actually writing linux kernel code or core system libraries that could expose dangerous memory bugs.
评论 #40822673 未加载
评论 #40822316 未加载
Gepsens11 个月前
Why is the level so low in software engineering in general? Well, at least I know I&#x27;ll never be out of a job.
manaskarekar11 个月前
The example author shows as unreadable is perfectly readable to me.
评论 #40822322 未加载
评论 #40822310 未加载
piker11 个月前
Between endless builder patterns and the let if&#x2F;match syntax it does get quite wide and ugly relative to C or something. But it definitely has its upsides.