As context for my question; DSLs, “Little Language” and such get considerable attention these days. Usually these are languages for a purpose that you expect to use repeatedly in single domain. You create parser, turn the AST into actual semantics and etc. The resulting interpreter usually doesn’t have to be fast, what matters is you have a language you can reuse.
What about a different use case. You have a small language that’s so limited you know exactly one program will ever be written in it and you’ve written it (obviously, the program would be a least medium sized but you’d know everything about). However, you want that particular program to run quickly. Obviously, you could use all the tricks that a full compiler write could use to optimize the process. However, having you complete knowledge of what’s going to be compiled seems like it could help you.
So I’m curious if anyone has tricks specific to this case or anyone has links to writing a compiler for a single program with the purpose of running that program as fast as possible?