caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] compiler implementation of partial applications.
@ 2004-02-09 11:54 Jason Smith
  0 siblings, 0 replies; only message in thread
From: Jason Smith @ 2004-02-09 11:54 UTC (permalink / raw)
  To: caml-list

Hi All

I'm investigating certain compile time optimizations using type information. 
One in particular is reducing the runtime costs with calling polymorphic 
functions. My experience so far has mostly been with the internals of the ghc 
compiler and a language called Mondrian. The ghc compiler performs a runtime 
argument count check and generates a special closure called a PAP which 
consumes the appropriate no. of arguments.  Ideally this should be eliminated 
and appropriate transformations performed statically.

In particular I'm looking at how the following simplified example is compiled.

f1 = \a -> \b -> a + b;
f2 = \a -> + a;

map (if (..) then f1 else f2) [1, 2, 3];

I was wondering if you could either, a) point me to some resources which 
discuss ocaml's compilation model with reference to the above, or b) maybe 
comment on it urself?

Thankyou for your time.

Jason.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-09 11:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-09 11:54 [Caml-list] compiler implementation of partial applications Jason Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).