5 ms·
> That sounds pretty hard / impossible to do. Why do you think that? This is how most compilers used to work. And languages like Pascal were specifically des
by chrisseaton 7y ago
> That sounds pretty hard / impossible to do.
Why do you think that?
This is how most compilers used to work.
And languages like Pascal were specifically designed to be able to be compiled in a mostly single pass.
Look up ‘syntax directed translation’ in an old compiler textbook.
- tmzt 7y agoDoes that include Go? The speed of the compiler and some of the syntax suggest that it should be possible.
- chrisseaton 7y agoSorry not really an expert in Go.
- pansa2 7y agoGo creates an AST and uses an SSA intermediate representation [0]. [0] https://eli.thegreenplace.net/2019/go-compiler-internals-adding-a-new-statement-to-go-part-2/ https://eli.thegreenplace.net/2019/go-compiler-internals-add...