caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ville-Pertti Keinonen <will@exomi.com>
To: "Gregory Morrisett" <jgm@CS.Cornell.EDU>
Cc: <caml-list@inria.fr>
Subject: Re: [Caml-list] Bug?  Printf, %X and negative numbers
Date: Thu, 3 Apr 2003 00:12:05 +0300	[thread overview]
Message-ID: <C15E9724-654F-11D7-B5BF-000393863F70@exomi.com> (raw)
In-Reply-To: <FB4F95390166B14C90E4DD950D69D6E216305D@EXCHVS2.cs.cornell.edu>


> While this approach is viable, it has a lot of costs.  For
> some of the tradeoffs, I suggest reading Xavier's excellent
> paper in the 1998 Types in Compilation workshop.

Do you mean the '97 paper (unboxing of floats in OCaml, among other 
things)?  I had read that one.  I just read the '98 paper, too, but it 
doesn't go into much detail.

> MLTON avoids these issues by specializing polymorphic code at
> all of its uses so that it becomes monomorphic (not unlike C++),
> at the price of separate compilation.

This is what I was suggesting.  With its whole-program analysis, this 
is obviously more straightforward for MLton, but I think it's also 
feasible for more practical compilers (without ending up with C++-like 
compile times).

I was thinking about keeping separate compilation by either using 
specialization as an optimization when the number of variations is 
reasonable at the point where the polymorphic code is implemented, or 
passing the generic code in a semi-compiled form and letting it be 
specialized on (first) use.  The latter is obviously better, but 
requires quite a bit of work on the intermediate compiled form and 
linking.

> Generics in C# go yet another route with runtime specialization
> which has distinct advantages like the possibility of supporting
> polymorphic recursion (see Andrew Kennedy & co's papers.)
> There are different tradeoffs here, due to features such as
> reflection and "instanceof", etc.

Thanks for the pointer.

> In short, there's a wealth of literature on this subject.
> Ocaml has taken a very expedient approach and in my opinion,
> it would be difficult to produce an alternative that
> achieves the same performance without introducing a lot
> of complexity.

I agree that the OCaml runtime makes good compromises that work well in 
practice.  Any added complexity would probably hurt symbolic code, 
which seems to have had a high priority in considerations of tradeoffs.

I don't feel strongly about the need for naked integers, so on my part 
this is just speculation and general curiosity.

What I would like is specialization of functors.  I hate using data 
structures that lose to Java in performance. ;-)

-------------------
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


  reply	other threads:[~2003-04-02 21:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-02 18:42 Gregory Morrisett
2003-04-02 21:12 ` Ville-Pertti Keinonen [this message]
2003-04-02 21:46   ` Lauri Alanko
2003-04-03 17:40     ` Ville-Pertti Keinonen
2003-04-04 16:14   ` Brian Hurt
2003-04-04 17:14     ` Ville-Pertti Keinonen
2003-04-04 17:27     ` Falk Hueffner
2003-04-03  0:52 ` brogoff
  -- strict thread matches above, loose matches on Subject: below --
2003-04-03  9:29 Fabrice Le Fessant
2003-03-28 21:19 Brian Hurt
2003-03-28 22:21 ` Yutaka OIWA
2003-03-30  9:51 ` Xavier Leroy
2003-03-31 15:44   ` Brian Hurt
2003-03-31 17:13     ` Ville-Pertti Keinonen
2003-04-01  8:19     ` Xavier Leroy
2003-04-01 16:09       ` David Brown
2003-04-01 16:45       ` Tim Freeman
2003-04-01 18:59         ` Brian Hurt
2003-04-01 19:16           ` Ville-Pertti Keinonen
2003-04-01 19:23             ` Tim Freeman
2003-04-01 21:00               ` Ville-Pertti Keinonen
2003-04-01 19:56             ` Brian Hurt
2003-04-01 20:45               ` Ville-Pertti Keinonen
2003-04-01 21:03                 ` Brian Hurt
2003-04-02  8:55             ` Andreas Rossberg
2003-04-02  9:20               ` Ville-Pertti Keinonen
2003-04-01 18:34       ` Ville-Pertti Keinonen
2003-04-02 11:44 ` Claude Marche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C15E9724-654F-11D7-B5BF-000393863F70@exomi.com \
    --to=will@exomi.com \
    --cc=caml-list@inria.fr \
    --cc=jgm@CS.Cornell.EDU \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).