Creating a standard programming major mode presents significant challenges, with the intricate tasks of establishing proper indentation and font highlighting being among the two hardest things to get right. It's painstaking work, and it'll quickly descend into a brawl between the font lock engine and your desire for correctness.
Tree-sitter makes writing many major modes a snap: here I demonstrate how to write a working indentation and font lock engine for HTML.
Reading Mickey’s stuff is always such a joy. Must remember to buy his book one of these days!