caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* RE: [Caml-list] F#
@ 2002-06-09 12:26 Don Syme
  2002-06-10  6:22 ` Michael Vanier
  0 siblings, 1 reply; 3+ messages in thread
From: Don Syme @ 2002-06-09 12:26 UTC (permalink / raw)
  To: Chris Hecker, Xavier Leroy, Vincent Foley; +Cc: OCaml Mailing list


> 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#!@"...

 


 


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

* Re: [Caml-list] F#
  2002-06-09 12:26 [Caml-list] F# Don Syme
@ 2002-06-10  6:22 ` Michael Vanier
  2002-06-12 17:03   ` [Caml-list] F# Matt Armstrong
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Vanier @ 2002-06-10  6:22 UTC (permalink / raw)
  To: dsyme; +Cc: checker, xavier.leroy, vinfoley, caml-list


My mail reader can't make any sense of this.  Anyone care to tell me what
it is?

Mike

> Date: Sun, 9 Jun 2002 05:26:56 -0700
> From: "Don Syme" <dsyme@microsoft.com>
> 
> DQo+IEkgd2FzIHVuZGVyIHRoZSBpbXByZXNzaW9uIHRoYXQgdGhlIENMUiBhcyBpdCdzIGN1cnJl
> bnRseSBzaGlwcGVkIGNvdWxkIG5vdA0KPiBkbyBwYXJhbWV0cmljIHBvbHltb3JwaGlzbS4gIFtY
> YXZpZXIncyBwb3N0IGZyb20gbGFzdCB5ZWFyIGxpc3Rpbmcgd2hhdA0KPiBpc24ndCBzdXBwb3J0
> ZWQgaXMgaGVyZTogIGh0dHA6Ly9jYW1sLmlucmlhLmZyL2FyY2hpdmVzLzIwMDEwMi9tc2cwMDE5
> MC5odG1sXQ0KDQpGIyBwcm9ncmFtcyBjb21waWxlZCBmb3IgVjEgb2YgdGhlIENMUiB1c2UgdGhl
> IHR5cGUgIm9iamVjdCIgZm9yIGFsbCB2YWx1ZXMgb2YgdmFyaWFibGUgKGkuZS4gJ2EpIHR5cGUu
> ICBUaGlzIGlzIHNpbXBsZSBlcmFzdXJlLiAgSXQgaXMgYW4gT0sgd2F5IHRvIGltcGxlbWVudCBQ
> UCAoaXQncyBob3cgR0ogZG9lcyBpdCkgLSB0aGVyZSBhcmUgYSBmZXcgcHJvYmxlbXMsIGUuZy4g
> dHlwZSBkaXN0aW5jdGlvbnMgZ2V0IGx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3VyY2UtbGFuZ3VhZ2UgY29t
> cGlsZXJzIHRvIGlubGluZSBhbGwgc3VjaCBjb2RlKS4NCg0KPiBQUy4gIFdoeSBGIz8gIFRoZSBs
> YXN0IHRoaW5nIHdlIG5lZWQgYXJlIG1vcmUgc3ltYm9saWMgY2hhcmFjdGVycyBpbiBvdXINCj4g
> bGFuZ3VhZ2UgbmFtZXMhICA6KSAgV2hhdCB3YXMgd3Jvbmcgd2l0aCBjYW1sLm5ldCwganVzdCB0
> aGUgY29tcGF0aWJpbGl0eQ0KPiBpc3N1ZXM/DQoNCkkgY29uY2x1ZGVkIHRoYXQgaXQgd2Fzbid0
> IHJlYWxseSBhcHByb3ByaWF0ZSBmb3IgTWljcm9zb2Z0IFJzZWFyY2ggdG8gcmVsZWFzZSBhbnl0
> aGluZyB3aXRoIHRoZSBuYW1lICJDYW1sIiBpbiBpdCAtIHRoYXQgaXMgdXAgdG8gdGhlIElOUklB
> IHRlYW0uICBBbHNvIHRoZSBsYW5ndWFnZSBpc24ndCBleGFjdGx5IE9DYW1sIG9yIENhbWwtbGln
> aHQsIGVzcGVjaWFsbHkgYmVjYXVzZSBvZiBpbW11dGFibGUgc3RyaW5ncywgYXMgd2VsbCBhcyB0
> aGUgZXh0ZW5zaW9ucyBsaWtlIHRoZSBvbmUgYWJvdmUuICBBcyBmb3IgRiMsIHdlbGwgaXQgZ2F2
> ZSB0aGUgLy4gY3Jvd2QgYSBnb29kIGNoYW5jZSB0byBjcmFjayBzb21lIHByZXR0eSBnb29kIGpv
> a2VzLCB0aGUgYmVzdCBvZiB3aGljaCB3YXMgIkYjIGlzIGEgRm9ydGggYWJvdmUgQyMiLi4uIDot
> KS4gIEFub3RoZXIgcG9pbnRlZCBvdXQgaG93IGVhc2lseSAiRiMiIGJlY29tZXMgIkYjIUAiLi4u
> DQoNCiANCg0KDQogDQoNCg==
> -------------------
> 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
> 
-------------------
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] 3+ messages in thread

* [Caml-list] Re: F#
  2002-06-10  6:22 ` Michael Vanier
@ 2002-06-12 17:03   ` Matt Armstrong
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Armstrong @ 2002-06-12 17:03 UTC (permalink / raw)
  To: Michael Vanier; +Cc: caml-list

Michael Vanier <mvanier@cs.caltech.edu> writes:

> My mail reader can't make any sense of this.  Anyone care to tell me
> what it is?

It was a valid MIME message, so you might update your mail reader to
something more modern or bug free.  It is available on the list
archives:

http://caml.inria.fr/archives/200206/msg00077.html

(but the lines weren't wrapped to 80 characters, as is the unfortunate
typical default setting with so many mailers these days, so you'll
have to do a lot of horizontal scrolling)
-------------------
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] 3+ messages in thread

end of thread, other threads:[~2002-06-12 17:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-09 12:26 [Caml-list] F# Don Syme
2002-06-10  6:22 ` Michael Vanier
2002-06-12 17:03   ` [Caml-list] F# Matt Armstrong

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