Sun Feb 7 07:46:42 CET 2010
ai.hs: base code works
Type classes are a nice abstraction mechanism. See:
*Main> 1 + (1 / var "a")
R1 <- (div 1.0 a)
R2 <- (add 1.0 R1)
Let's make it spit out C syntax.
There is one thing to resolve: does the list ordering depend on the
evaluation order? This shouldn't be the case, as semantics of the
Haskell language is not dependent on order if only safe operations are
used.. So why are the lists not always ordered?
I can't reproduce.
Memoization seems to work to:
*Main> let a = var "a" in 1 + (1 / (a * a))
R1 <- (mul a a)
R2 <- (div 1.0 R1)
R3 <- (add 1.0 R2)
Let's make prettyprinting more abstract: OK, using intermediate AST of
an ANF/SSA machine language.