omarandlorraine / strop

Stochastically generates machine code
MIT License
97 stars 1 forks source link

The quality of the codebase is quite poor #33

Closed omarandlorraine closed 2 years ago

omarandlorraine commented 2 years ago

The other pull request for this, #31, introduced great changes that were hard to retrofit. So that branch doesn't even compile.

Here is another branch which does a similar task, but which takes the same ideas but introduces them piecemeal.

omarandlorraine commented 2 years ago

What used to be the Instruction type is now an Instruction trait; and BasicBlock takes as a type parameter anything that impls it.

So far there are Stm8Instruction and Instruction6502.

omarandlorraine commented 2 years ago

So one thing I've neglected is the tests. They are meaningless right now anyway because of how a lot of the emulation code has been stripped out just to get the thing building

omarandlorraine commented 2 years ago

I've removed the failing tests. They were failing because they were testing things that weren't there, basically.

Now, all tests pass, but that doesn't mean that this branch is well tested.

omarandlorraine commented 2 years ago

The STM8 checks pass now. But I still don't know that it could be said to be a well-tested backend.