tag:blogger.com,1999:blog-5411139659011156551.post5506108342341752521..comments2013-03-30T15:53:54.523-07:00Comments on JLOUIS Ramblings: Ripping the backend from Moscow MLJesper Louis Andersenhttps://plus.google.com/108725849902883879959noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5411139659011156551.post-83794038147343948142009-01-21T05:26:00.000-08:002009-01-21T05:26:00.000-08:00Frank:Yes, viewing it through the isomorphism make...Frank:<BR/><BR/>Yes, viewing it through the isomorphism makes the two terms equivalent. If you disallow that, then yes, g will not be able to take tuples. If I remember correctly, Haskell defines 'curry' and 'uncurry' for transforming between the forms.<BR/><BR/>It is curious: (fn (x,y) => g x y) (3,4) beta-reduces to 'g 3 4', whereas (fn x y => f(x,y) 3 beta reduces to (fn y => f(3,y)). Nothing is gained here, though: 'g 3' is really (fn y => 3 + y). And (fn y => f(3,y)) can be inlined to (fn y => 3 + y). At this point, we have the same canonical form, and there is little left to dicuss, save for the need of an inlining.<BR/><BR/>It is first with 'h' we get a difference, since 'h' does computation between the first and second argument. And that difference is much harder to get by applying an isomorphism. The crucial part here is that I would like to have a fast curry for the LLVM backend because I want people to write their code in a style they prefer.Jlouishttp://www.blogger.com/profile/02990737394952724516noreply@blogger.comtag:blogger.com,1999:blog-5411139659011156551.post-66249642852269343022009-01-20T19:42:00.000-08:002009-01-20T19:42:00.000-08:00g is not more powerful than f, since they are rela...g is not more powerful than f, since they are related by the isomorphism between a * b -> c and a -> b -> c.<BR/><BR/>I can partially apply f to 3: (fn x y => f(x,y)) 3. If you think that's cheating, then I submit that f is more powerful than g since g cannot be applied to tuples. Of course, that would be a fib, since I can write (fn (x,y) => g x y) (3,4). So the situation is symmetric, which is what the isomorphism exhibits.Franknoreply@blogger.com