2024-03-03 00:00
The deepcode Stack Machine (DSM) is a simple virtual stack machine specification for use in software engineering education.
Learn by Doing
The best way to get better at writing software is to write more software. Not everyone has a fun project in mind to use when learning a new programming language, and when teaching to a group of people, it's helpful to have a single project that each person can work through individually but still discuss in deep context among the group. That mixed with wanting to avoid implementing yet another bank account balance management toy program is what led me to produce the DSM specification.
I also have my own reference implementation. In fact, most of the 1.0.0 specification was made retroactively based on my initial reference implementation. I plan to add additional features to the reference implementation that I will then base new versions of the specification on. In this way I'll grow the breadth and depth of topics my educational material covers while keeping everything rooted in practicality.
Primers
As part of the 1.0.0 specification, I am also putting together some simple C language primers. I am happy to have the chance this April to teach practical C to some colleagues in my current company. I will use the DSM as the class project. What I am producing here as the C language primers will be the foundation for the C language theory I'll teach before starting the DSM project with the class.
Currently I have 3 primers in mind. One is for the C language itself, and the other two for some C techniques and tools. Writing C (and C++) at scale nowadays is much more than just knowing the language itself. Build systems are necessary but often complicated, knowing how to organize the source tree is not a C language detail but does affect the dependency structure of programs and is sensitive to the selected build system, and we as developers need to know how to weild debuggers and static and runtime analysis tools particularly when working with languages that leave us to manage the runtime memory ourselves.
Specification
The v1 specification is here.
Next
At the time of this writing, the 1.0.0 specification is complete. The primers still need some work, though. I will probably be iterating on the language primer for some time. My current approach is to reread the entire primer everytime I resume work on it, once every day or two, and fix small issues I catch or otherwise reflow the work. This is getting more difficult as I add more content, just because it takes more time. Eventually I will likely focus on just finishing the first draft of all of the content and then return to rereading and editing.