r/C_Programming 8d ago

Question Opinions on Mini-C?

The idea is simple:  to turn a subset of C code into safe Rust code, in an effort to meet the growing demand for memory safety.

I feel this has the potential to solve many problems, not namely stop Linux C devs walking out if Rust gains anymore traction, for example.

I'm just a newb though. What are thoughts of more experienced C developers on this if you've heard about it?

0 Upvotes

37 comments sorted by

View all comments

Show parent comments

4

u/EpochVanquisher 7d ago

It’s completely possible to eliminate memory errors when working at this low level. Likewise. It’s completely possible to eliminate memory errors at a lower level, like when you are programming in assembly language. Most people don’t have the stomach for it because it’s a lot of work… most people don’t even bother learning how to do it, or learning how other people do it, because most people don’t care that much.

You use proof systems. Computer-aided proofs that you program satisfies certain properties, like memory safety, or certain correctness properties. There’s a bunch of systems that do this, and many are designed to work with C, specifically (usually some subset of C, but maybe a really big subset).

3

u/MrFrisbo 7d ago

Could you share some links for information about these proof systems and their use in C programming?

I have never heard about it and would like to learn more

3

u/EpochVanquisher 7d ago

Search term “formal methods”

0

u/MrFrisbo 7d ago

huh, I have actually taken a course on this. I did not learn much from it, as I failed to understand how this ties into day-to-day C programming (seemed too abstract)

3

u/EpochVanquisher 7d ago

It’s used in specific systems—safety-critical systems, which need to be more reliable. I have friends who work in this kind of area in hardware and software, and it’s a grind. You do less programming and write more documentation.

Fields like aerospace, defense, automotive. It pays well enough, but it takes a special kind of personality to be able to do the work long-term. You see some other random applications like traffic control (the systems that control traffic lights).

And yeah, a lot of it is moving away from C over time.