From: Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>
Cc: caml-list@inria.fr
Subject: Caml wish list
Date: Fri, 14 Apr 2000 11:32:56 +0200 [thread overview]
Message-ID: <38F6E5C8.972110C3@univ-savoie.fr> (raw)
In-Reply-To: <14581.55775.16448.947429@tkb.mpl.com>
Here is a list of request for Ocaml that would really make the libray
for formal and numerical calculus better (see
http://www.raffalli.univ-savoie.fr/~RAFFALLI/formel.html) :
- include with ...
would allow multiple inheritance in signature !
- include in structure.
We should also think about multiple inheritance and
even override in this case. But a simple implementation
would already be useful.
- typing of structure containing modules is problematic:
if you write:
module F = functor(M:M) ->
struct
module M =M
end
Then you have a module Q:Q where Q is a subtype of M.
If you type R = F(Q) then
the type of R.M is M even if the type system knows that
R.M = Q.
This makes it impossible in some cases to put modules as member
of structure ! It was for instance impossible to put the Ring of
scalar as a member of the structure Vector, because when this
Ring is a Field, we may loose this information and fail to
type-check perfectly correct program.
- Infix operator like + ...
Every body will agree that infix operator are needed. So
R.+ should be allowed as an infix operator and R.(+) would
be prefix.
One could event think to reuse symbols like + for many functions.
Here is a simple proposal on how to do it that I would really enjoy to
see working :
Two new commands in OCaml structure (the syntax can be changed):
share + : 'a -> 'a -> 'a
this makes that + exists and is type-checked with type 'a -> 'a -> 'a
share + = add_int
share + = add_float
...
this means that, after type checking, + will take the first value
among add_int, add_float, ... whose type matches the infered type for
+.
If add_int is tested first, this will be compatible with existing code.
This is easy to implement (I think).
One could even allow some kind of recursive macros !
share + = fun (x,y) (x',y') -> (x+x', y+y')
share + = List.map2 (+)
share + = Array.map2 (+)
This is a bit mode difficult to implement, but it seems feasible.
- The library is too slow when using floating points.
One need to add inlining for functor and functions
before doing the floating point optimisations.
A function or functor that is used only once
should be inlined regardless of its size (no huge code size
explosion even if the function is used once in every .ml files)
A syntax for inlining on demand (when applying and/or) defining the
function should be provided. A way would be to have three new
choices when defining a function or functor:
- normal
- always inlined
- inlined on demand
--
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex
tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI
next prev parent reply other threads:[~2000-04-15 20:42 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-03 1:27 When functional languages can be accepted by industry? Dennis (Gang) Chen
2000-04-06 16:51 ` Jean-Christophe Filliatre
2000-04-07 5:27 ` Dennis (Gang) Chen
[not found] ` <14574.1721.508470.790475@cylinder.csl.sri.com>
2000-04-11 0:24 ` Dennis (Gang) Chen
2000-04-11 17:58 ` Pierre Weis
2000-04-12 1:45 ` Dennis (Gang) Chen
2000-04-12 17:27 ` Daniel de Rauglaudre
2000-04-13 15:40 ` John Max Skaller
2000-04-14 19:16 ` John Max Skaller
2000-04-12 18:06 ` David Brown
2000-04-13 1:23 ` Dennis (Gang) Chen
2000-04-13 14:36 ` Pierre Weis
2000-04-13 6:53 ` Jean-Christophe Filliatre
2000-04-13 12:20 ` Frank Atanassow
2000-04-13 17:28 ` John Max Skaller
2000-04-13 12:28 ` Steve Stevenson
2000-04-13 13:38 ` jean-marc alliot
2000-04-13 16:00 ` William Chesters
2000-04-13 14:29 ` T. Kurt Bond
2000-04-13 17:23 ` Julian Assange
2000-04-16 16:33 ` John Max Skaller
2000-04-17 15:06 ` Markus Mottl
2000-04-17 19:55 ` John Prevost
2000-04-24 2:36 ` Chris Tilt
2000-04-14 9:19 ` The beginning of a library for Formal algebra and numerical Analysis Christophe Raffalli
2000-04-14 9:32 ` Christophe Raffalli [this message]
2000-04-19 11:40 ` Caml wish list thierry BRAVIER
2000-04-19 13:45 ` William Chesters
2000-04-19 20:45 ` Christophe Raffalli
2000-04-25 18:16 ` Pierre Weis
2000-05-10 4:50 ` reference initialization Hongwei Xi
2000-05-11 13:58 ` Pierre Weis
2000-05-11 18:59 ` Hongwei Xi
2000-05-12 17:07 ` Pierre Weis
2000-05-12 19:59 ` Hongwei Xi
2000-05-15 6:58 ` Max Skaller
2000-05-15 17:56 ` Hongwei Xi
2000-05-14 14:37 ` John Max Skaller
2000-05-13 7:07 ` Daniel de Rauglaudre
2000-05-13 7:09 ` Daniel de Rauglaudre
2000-05-11 16:02 ` John Prevost
2000-04-13 16:59 ` When functional languages can be accepted by industry? John Max Skaller
2000-04-15 22:29 ` William Chesters
2000-04-16 22:24 ` Nickolay Semyonov
2000-04-18 6:52 ` Max Skaller
2000-04-17 12:51 ` jean-marc alliot
2000-04-17 17:49 ` John Max Skaller
2000-04-17 22:34 ` Brian Rogoff
2000-04-19 15:31 ` John Max Skaller
2000-04-19 18:30 ` Michael Hicks
2000-04-20 16:40 ` Markus Mottl
2000-04-20 17:58 ` Brian Rogoff
2000-04-20 18:52 ` Markus Mottl
2000-04-21 20:44 ` Michael Hohn
2000-04-21 19:22 ` John Max Skaller
2000-04-21 19:09 ` John Max Skaller
2000-04-21 19:45 ` Markus Mottl
2000-04-21 19:56 ` Brian Rogoff
2000-04-21 19:18 ` John Max Skaller
2000-04-18 10:53 ` Sven LUTHER
2000-04-19 15:57 ` John Max Skaller
2000-04-13 7:05 ` Pierre Weis
2000-04-13 17:04 ` Julian Assange
2000-04-07 15:44 ` John Max Skaller
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=38F6E5C8.972110C3@univ-savoie.fr \
--to=christophe.raffalli@univ-savoie.fr \
--cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).