logoalt Hacker News

Show HN: C From Scratch – Learn safety-critical C with prove-first methodology

24 pointsby william1872today at 12:17 AM1 commentview on HN

Seven modules teaching C the way safety-critical systems are actually built: MATH → STRUCT → CODE → TEST.

Each module answers one question: Does it exist? (Pulse), Is it normal? (Baseline), Is it regular? (Timing), Is it trending? (Drift), Which sensor to trust? (Consensus), How to handle overflow? (Pressure), What do we do about it? (Mode).

Every module is closed (no dependencies), total (handles all inputs), deterministic, and O(1). 83 tests passing.

Built this after 30 years in UNIX systems. Wanted something that teaches the rigour behind certified systems without requiring a decade of on-the-job learning first.

MIT licensed. Feedback welcome.


Comments

csb6today at 6:17 AM

I like the approach; it reminds me of Towards Zero Defect Programming by Allan Stavely and Dijkstra's idea of deriving programs mechanically from their specifications.

Were LLMs used to produce some of the writing? Not sure how to describe it, but it has a certain recognizable writing style (e.g. "The Problem"/"The Solution", lots of bulleted lists with bolded first words, etc.) Readers might appreciate if AI use is disclosed.