Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

turbo pascal went straight from text to machine code. no ast or manipulations.


That's very interesting to me. Do you have a source or more info about this?


More info please? That sounds pretty hard / impossible to do.


I stand corrected; this was in fact discussed before, right here on HN: https://news.ycombinator.com/item?id=17087469 -- very nice read.


> 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.


Does that include Go? The speed of the compiler and some of the syntax suggest that it should be possible.


Go creates an AST and uses an SSA intermediate representation [0].

[0] https://eli.thegreenplace.net/2019/go-compiler-internals-add...


Sorry not really an expert in Go.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: