C*: Unifying Programming and Verification in C (2025) (arxiv.org)
eggy 15 hours ago
pjmlp 13 hours ago
Heck, even complaining about COBOL programming feels like a joke now.
Kudos on you Ada adventures.
eggy 10 hours ago
pjmlp 3 hours ago
It actually compiles to native code, it handles well its use case, batch processing business data, and despite everything less verbose than most agents markdown files I keep seeing.
Yes the risk is there, but it is also there for any kind of legacy application in enterprise scenarios, which is why most migrations fail.
Panzerschrek 4 hours ago
That's why such thing is mostly useless. C is used in places where performance is important and nobody want to sacrifice performance for such proofing. Even more, if such proofing is too slow, it's better to use something like Fil-C.
gavinray 17 hours ago
Wrote a bit about this recently
https://gavinray97.github.io/blog/design-by-contract-and-eff...
rramadass 16 hours ago
One of the best books to learn this from is The Correctness-by-Construction Approach to Programming by Derrick Kourie and Bruce Watson - https://link.springer.com/book/10.1007/978-3-642-27919-5
The book actually uses Dijkstra's GCL language and wp-calculus along with Carroll Morgan's Refinement Calculus to demonstrate step-wise derivation of programs from specifications using a lot of examples.
UncleEntity 12 hours ago
Maybe it's an issue because it controls both sides of the fence and can change things willy-nilly when it thinks I'm just watching the youtubes but I haven't been able to find a another way to do this so, here we are...
amw-zero 10 hours ago
I'd love to see some actual experiments with LLMs in this area. There are a fair number of languages with effect implementations at this point.
Taikonerd 17 hours ago
F* is in the ML family of languages, so it looks pretty different from C*.
IsTom 12 hours ago
And I suspect that cross section of people writing C code you want to verify with formal verification folks is not particularly big.
Jtsummers 12 hours ago
Perhaps not, but C is still used in a lot of critical systems. Things like this for proving properties of some core of your program can be very helpful.
rramadass 6 hours ago
gdwatson 17 hours ago
slowcache 12 hours ago
jensgk 17 hours ago
applfanboysbgon 16 hours ago
stbenjam 15 hours ago
applfanboysbgon 15 hours ago
Jtsummers 14 hours ago
dymk 16 hours ago
That C* was released in 1993
Who actually cares about the name collision?
kazinator 11 hours ago
mrkeen 16 hours ago
https://www.cs.columbia.edu/~sedwards/classes/2021/4115-fall...
https://github.com/kkysen/cstar
And to sibling comments: I care. Non-mainstream languages are talking points. I don't want to get 15 minutes into a "you should have effects like Koka" argument and then find out the other person is talking about a different Koka.
rramadass 18 hours ago
See in particular, usage benefits with LLMs (last para of https://cstarlang.org/en/intro.html) and how to use it with LLMs (https://cstarlang.org/en/tutorial/cstar-mcp.html).
Note that the paper/language are from 2025 and so pretty recent.
fithisux 5 hours ago
rramadass 5 hours ago
The ATS Programming Language - https://www.cs.bu.edu/~hwxi/atslangweb/
ATS3-Xanadu - https://github.com/githwxi/ATS-Xanadu
From https://en.wikipedia.org/wiki/ATS_(programming_language)
As of 2024, ATS/Xanadu (ATS3) is being developed actively in ATS2, with the hope of reducing the learning needed by two main improvements:
- Adding an extra layer to ATS2 to support ML-like algebraic type-checking
- Type-based metaprogramming using algebraic types only
With these improvements, Xi hopes for ATS to become much more accessible and easier to learn. The main goal of ATS3 is to transform ATS from a language mainly used for research, into one strong enough for large-scale industrial software development.
glitchc 17 hours ago
rramadass 17 hours ago
And given that almost all C programmers are also C++ programmers, no mere syntax can faze us :-)
binaryturtle 17 hours ago
Interestingly Perl comes in second, even I use it rarely (aka not at all) these days. But that's a slightly off-topic side note. :)
ahknight 17 hours ago
And yes, for the most part. C++ as simple shorthand for struct-attached functions and automatic memory management (no, not smart pointers; RAAI) is good. Every single thing added after that is misery and should push a modern developer to Rust, Go, or Zig (roughly in that order) where such things are implemented sanely or not at all.
stvltvs 17 hours ago
ahknight 7 hours ago
hnlmorg 16 hours ago
ahknight 7 hours ago
cwnyth 6 hours ago
rramadass 17 hours ago
Furthermore, any C++ programmer who says they do not know C, knows neither C nor C++ (hence my preference in using C/C++ as a shorthand to encompass both and highlight the dependency of the latter on the former). I often see this in novice C++ programmers who started with "Modern C++" and identify it as something like Java/C# because of the now huge set of standard libraries and copious syntactic sugar which only compounds their confusion further.
applfanboysbgon 16 hours ago
Right, but this dependency is one-way. There is an entire legion of C programmers who reject C++ (most notably Linus), so claiming that almost all C programmers are also C++ programmers is a bit off.
rramadass 15 hours ago
Linus Torvalds objection to using C++ is perfectly logical for his use-case. I know many embedded programmers who refuse to use C++ even though they understand and agree with the benefits that it can bring to the table. Their C expertise is so good that when they program, cognitively the language just disappears and they "flow" through the problem solution implementation. This is the crux of problem-solving.
cwnyth 15 hours ago
ahknight 7 hours ago
Until they weren't. (I'm glad you saw that coming, because they didn't.)
EPWN3D 14 hours ago
This is... not true at all.
ahknight 7 hours ago
ahknight 17 hours ago
ux266478 17 hours ago
theokrueger 17 hours ago
formal verification requires a deeper understanding of underlying mechanisms to write correctly. yet nothing prevents you or your agent from changing invariants to fit the algorithm and making it incorrect.
ux266478 16 hours ago
> yet nothing prevents you or your agent from changing invariants to fit the algorithm and making it incorrect.
If the thing we're trying to prove is ungrounded, it's trivially true that any verification method falls apart. You're still encoding priors in your testing methodology. No matter how robust you think your testing suite is, I can still trick it if given free reign over the codebase.
rramadass 16 hours ago
bellowsgulch 16 hours ago
They don’t reply to these threads to share that knowledge because these threads devolve into cesspools about how you should just use Rust despite the language not meeting specific requirements authors have that you have to do additional work and maintenance for in “safe” languages that you get for free in C because you don’t have to emulate it.
Jtsummers 16 hours ago
C* (the submitted language) is not just about determining memory correctness and related program features like what Valgrind will do for you (or help with). It's about proving correctness of programs more generally, so any C programmer not looking at it because they know about Valgrind are choosing to skip something interesting for a very poor reason.
rramadass 16 hours ago
Absolutely right! I sincerely hope they share their knowledge here and elsewhere.
> They don’t reply to these threads to share that knowledge because these threads devolve into cesspools
HN is often rage-inducing when it comes to comments on C/C++/Fortran/Cobol/etc. older languages and systems. There are many critical and industrial-strength systems developed by the previous generation of engineers/programmers which today's noobs/cargo-cultists cannot even hope to imagine much less understand.
As an example, people talk about all the great features provided by Erlang but forget that its BEAM VM where most of the "magic" resides is actually written in C! Imagine how much expertise lies buried in its implementation!
AlotOfReading 12 hours ago
using C safely is 99% just using Valgrind and some specific GCC or llvm flags and you’re done
I wish that were the case, but it's not. Dynamic analyzers are fantastic and everyone should be using them constantly, but they don't solve the problem of UB. They tell you whether your code, as translated by a specific compiler using a specific set of flags today has detectable problems. There are still gaps, and what's true today might not be true even for the same source code built tomorrow, or given different inputs. Asserting my safety-critical code does X or Y is important to me, and neither C nor C++ have standard tooling that fully addresses that need.Other languages are much farther along than this. You can in theory take a pile of Rust and isolate exactly the points where undefined behavior might occur, or eliminate them entirely in Ada/Spark.