3 ms·
It's as if they generated an AST and then immediately converted it to bytecode, all at once. The key restriction is that you must be able to generate the bytec
by ufo 2y ago
It's as if they generated an AST and then immediately converted it to bytecode, all at once.
The key restriction is that you must be able to generate the bytecode in a single pass over the source code. For example, the compilation of a function at the top of the file must not depend on declarations further down the file.
- vidarh 2y agoDepending on the form the dependencies takes you can handle that too. E.g. if it's "just" about knowing addresses, then just building up a list of relocation records where you need to patch in addresses as they become known works just fine. Of course the more work like that you have to do, the less you save over just building an AST anyway.