Devlog

These are my daily notes and internal conversations during development. They may be helpful to understand the larger context of decisions that were made, and how I learned and explored while building.

Devlog < 2023 < May < 6

| by date | | thread: co |

Right before I stopped for the night, I ran into an issue where the symbols linked from the library are not also pulling in their dependencies. While trying to fix this, it made me realize that I’m splitting everything up between routines and macros in the context, but they are both the same data type, and can’t overlap. Perhaps I can just pool the macros and routines together to simplify the context?

---

This worked great, and shortly afterward I had the whole 'reverse.co' assembling and executing to completion. It made me realize that there was no way for the CPU to exit, so I made it so that returning with an empty return stack acts as an 'exit'.

---

Now that I can write code, I'm wishing I had better tools. Right off the bat, I wish I had a way to automate the export/link/assembly process, a way to navigate the library, and a way to link source code to the symbol hashes.

For the first part, one idea is to just have a file be able to define other steps to take, so if you point at a single 'manifest' file, it would then say what all the other files are, and which commands to run and what arguments to pass.

					manifest.co
				
import ./stack.co into .co.stack
import ./loop.co into .co.loop
import ./reverse.co into .co.stack
assemble ./reverse.co to ./reverse.rom
				

This could work as a separate thing, but it would also be nice if it was just part of the source code syntax, so that is could be anywhere. However, maybe that's overloading things a bit. I could also add a new tool to 'co', like 'co build' that has its own simple syntax

---

I implemented this as 'co build' and it takes a file that looks like this and automates the build steps:

					cofile
				
import    ./stack.co   into  .co.stack
resolve   ./loop.co
import    ./loop.co    into  .co.loop
resolve   ./reverse.co
import    ./reverse.co into  .co.stack
assemble  ./reverse.co to    ./reverse.rom
				

Reinventing make, now, I guess. I'd like to add a way for the build to automatically map out dependencies, by figuring out which symbols each file exports/relies on, and also be able to support a "i'm actively building and updating this code" mode and a "i'm consuming this so I don't really want to alter the relationships that are linked here" mode. Also better output for what changes happened, and a dry run for seeing what changes will happen before running them.

| thread: co | | by date |