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

https://news.ycombinator.com/item?id=39999252
by kensai • 2 years ago
1 1 2 years ago

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.

The answer of the blog author was: “I'm using C in lieu of imperative pseudocode. The benefit it has over pure pseudocode is that it compiles and doesn'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's trivial to transpose to any other dialect. This can't be said about code that uses cute but language-specific array manipulation and iteration idioms, e.g.:

WalshMatrix = Nest[ArrayFlatten@{{#, #}, {#, -#}} &, 1, #] &;”

Do you think C or some future version/adaptation of it could be used to formally substitute all pseudocode examples in the future, especially in proofs/papers?

Related Stories

Loading related stories...

Source preview

news.ycombinator.com