Author here. Happy to answer questions about the methodology or the c-from-scratch project.
smallerize•1w ago
I liked the overview and examples. But your program has no output?
william1872•1w ago
Good observation! The shift is intentional - safety-critical code typically doesn't "output" in the printf sense. Instead it returns status codes and modifies state that the caller inspects.
The pulse monitor example returns PULSE_OK/PULSE_ERR_* codes, and the caller queries state via pulse_status(). In a real system, that status feeds into a larger state machine or triggers hardware responses - not console output.
The article focuses on the methodology shift rather than a complete runnable example.
Fair point though - I could add a note about where to find working demos.
smallerize•1w ago
I like the shift in emphasis to testing over just looking for output, but part of the point of a "hello world" program is to make sure the output is working. If it helps, you could frame it as debug output instead of a result. "Sending pulse...", "Received pulse!".
william1872•1w ago
smallerize•1w ago
william1872•1w ago
The pulse monitor example returns PULSE_OK/PULSE_ERR_* codes, and the caller queries state via pulse_status(). In a real system, that status feeds into a larger state machine or triggers hardware responses - not console output.
That said, the c-from-scratch repo (https://github.com/SpeyTech/c-from-scratch) does include demo programs with actual output for learning purposes.
The article focuses on the methodology shift rather than a complete runnable example.
Fair point though - I could add a note about where to find working demos.
smallerize•1w ago