caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Don Syme" <dsyme@microsoft.com>
To: "Chris Hecker" <checker@d6.com>,
	"Xavier Leroy" <xavier.leroy@inria.fr>,
	"Vincent Foley" <vinfoley@iquebec.com>
Cc: "OCaml Mailing list" <caml-list@inria.fr>
Subject: RE: [Caml-list] F#
Date: Sun, 9 Jun 2002 05:26:56 -0700	[thread overview]
Message-ID: <BCDB2C3F59F5744EBE37C715D66E779C0481E208@red-msg-04.redmond.corp.microsoft.com> (raw)


> I was under the impression that the CLR as it's currently shipped could not
> do parametric polymorphism.  [Xavier's post from last year listing what
> isn't supported is here:  http://caml.inria.fr/archives/200102/msg00190.html]

F# programs compiled for V1 of the CLR use the type "object" for all values of variable (i.e. 'a) type.  This is simple erasure.  It is an OK way to implement PP (it's how GJ does it) - there are a few problems, e.g. type distinctions get lost in the IL so interop is not quite how you might want it, and it's not the model we ultimately wanted for C# because of performance and runtime-type reasons (we would like an object's full type to be visible at runtime, e.g. for reflection, just as it is for array types for the JVM and CLR).  

Probably the most irritating thing about using erasure for F# is that it forces the treatment of arrays to be slightly non-uniform.  F#-when-compiling-for-V1-of-the-CLR supports two families of array types: truly parametric arrays of the form "'a array"  and a family of .NET array types "'a[]".  In the former  are always compiled as "object[]", hence, for example, byte arrays won't have the representation you might expect.  In the latter 'a is effectively a weak type variable and must always be known at compile time, i.e. you can't generalize over variables used in _[] types.  The former are for polymorphic programming over arrays where you don't care about interop (e.g. when you're writing new data structures like hash tables built using arrays).  The latter are for when you need to build or access components that transact .NET array types (i.e. int[] in F# is guaranteed to be identical to C#'s int[] type).  F# supports the latter by inlining all code that manipulates _[] types.  It strikes me that it's possible that GJ could have made this distinction as well (as far as I know you can't currently write any code in GJ that polymorphically manipulates array types, e.g. creates new arrays - they could have allowed this but forced all source-language compilers to inline all such code).

> PS.  Why F#?  The last thing we need are more symbolic characters in our
> language names!  :)  What was wrong with caml.net, just the compatibility
> issues?

I concluded that it wasn't really appropriate for Microsoft Rsearch to release anything with the name "Caml" in it - that is up to the INRIA team.  Also the language isn't exactly OCaml or Caml-light, especially because of immutable strings, as well as the extensions like the one above.  As for F#, well it gave the /. crowd a good chance to crack some pretty good jokes, the best of which was "F# is a Forth above C#"... :-).  Another pointed out how easily "F#" becomes "F#!@"...

 


 


             reply	other threads:[~2002-06-09 12:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-09 12:26 Don Syme [this message]
2002-06-10  6:22 ` Michael Vanier
2002-06-12 17:03   ` [Caml-list] F# Matt Armstrong
  -- strict thread matches above, loose matches on Subject: below --
2007-03-08 14:41 [Caml-list] F# Robert Fischer
2007-03-08 15:10 ` Jon Harrop
2007-03-08 17:30   ` Roland Zumkeller
2007-03-08 17:54     ` Brian Hurt
2007-03-08 23:07       ` skaller
2007-03-08  1:13 Interactive technical computing Jon Harrop
2007-03-08  2:12 ` [Caml-list] " Erik de Castro Lopo
2007-03-08 12:41   ` [Caml-list] F# Jon Harrop
2002-06-10 14:04 Don Syme
     [not found] <BCDB2C3F59F5744EBE37C715D66E779C0481E208@red-msg-04.redmon d.corp.microsoft.com>
2002-06-09 17:49 ` Chris Hecker
     [not found] <BCDB2C3F59F5744EBE37C715D66E779C0481E206@red-msg-04.redmon d.corp.microsoft.com>
2002-06-09  1:30 ` Chris Hecker
2002-06-08 23:04 Don Syme
2002-06-08 15:05 Vincent Foley
2002-06-08 16:01 ` Xavier Leroy

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=BCDB2C3F59F5744EBE37C715D66E779C0481E208@red-msg-04.redmond.corp.microsoft.com \
    --to=dsyme@microsoft.com \
    --cc=caml-list@inria.fr \
    --cc=checker@d6.com \
    --cc=vinfoley@iquebec.com \
    --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;
as well as URLs for NNTP newsgroup(s).