caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Turning off type-checking
@ 2002-05-13 13:31 Markus Mottl
  2002-05-13 14:33 ` Lauri Alanko
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Markus Mottl @ 2002-05-13 13:31 UTC (permalink / raw)
  To: OCAML

Hello,

people have always kept telling me that I have perverse needs, but that's
the way it is: I (ab)use OCaml for interpreting models learnt by a machine
learning system. The problem is that such models may require hundreds
of thousand lines of OCaml-code including absolutely mad amounts of
pattern-matches on and constructions of values of sum- and product type.

Needless to say that I get into trouble when I actually want to interpret
or compile these models to evaluate them on new data. Type checking just
takes an awful amount of time, in fact much longer than the learning
algorithm needs for model generation...

It would be really nice if there were some command-line flag for the
OCaml-compilers which turns off every check that is not required under the
assumption that the given OCaml-code is (type) correct as is guaranteed in
my case. Would this be easily possible? What else could I do to reduce the
amount of work the OCaml-compiler has to do? Insert Obj.magic everywhere?

Best regards,
Markus

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
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] 19+ messages in thread
* RE: [Caml-list] Turning off type-checking
@ 2002-05-14  3:10 Gregory Morrisett
  2002-05-14  7:10 ` Francois Pottier
  0 siblings, 1 reply; 19+ messages in thread
From: Gregory Morrisett @ 2002-05-14  3:10 UTC (permalink / raw)
  To: Berke Durak, Markus Mottl, caml-list

> Could the type experts on this list confirm or deny that :
> 	- For ``classical'' types, type-checking amounts to 
> term unification.
> 	- Term unification can be done in worst-case linear-time.
> 	- Ocaml's unification algorithm is worst-case suboptimal.
> 	- This explains the ``awful amount of time'' needed for 
> type checking.

Well, type-checking ML involves more than term unification -- the 
worst case complexity is something truly horrible (EXP-time).
Having said this, for most programs, the worst-case complexity
rarely, if ever arises in "natural" code.  (I've not run into
it...)

So, I'd actually be surprised if there was any significant speedup
obtained by eliminating the type-inference from the compilation
path.  

-Greg
-------------------
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] 19+ messages in thread

end of thread, other threads:[~2002-05-15 22:22 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-13 13:31 [Caml-list] Turning off type-checking 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
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

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