Hi,

I've seen in several places recommendations to use 'ocamldefun' to speed
up OCaml programs that use functors heavily [*].

I was able to find the sources via the wayback machine.
Unsurprisingly it doesn't build with OCaml 3.11.2 (it wants OCaml 3.06).
Is there a more up to date variant of ocamldefun? Would it be possible
to port it to 3.11.2?

Is it possible to implement ocamldefun-like functionality via Camlp4's
AST filters?

Also is it possible to implement function specialization
(monomorphization?) using an AST filter?
The example from the OCaml tutorial is not optimized by
http://www.ocaml-tutorial.org/performance_and_profiling.

Or is it possible to get access to the OCaml compiler's IL
representation and make optimizations on that?

[*] For example when extracting ML programs from Coq using OCaml's
native 'int' type I get code like this (which is not inlined/optimized
at all by OCaml):
module Z_as_Int =
 struct
....
  let _2 = 2
  let mult = ( * )
...
end
module F =
 functor (I:Int) ->
 struct
  (** val mul2 : I.int -> I.int **)

  let mul2 n =
    I.mult I._2 n
 end
module F2 = F(Z_as_Int)

Best regards,
--Edwin

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to