When left to its own devices with the instructions "make an assembler for the architecture in ISA.md" -- well Claude picked Python as the implementation language. Tokens lifted through a bunch of regex. No expression parser! Oh dear. My first assembler was like that too, to be fair.
However, when I described the desired passes and their types:
collectDefines :: [SourceLine] -> Either AsmError ([SourceLine], Map Text Text)
runLitPool :: [SourceLine] -> Either AsmError ([SourceLine], [(Text, LitKey)])
evalExpr :: Text -> Map Text Text -> Either AsmError Int
etc. It was almost one-shot. About 20 minutes until I was happy. Assembles all the test programs correctly. Code is mediocre in many places. But it would have taken me weeks to implement.