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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Could C find a future in being used instead of pseudocode in papers?

1 点作者 kensai大约 1 年前
I recently came across a comment of someone asking the author of a blog post to consider writing his code examples (could have been also pseudocode) in Rust instead of C.<p>The answer of the blog author was: “I&#x27;m using C in lieu of imperative pseudocode. The benefit it has over pure pseudocode is that it compiles and doesn&#x27;t rely on some syntax I pulled out of nowhere. The benefit over higher-level languages is that it shows the mechanics of the calculation in a way that&#x27;s trivial to transpose to any other dialect. This can&#x27;t be said about code that uses cute but language-specific array manipulation and iteration idioms, e.g.:<p>WalshMatrix = Nest[ArrayFlatten@{{#, #}, {#, -#}} &amp;, 1, #] &amp;;”<p>Do you think C or some future version&#x2F;adaptation of it could be used to formally substitute all pseudocode examples in the future, especially in proofs&#x2F;papers?

1 comment

eesmith大约 1 年前
No.<p>We have historical precedence in ALGOL. From its Wikipedia page, it &quot;was the standard method for algorithm description used by the Association for Computing Machinery (ACM) in textbooks and academic sources for more than thirty years.&quot;<p>When was the last time you saw ALGOL?<p>In parallel, we can also look to APL, which arose out of a mathematical notation for arrays. From <a href="https:&#x2F;&#x2F;codegolf.stackexchange.com&#x2F;questions&#x2F;162254&#x2F;generate-a-walsh-matrix" rel="nofollow">https:&#x2F;&#x2F;codegolf.stackexchange.com&#x2F;questions&#x2F;162254&#x2F;generate...</a> the Walsh matrix in APL (Dyalog Unicode) is (⍪⍨,⊢⍪-)⍣⎕⍪1. For those who think in APL, I suppose that makes obvious sense.<p>ALGOL users and APL users would never agree on a single language.<p>You will not get C and Mathematica users to agree in a single language.<p>You will not get Python and Rust users to agree on a single language.<p>People doing computer assisted proofs use tools like the Coq Theorem, which has its own language.