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.

Memory-safe, clean implementation of classic Posix "BC" calculator

33 pointsby jgarzik12 months ago

11 comments

teo_zero12 months ago
Am I the only one who thinks we need less short-lived tools written in memory-safe languages an more system infrastructure written in said languages?<p>Don&#x27;t take me wrong, I like when someone creates a better version of something existing. For example, ripgrep is fantastic. But seeing the recent trend of rewriting whatever in Rust just because, I can&#x27;t help wondering why I should bother whether bc leaks or not...
评论 #40615734 未加载
评论 #40616420 未加载
评论 #40616426 未加载
评论 #40617116 未加载
评论 #40615951 未加载
gavinhoward12 months ago
As the author of the default bc in macOS and FreeBSD, good luck.<p>Also, while mine is in C, I have tried very hard to eliminate all memory safety bugs, and I think I have done pretty well.<p><a href="https:&#x2F;&#x2F;git.gavinhoward.com&#x2F;gavin&#x2F;bc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;git.gavinhoward.com&#x2F;gavin&#x2F;bc&#x2F;</a>
评论 #40617067 未加载
评论 #40615423 未加载
downvotetruth12 months ago
Lost as to why there is a tests folder yet the test function marked with the #[test] attribute is being added to &#x2F;src: <a href="https:&#x2F;&#x2F;github.com&#x2F;rustcoreutils&#x2F;posixutils-rs&#x2F;pull&#x2F;132&#x2F;commits&#x2F;dd9f9531b48171f9417685b8a9440180fd39a985#diff-399ef6729038be6ed4b917820c57c591b487d20593f93b70428976bd0072dc67">https:&#x2F;&#x2F;github.com&#x2F;rustcoreutils&#x2F;posixutils-rs&#x2F;pull&#x2F;132&#x2F;comm...</a> edit: Since the change was to the grammar saved in a separate .pest file, which is separated from the procedural code, then would that make the test an integration rather than a unit test as the &quot;parse_program&quot; function is public?
评论 #40615160 未加载
评论 #40615819 未加载
uecker12 months ago
I am still waiting for Rust people to do something new and innovative. I acknowledge that Rust itself is innovative, don&#x27;t get me wrong, But where are the true proof-of-concept projects such as the Linux kernel, qemu, git, postgresql, vim, etc. of the Rust world? Rewriting code is a waste of time of time, fragments the eco system, and introduces new bugs. And with a new focus on memory safety and analysis tools and sanitizers evolving, a lot of C code will be made memory safe in the future without needing a rewrite in Rust.
评论 #40615727 未加载
评论 #40616882 未加载
评论 #40617342 未加载
评论 #40616683 未加载
评论 #40615691 未加载
anthk12 months ago
- DC to convert between bases and if you like RPN.<p>- Calc it&#x27;s better if you want to cover complex numbers: <a href="https:&#x2F;&#x2F;github.com&#x2F;lcn2&#x2F;calc">https:&#x2F;&#x2F;github.com&#x2F;lcn2&#x2F;calc</a><p>- Qalc from libqalculate in order to solve some equations in legacy machines. It&#x27;s lighter and smaller than Maxima, but not as complete. - -<p>- Maxima for anything else, the biggie one. This will cover calculus. Gnuplot will work fine as a plotter for the previous tools.
mongol12 months ago
Seems there are multiple Rust coreutils implementation projects? I have heard about uutils, but this is another one?
评论 #40617059 未加载
评论 #40616851 未加载
tiffanyh12 months ago
If you want core utilities rewritten in Rust …<p>‘uutils’ is exactly that.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;uutils&#x2F;coreutils">https:&#x2F;&#x2F;github.com&#x2F;uutils&#x2F;coreutils</a>
评论 #40617371 未加载
08234987234987212 months ago
<i>bc</i>(1) is nice to have, but —for my purposes— less useful than <i>dc</i>(1), because it doesn&#x27;t generate arbitrary binary output.
评论 #40615574 未加载
评论 #40615654 未加载
mstef12 months ago
what&#x27;s next that urgently needs mem-safety? &#x2F;bin&#x2F;true?
mstef12 months ago
this must be parody. what exactly is the threatmodel where memory-safety matters for a calculator? did these devs miss the point of popping a calc.exe? surely no bc has ever been used for LPE or RCE.
评论 #40618181 未加载
scrubs12 months ago
The title reminds me of the adds for &quot;Shen Yun China Before Communism&quot; which begs the question: ok what about life after communism ... where&#x27;s the song and dance show about that?<p>Similarly, if this is the memsafe bc, where&#x27;s the wow it leaks memory like a 1980s rock ballad bc code?<p>Hint: one has an answer, and the other has really never been on the radar safe or no.