3 ms·
Good to see more C/subset-C compilers being written. Besides the immense pedagogical value, they are also useful for preventing the "trusting trust" attack: htt
by userbinator 8y ago
Good to see more C/subset-C compilers being written. Besides the immense pedagogical value, they are also useful for preventing the "trusting trust" attack: https://dwheeler.com/trusting-trust/ https://dwheeler.com/trusting-trust/
I will also make a suggestion to use precedence climbing instead of plain recursive descent for the parser; it makes the parser even simpler and table-driven, which is important with a language like C that has many precedence levels.
- marktangotango 8y agoInteresting, do you have any useful links related to this concept?
- userbinator 8y agoHere is the discussion of the original Trusting Trust attack: https://news.ycombinator.com/item?id=13569275 https://news.ycombinator.com/item?id=13569275
- marktangotango 8y agoThanks I was referring to precedence climbing parser part of GP reply.
- catpolice 8y agohttps://eli.thegreenplace.net/2012/08/02/parsing-expressions-by-precedence-climbing https://eli.thegreenplace.net/2012/08/02/parsing-expressions... Precedence climbing is also (intimately) related to Pratt parsing, and there's a useful series of articles about the two here: https://www.oilshell.org/blog/2017/03/31.html https://www.oilshell.org/blog/2017/03/31.html
- userbinator 8y agohttps://www.engr.mun.ca/~theo/Misc/exp_parsing.htm#climbing https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm#climbing
- nickpsecurity 8y agoThompson publicized an attack by Paul Karger during MULTICS. One of many. Defeating their totality took what's called high-assurance security. For compilers, you have to verify source despite potentially-malicious developers, verify its binary translation, and its distribution. Maybe the tools used to do that as well. I wrote more about what that takes here: https://lobste.rs/s/nognrl/creating_language_using_only_assembly#c_0wqbrv https://lobste.rs/s/nognrl/creating_language_using_only_asse...