3 ms·
Modern compilers seem to work with trees more often than graphs. Trees would certainly be easier to work with in any language. That said, functional languages
by willtim 9y ago
Modern compilers seem to work with trees more often than graphs. Trees would certainly be easier to work with in any language.
That said, functional languages can and do work with graphs when needed, but yes it is much more awkward than trees.
- thangngoc89 9y agoTree is also a form of graph
- seanmcdirmid 9y agoNot down in the lower levels of IR and IL, the trees have mostly disappeared by then. If you are just interpreting or doing unoptimized compiling, you can get by with just trees.
- willtim 9y agoGHC Haskell does nearly all its optimisation using trees and a high-level functional IR, so I think you are understating trees.
- seanmcdirmid 9y agoYes, but I don't think they require a low-level IR in that case (purity, no re-assignment, no loops). LLVM does not use trees at that level, for example, because they really need to use stuff like SSA, basic blocks, and so on.
- deleted 9y ago[deleted]