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.

In Rust, for memory, you don't pay as you go, everyone has to pay all the time

41 pointsby ghuntleyalmost 2 years ago

12 comments

dangalmost 2 years ago
This title broke the HN guideline: &quot;<i>Please use the original title, unless it is misleading or linkbait; don&#x27;t editorialize.</i>&quot; (<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsguidelines.html" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsguidelines.html</a>). On HN, it&#x27;s not ok to use the title field to point out what you think is important about an article. That&#x27;s one of the things we mean by editorializing.<p>Titles are by far the biggest influence on discussion. Most comments below are not about the article as a whole—just the cherry-picked bit of the article that the title singled out. Normally we&#x27;d change the title to e.g. &quot;The Future of Programming - Interview with Richard Eisenberg&quot; and remove the flags, but in this case the thread is already so skewed I don&#x27;t think we can.<p>If you want to say what you think is important about an article, that&#x27;s great, but do so by adding a comment to the thread. Then your view will be on a level playing field with everyone else&#x27;s: <a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=false&amp;sort=byDate&amp;type=comment&amp;query=%22level%20playing%20field%22%20by:dang" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=false&amp;so...</a><p>Edit: there&#x27;s an earlier submission <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=35993993" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=35993993</a> which I&#x27;ve just added to the second-chance pool (<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;pool" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;pool</a>, explained at <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26998308" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26998308</a>).
nu11ptralmost 2 years ago
This seems a bit unfair to me. The author is not entirely wrong, but it feels like they don&#x27;t give the full picture. The truth is in Rust you often don&#x27;t have to heap allocate at all and it is very good at avoiding this much of the time. Obviously, if building something like an AST in a parser, a naïve implementation is going to be calling the boxed allocator quite a bit which will have a lot of overhead, but for things like this I would just use an arena allocator (like bumpalo). So yes, sometimes you have to do a little more allocation, but I think it is greatly over stated. I do really like OCaml, however, and agree a compacting GC with bump allocator can be quite nice at times as well (and a compiler would probably be a good use case for one).
评论 #36000706 未加载
评论 #36000796 未加载
评论 #36000862 未加载
Waterluvianalmost 2 years ago
I’m not sure it’s fair to editorialize a title like that when sharing an hour-long podcast.<p>I’m curious about the claim being made but I’m being linked to a haystack.<p>Edit: it begins at 25:34.
评论 #36000553 未加载
dathinabalmost 2 years ago
I have been used both GCed language and Rust a lot and I can&#x27;t agree with the quoted put into the HN Headline here.<p>Sure rust borrow checker+move semantics are always there and you always have to cater to it.<p>But they _are not_ a memory management handling tool.<p>It&#x27;s more like a ownership control tool.<p>Which is used to get some decent semi-manual memory management, but also is used to provide some very neat concurrency guarantees, and many other forms of resource management.<p>E.g. you don&#x27;t need something like python `with` or java `try-with` it&#x27;s already there as part of the borrow checker&#x2F;move semantics for free.<p>So I would rephrase the quote to:<p>&quot;For reliable state handling, you don&#x27;t pay as you go, everyone has to pay all the time.&quot;<p>I did remove the &quot;in rust&quot; part because IMHO this is pretty much always the case (at least for real world non pet projects). Either your language helps with handling state to some degree, in which case you always pay some form of price for it. Or it doesn&#x27;t in which case you also pay a price for it due to it now being harder and much much more prone to get messy (in my experience guaranteed to get messy in most real world projects).<p>Through I&#x27;m never surprised if people focused on functional programming dislike rust: Because rust is _not_ a functional language, it only has many functional elements. But the moment you try write very &quot;functional&quot; style code in it, you can easily end up in a world of pain.<p>Certain common functional abstractions do not scale well if combined with the rusts ownership model (they still tend to work well in simple use-cases). Partially due to limitations of the current implementation&#x2F;language design. But also some aspects seem to be very hard to solve even on a conceptual level.
评论 #36001370 未加载
pjmlpalmost 2 years ago
Indeed, Rust is ideal for writing kernels, drivers, or getting more secure software in domains where people are religiously against any kind of automatic memory management system.<p>Other than that, there are better options in regards to productivity.
sudbalmost 2 years ago
This sounds to me like a new way of saying that languages with GC allow developers to move faster in very many cases than languages without GC which I think I largely agree with.
评论 #36000684 未加载
jbandela1almost 2 years ago
&gt; I think, first of all, that for a programming language to be effective, everything needs to be opt-in, right?<p>I disagree. You gain a lot by making things not-opt in. For example, strong typing. Strong typing really becomes powerful when everybody uses it. Another example, is purity and side effects. Purity isn’t really optional in Haskell.<p>Which brings another point: you could say that for side effects in Haskell, you don’t pay as you go, everyone has to pay all the time. You are basically forced to deal with the concepts of monads fairly if you want to write anything interesting.<p>Just like Haskell gets a lot of value in using the type system to encode side effects, Rust gets a lot of value in using the type system to encode ownership. Further, I would argue that the borrow checker provides value beyond memory usage, since a clear ownership model can have follow on effects for correctness and program organization.
评论 #36001239 未加载
tbillingtonalmost 2 years ago
Section relevant to the title starts at 25:34.
评论 #36000558 未加载
评论 #36000517 未加载
VWWHFSfQalmost 2 years ago
I actually don&#x27;t really think about memory all that much for most of the kinds of work that I do. RAII kinda just does it. His idea for optional GC for some data and manual memory management for other data is kinda interesting though.
评论 #36000644 未加载
评论 #36000593 未加载
评论 #36000609 未加载
Icathianalmost 2 years ago
Can we please get the title put back, the weird anti-Rust clickbait does a disservice to an excellent podcast.<p>The original title was The Future of Programming With Richard Eisenberg.<p>@dang
评论 #36005669 未加载
评论 #36000654 未加载
评论 #36000688 未加载
neallindsayalmost 2 years ago
Adopting a higher-level language where the programmer doesn&#x27;t have to worry about as much stuff generally comes with some trade-offs. Garbage collection has downsides but for a lot of use-cases they aren&#x27;t significant. Saying that OCaml has a place in a world where Rust exists doesn&#x27;t strike me as a very hot take.
评论 #36001544 未加载
fguerrazalmost 2 years ago
That&#x27;s an interesting point of view. I really don&#x27;t buy that garbage collection has advantages for the user. Sure it has advantages for the developer of the language, like a GIL, but for the user, it&#x27;s more a constraint they have to live with.
评论 #36000647 未加载
评论 #36000651 未加载
评论 #36000659 未加载
评论 #36000670 未加载
评论 #36000620 未加载