Coding 2023-07-09

By Max Woerner Chase

All right, let's see if I can put something together quickly.

...

And I tried actually using the stuff I wrote before, and I've concluded two main things.

One is that I'm pushing past my comfort zone a bit in terms of the OCaml features that I'm trying to use. More importantly, the code as I've written it is just kind of a confusing mess.

I just now tried to tidy it up a little, and... doubt. I'm going to try to push forward and see if there's any kind of, like, obstruction.

So, the current thing I'm trying to put together is a parse function. It starts with a grammar and (currently) a sequence of nonterminals. The first thing it needs to do is create a ('t, 'o) item NMap.t array. That array should start off containing an empty map. It's only empty because I'm trying to break this up into steps.

Aw crud. I got a few steps in before realizing that one of the types is wrong. I need a container to go in the middle of one of these horrifying types, and the code is still so bad that I think doing this technically qualifies as an improvement. So, here's the puzzle... I need to take the terminal matchers and make them suitable to use as (part of) keys to a Map. To make that work, the functional values have to be removed. I think this can be accomplished by creating a module to hold the function definitions, and make the actual matchers into normal variant types.

...

Okay, I've started doing that, and now part of the code is a lot cleaner, but I'm pretty sure the rest of the file is just covered in red lines because I only started this. I'm going to leave it there for tonight.

Good night.