Browse thread
compiler bug?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jacques Carette <carette@m...> |
| Subject: | Re: [Caml-list] compiler bug? |
skaller wrote: >What about high level optimisations? > >Felix supports this: > > reduce revrev[t] (x:list[t]): rev (rev x) => x; > >which, combined with inlining, removes adjacent list reversals. >This is a fairly trivial example of integrating logic with >programming as a way of achieving both correctness and >performance: the reduction above provides both semantic >knowledge to the reader as well as allowing the compiler >to generate better code. > > Haskell (GHC to be precise) allows that too. But is syntactic term-rewriting, in other words it is *untyped*. Ocaml is great because it is statically typed. MetaOCaml is wonderful because it is statically typed. Adding an untyped layer to a typed language seems like a definite step backwards (i.e. a hack).. Jacques