caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-announce] G'Caml, Caml with Extensional polymorphism extension
@ 2001-06-19 16:24 ` Jun Furuse
  2001-06-19 17:38   ` [Caml-list] " Jun Furuse
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jun Furuse @ 2001-06-19 16:24 UTC (permalink / raw)
  To: caml-announce

Hello,

I'm pleased to announce G'Caml, the experimental extension of
the extensional polymorphism([1],[2]) to O'Caml, available at

    http://pauillac.inria.fr/~furuse/generics/

You can define non parametric, ad-hoc polymorphic values 
(so called "overloaded" or "generic" functions)
using newly added "generic" bindings. For example:

     # generic plus = case
       | int -> int -> int => (+)
       | float -> float -> float => (+.) 
       ;;

This defines an ad-hoc polymorphic function plus, which can work
both for integer and float additions.

     # plus 1 2;;
     - : int = 3 

     # plus 1.2 3.4;;
     - : int = 4.6

Not only such overloaded arithmetic functions, we can define 
many interesting ad-hoc polymorphic values which cannot be imagined 
in the normal ML.

G'Caml also provides dynamic values and a toplevel magic printing function,
using the internal framework of extensional polymorphism implementation.

We can encapsulate a value and its type into an object typed dyn.
Then using this encapsulated type information, we can perform
run time type checking:

      # dyn 1;;
      - : dyn = (1 : int) 

      # coerce (dyn 1) with 
        | (x : int) => Printf.printf "It is an int %d.\n" x
	| (x : float) => Printf.printf "It is a float %f.\n" x
      It is an int 1.
      - : unit = () 

The toplevel magic printing is the function which many people have
asked for in this list. It can print out any ML value (well, functions 
are just printed as <fun>), including the constructor names of
user defined types (this is available only in the toplevel):
      
      # type foo = Foo of int;;
      
      # Toploop.print (Foo 42);;
      Foo 42- : unit = ()

G'Caml is still quite experimental and under development.
I am sure that there are tons of bugs. 
Do not expect something almost complete, 
like the initial O'Labl release...

I hope you could enjoy it.
--
JPF

[1]
"Extensional Polymorphism".
Catherine Dubois, Francois Rouaix, Pierre Weis. 
Proceedings POPL 95.
ftp://ftp.inria.fr/INRIA/Projects/cristal/Francois.Rouaix/generics.dvi.Z

[2]
"Generic polymorphism in ML".
Jun Furuse.
Journees Francophones des Langages Applicatifs 2001
http://pauillac.inria.fr/~furuse/publications/jfla2001.ps.gz


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Caml-list] Re: [Caml-announce] G'Caml, Caml with Extensional polymorphism extension
  2001-06-19 16:24 ` [Caml-announce] G'Caml, Caml with Extensional polymorphism extension Jun Furuse
@ 2001-06-19 17:38   ` Jun Furuse
  2001-06-19 17:57   ` Brian Rogoff
       [not found]   ` <20010724160232T.Jun.Furuse@inria.fr>
  2 siblings, 0 replies; 4+ messages in thread
From: Jun Furuse @ 2001-06-19 17:38 UTC (permalink / raw)
  To: Jun.Furuse; +Cc: caml-list

Hello,

I made a serious typo in the message:

>      # plus 1.2 3.4;;
>      - : int = 4.6

Of course, this must be
   
       # plus 1.2 3.4;;
       - : float = 4.6 

--
JPF
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Caml-list] Re: [Caml-announce] G'Caml, Caml with Extensional polymorphism extension
  2001-06-19 16:24 ` [Caml-announce] G'Caml, Caml with Extensional polymorphism extension Jun Furuse
  2001-06-19 17:38   ` [Caml-list] " Jun Furuse
@ 2001-06-19 17:57   ` Brian Rogoff
       [not found]   ` <20010724160232T.Jun.Furuse@inria.fr>
  2 siblings, 0 replies; 4+ messages in thread
From: Brian Rogoff @ 2001-06-19 17:57 UTC (permalink / raw)
  To: Jun Furuse; +Cc: caml-list

On Tue, 19 Jun 2001, Jun Furuse wrote:
> Hello,
> 
> I'm pleased to announce G'Caml, the experimental extension of
> the extensional polymorphism([1],[2]) to O'Caml, available at
> 
>     http://pauillac.inria.fr/~furuse/generics/

Congratulations, lots of us have been waiting for such an extension. It's 
a bit of a pity that one of the current limitations of the system is 
that it doesn't work with objects, but I suppose you are saving that for
the final merging when you can name the whole thing GO'Caml, which will 
perhaps please some people who aren't satisfied with the current name, 
and opens up lots of opportunities for logos (fan's yelling  "Go Caml
go!", a clever looking Caml playing go, etc :-)

Enough joking, time to play with this new toy...

-- Brian


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Caml-list] Re: [Caml-announce] G'Caml, Caml with Extensional polymorphism extension
       [not found]   ` <20010724160232T.Jun.Furuse@inria.fr>
@ 2001-07-24 18:22     ` Chris Hecker
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Hecker @ 2001-07-24 18:22 UTC (permalink / raw)
  To: Jun Furuse; +Cc: Jun.Furuse, caml-list


[I just noticed this thread has been on caml-announce.  I've switched it over.  Perhaps the reply-to header on caml-announce should be set to caml-list?]

>> Can I make a minor syntax request?  Can this be called "typecase" instead of
>> "case" to prevent confusion with the "match with" operator and SML's "case"?
>Sorry, but I just do not want to type *8* (not 4) more letters 
>for each generic binding.

You're kidding, right?  A syntax decision on an important feature that has no backwards compatibility restrictions and will be with us forever is being made because you don't want to type 4 more characters?  Dude, look into dabbrev-expand or bind a key to (insert "typecase") or something.  

This is exactly how languages get to the point where a newcomer decides to start learning it and quickly says, "what the hell were they thinking?"  Sometimes over and over again.

>Let me write some history of the generic binding. The "generic
>... case" syntax was originally proposed in the POPL'95 paper by
>Catherine Dubois, Fran\c{c}ois Rouaix and Pierre Weis. 

SML's had it since, what, 1970?

> Actually, it is not mandatory to write "case" in G'Caml.

Then do that instead.  I'm fine with not having to type it at all, but then make that the official syntax and don't make case a reserved word.  Yes, I guarantee having it in there is going to be confusing to new people.  Please, either remove it, or change it to typecase (or whatever), before it's too late.

Chris


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-07-24 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4.3.2.7.2.20010720233759.027da4b0@shell16.ba.best.com>
2001-06-19 16:24 ` [Caml-announce] G'Caml, Caml with Extensional polymorphism extension Jun Furuse
2001-06-19 17:38   ` [Caml-list] " Jun Furuse
2001-06-19 17:57   ` Brian Rogoff
     [not found]   ` <20010724160232T.Jun.Furuse@inria.fr>
2001-07-24 18:22     ` Chris Hecker

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