caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: visigoth@cs.cmu.edu
Cc: markus@oefai.at, caml-list@inria.fr
Subject: Re: [Caml-list] Turning off type-checking
Date: Wed, 15 May 2002 17:51:00 +0900	[thread overview]
Message-ID: <20020515175100E.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <86ptzyb8x8.fsf@laurelin.dementia.org>

From: John Prevost <visigoth@cs.cmu.edu>
> >>>>> "mm" == Markus Mottl <markus@oefai.at> writes:
> 
>     mm> I don't think that I really hit the exponential wall anywhere
>     mm> so it's probably just that type-checking takes much longer
>     mm> than I had expected.  Well, I can live with it...
> 
> Note that it's not type-checking that's painful so much as type
> reconstruction.  If it were possible to provide O'Caml with an
> explicitly typed representation, simply checking the types should be
> quite easy.  (Is it well typed?  Is it not well typed?)  Type
> reconstruction, on the other hand, requires term unification and the
> like, and takes a bit more effort.

That's not so clear. Unification in itself is not very expensive, not
necessarily more than matching.
Things only become slow when types are big, and this would be the same
in a language without type reconstruction. The fact is that you get
much more easily big types in ocaml, just because you don't have to
write them :-) and also because lots of type equalities are by
structure.
Yet, I believe that ocamlc is faster than most java compilers, and java
doesn't have type reconstruction.

> How hard would it be (probably difficult) to expose an explicitly
> typed layer from the system for automatic code generators?

This would be easy, but dangerous. And you would have to do your own
type inference anyway, to put the proper types on the nodes, so I'm
not sure you would gain anything.
If you want to try, the code is in driver/compile.ml.
Just get rid of the beginning of Compile.implementation: Pparse.file and
Typemod.type_implementation. For efficiency you probably want to build
your tree with another program, dump it with output_value, and recover
it here with input_value. If all internal types are very simple, this
may be efficient.

    Jacques
-------------------
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:[~2002-05-15  8:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-13 13:31 Markus Mottl
2002-05-13 14:33 ` Lauri Alanko
2002-05-13 21:47 ` Berke Durak
2002-05-14 13:33 ` Oliver Bandel
2002-05-14 14:33 ` Jacques Garrigue
2002-05-14 23:17   ` Markus Mottl
2002-05-14 23:34     ` John Prevost
2002-05-15  8:51       ` Jacques Garrigue [this message]
2002-05-15 22:22   ` John Max Skaller
2002-05-14  3:10 Gregory Morrisett
2002-05-14  7:10 ` Francois Pottier
2002-05-14  7:56   ` eijiro_sumii
2002-05-14 12:51     ` Markus Mottl
2002-05-15 19:42       ` John Max Skaller
2002-05-15 21:02         ` Markus Mottl
2002-05-14  8:20   ` Alain Frisch
2002-05-14 10:33     ` Christophe Raffalli
2002-05-14 13:39   ` Oliver Bandel
2002-05-15  6:00     ` malc

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=20020515175100E.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=markus@oefai.at \
    --cc=visigoth@cs.cmu.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).