This PR moves the intrinsics out of the massive if-else to a separate functions, with a dict mapping intrinsic enums to the functions themselves. I also moved some asserts out of loops where it doesn't make sense to have them (e.g new items aren't going to appear in enums between loop iterations). Some asserts were also made a bit more dynamic.
Plus f-strings instead of % formatting.
The changes here also provided significant speedup on rule110, from 4.3s to 2.3s or so on Cpython 3.10.
This PR moves the intrinsics out of the massive if-else to a separate functions, with a dict mapping intrinsic enums to the functions themselves. I also moved some asserts out of loops where it doesn't make sense to have them (e.g new items aren't going to appear in enums between loop iterations). Some asserts were also made a bit more dynamic. Plus f-strings instead of % formatting. The changes here also provided significant speedup on rule110, from 4.3s to 2.3s or so on Cpython 3.10.