While it seems that the massive changes that were flooding in over the summer have wound down (to a degree), I am still skeptical of this, and so I am changing my compiler-related plans to accommodate all the contributions that rolled in over the summer, as well as any new ones.
There are a couple changes I started rolling out in the other compiler branch that are becoming harder and harder to merge in as changes continue to be made upstream.
I was in the process of gutting the extension system and the relevant compiler chunks to try to splice in a hook system (see my notes on the Wiki from years ago) when I realized that the warnings I corrected in the compiler were starting to trickle back in, and that (on a very related note) Robert made an absolute war zone of write_object_data.cpp
trying to add support for inheritance. I stepped back to address that, and realized that the best move is for me to make all of my non-parser compiler changes in master and naively hope that they propagate painlessly, which has been the development policy for a while, now.
In other words, gentlemen, it's Josh's turn to break things carelessly. I know it isn't ideal, but I've been too reserved about these changes in the past. I have merged enigma-dev/#819
after its (minor) review, as it seems not to seriously break anything important. If I can get you guys to stay on top of my future pull requests, we can probably make it through this next week without anything serious failing. I will exercise the maximum amount of diligence possible given our lack of a regression test suite, which I will probably begin to set up while I'm at it (see my current implementation here
You will see my first commit sometime tonight or tomorrow. It will do three things, listed here in order of increasing impact:
- Fix the warnings in module_write_fonts.cpp and small warnings elsewhere
- Separate write_object_data.cpp into multiple helper functions and recode as needed to make non-hideous
- Move ALL C++ codegen and module export logic into a new class, compile_context. This has already been done in the compiler branch.
The purpose of the move is so we don't have contention on globals in the event that we need to run two compiles or two parses. This is less important
than the smaller
, more-intricate move which will be made in the commit after that one, which will move all logic involving interaction with the parse system into helper functions. This includes the following:
- All logic which directly requests the parsing of code.
- All logic which requests information about user-defined variables.
- All logic which attempts to reflect or coerce type information or code metrics.
The connecting factor, of course, is that the parser is somehow involved in all of those operations. The connecting symptom is that ENIGMA sucks at all of those operations. The reason for this move, therefore, is to make it so that once this is all said and done, the new parser will be a drop-in replacement for the old. My original approach was to do the replacement in a branch where I would not have to touch the old logic, but that's just not going to cut it for the reasons I've already hinted at.
I am going to finish mincing write_object_data.cpp
Keep an eye out for my future pull requests. Please check them for breaking changes as they roll out.