Progress at Last!

This week in HBDB world was very productive. I was able to identify the root of all the difficulties and complications that I've been experiencing: poor design.

The obstacles that I was facing were not because I did not know how breakpoints would work. That part was fine. It was more of a "where do breakpoints fit into my project" issue. This was because there was no real design for HBDB. Imagine this as trying to build the first story of a building without having laid down the foundation. That is what it was like. I could easily envision what the first floor would look like but it didn't fit anywhere. There was no place for it to go!

And so I've begun laying the foundation. I'm making a clear distinction between core code and code that uses the embedding API. The frontend will make use of the API and will perform the general initialization operations. Then control is handed off to hbdb_run_code() (which falls under "core code") and will initiate the main runloop. Communication between different functions will take place much the same way that Parrot uses PARROT_INTERP. I've added an hbdb_t structure to Parrot_Interp that will store various status flags, file information, event details, etc. The frontend doesn't see any more action until the user quits where it will clean things up and exit.

I'm very happy with this distinction between the API and the core. I can almost imagine a particular Philadelphia-area hacker nodding excitedly in agreement as I write. ;) This will make control flow much more easier to follow and will allow HBDB to be cleanly organized into separate layers of responsibility.

Not only have I been given a greater insight into how Parrot's interpreter works but I've also been able to visualize how different features will fit into place much more clearly.

My metaphorical "foundation" has seen a lot of progress in the past week and I anticipate it being complete within the next few days. I am confident that once this is done, everything else is going to fall into place quite nicely.