Hacker News new | ask | show | jobs
by luka2233 18 days ago
Compiler developers couldn't beat compilers at generating code either.
1 comments

It's fun to think about why that is. Most compilers explore the code into sea of nodes, with explicit relation kinds (depends-on, computes, effect relations etc) that humans don't have access to in surface languages. Then they just reduce and shorten a lot of the unnecessary edge chains, sometimes duplicate code that improves scheduling and a lot of not-so-semantically relevant stuff to get a dataflow that is guaranteed to have the same external behaviour with the code they're compiling. So basically compilers work on representations that humans almost never see, with different objectives that humans have. If humans were to code directly in dataflow networks and could find a way to keep them tidy and neat, I think humans would have a chance to beat solutions generated from surface code and then compiled automatically.