@orbifx yes, it's a rabbit hole. Am starting to dig that.
One critical part, and effective in learning, in to write a compiler.
on the math side, am reading first order logic.
Free Math Textbooks
http://xahlee.info/math/math_books.html
they are all about formal languages. e.g. parser, grammar, symbolic logic, and foundation of math.