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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

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

33 点作者 jgarzik11 个月前

11 条评论

teo_zero11 个月前
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 未加载
gavinhoward11 个月前
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 未加载
downvotetruth11 个月前
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 未加载
uecker11 个月前
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 未加载
anthk11 个月前
- 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.
mongol11 个月前
Seems there are multiple Rust coreutils implementation projects? I have heard about uutils, but this is another one?
评论 #40617059 未加载
评论 #40616851 未加载
tiffanyh11 个月前
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 未加载
08234987234987211 个月前
<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 未加载
mstef11 个月前
what&#x27;s next that urgently needs mem-safety? &#x2F;bin&#x2F;true?
mstef11 个月前
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 未加载
scrubs11 个月前
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.