From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: xavier.leroy@inria.fr
Cc: caml-list@pauillac.inria.fr
Subject: Re: [Caml-list] Obj.magic, Obj.t etc.
Date: Tue, 19 Aug 2003 16:33:51 +0900 [thread overview]
Message-ID: <20030819163351T.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <20030818120418.B12053@pauillac.inria.fr>
From: Xavier Leroy <xavier.leroy@inria.fr>
> Right. More generally, I have long advocated the exploitation of
> properties of the static type system in optimizing data
> representations, runtime system operations, and code generation.
> The above is just an exploitation of the property of "classic" ML that
> an array is always homogeneous (all elements have the same principal
> type).
>
> A corollary is that if the type system changes significantly, some of
> these optimizations are invalidated. Introducing a "top" type is one of
> these significant changes. Quite frankly, I see zero practical uses
> of a "top" type, so why bother?
Well not exactly zero: here is one example (the mail is by me, but I
was answering a precise question)
http://caml.inria.fr/archives/200307/msg00064.html
Of course you can say: but we have objects for that, why bother?
And it's probably right.
Another reason is that it would allow to make both covariant-only and
contravariant-only variables generalizable in non-values. Not so
useful but any bit of polymorphism is good.
So I would agree that there is no compelling need for such a feature,
but not that there is zero practical uses.
Also, the opposite argument would be more convincing if there were
more examples showing that having a top type is bad for performance.
To me the current situation is more like: not worth changing the
implementation for it, but when designing from scratch this may be a
valid choice. If you're ready to work in a world of homegeneous
representations (i.e. no type-specialized representations).
Jacques Garrigue
-------------------
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
prev parent reply other threads:[~2003-08-19 7:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-13 18:49 Christopher Dutchyn
2003-08-14 1:55 ` Jacques Garrigue
2003-08-14 8:22 ` Florian Douetteau
2003-08-14 8:34 ` Jacques Garrigue
2003-08-14 10:45 ` Marcin 'Qrczak' Kowalczyk
2003-08-15 0:14 ` Jacques Garrigue
2003-08-15 10:32 ` skaller
2003-08-15 10:52 ` Marcin 'Qrczak' Kowalczyk
2003-08-15 15:54 ` brogoff
2003-08-15 10:31 ` skaller
2003-08-18 10:04 ` Xavier Leroy
2003-08-19 7:33 ` Jacques Garrigue [this message]
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=20030819163351T.garrigue@kurims.kyoto-u.ac.jp \
--to=garrigue@kurims.kyoto-u.ac.jp \
--cc=caml-list@pauillac.inria.fr \
--cc=xavier.leroy@inria.fr \
/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