Be careful. I wrote an emulator for the IBM 7094 so I could run and understand Thompson's grep. Even though I wrote it in Lisp it was...painful.
Thompson uses self-modifying code, so my emulator had to handle that.
Thompson's code is incredibly clever, and back when he wrote it self-modifying code was pretty common. But by modern standards it would have been a maintenance nightmare.