From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA30760; Wed, 25 Aug 2004 18:26:30 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA29855 for ; Wed, 25 Aug 2004 18:26:29 +0200 (MET DST) Received: from regyva.canterbury.ac.nz (regyva.canterbury.ac.nz [132.181.2.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i7PGQRBa023044 for ; Wed, 25 Aug 2004 18:26:28 +0200 Received: from CONVERSION-A1.it.canterbury.ac.nz by it.canterbury.ac.nz (PMDF V6.2-X27 #30791) id <01LE3VB6SODSDQTJXX@it.canterbury.ac.nz> for caml-list@inria.fr; Thu, 26 Aug 2004 04:26:26 +1200 (NEW ZEALAND STANDARD TIME) Received: from Praxis (Praxis.cosc.canterbury.ac.nz [132.181.9.181]) by it.canterbury.ac.nz (PMDF V6.2-X27 #30791) with SMTP id <01LE3VB5YVM4DO135G@it.canterbury.ac.nz>; Thu, 26 Aug 2004 04:26:25 +1200 (NEW ZEALAND STANDARD TIME) Date: Thu, 26 Aug 2004 04:26:33 +1200 From: Jason Smith Subject: Re: [Caml-list] Alternative Bytecodes for OCaml To: caml-list@inria.fr Cc: skaller@users.sourceforge.net Message-id: <014d01c48ac0$49256d40$b509b584@Praxis> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Mailer: Microsoft Outlook Express 6.00.2800.1106 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit X-Priority: 3 X-MSMail-priority: Normal References: <200408250926.28629.jgoerzen@complete.org> <1093446345.15255.565.camel@pelican.wigram> <00af01c48ab7$66986c50$b509b584@Praxis> <200408251052.27094.jgoerzen@complete.org> X-Miltered: at concorde with ID 412CBDB3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; jns:99 canterbury:99 caml-list:01 bytecodes:01 python:01 python:01 glue:01 subtyping:01 currying:01 reflection:01 constrain:01 statically:01 generics:01 expressible:01 contra:99 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > And that is, in my mind, the key benefit. I am just learning > about .NET, so let's talk about Java first. *snip cool python stuff* > And you're right, with .NET this benefit grows even more. I can access > not just Java stuff there, but also C#, some C++, Python, Perl, > whatever else. It's a lot to draw on, and no glue. Yes, I have little experience with python but I've written a functional language compiler for .NET for the language Mondrian[1]. Expect a new release soon, as soon I as I finish it with hopefully non-structural subtyping and recursive types (website is a little behind the times). In Mondrian I can bind to C# simply by doing: invoke System.Random.Next(Integer) At the moment you have to supply the parameter type because the original implementation couldn't resolve overloadings, Integer is the return type. Currying affords a form of dynamic binding here as I can delay supplying the untill later in this case because Next does not expect a argument the objc instance is the next argument bound. invoke uses the reflection libraries to check if the object instance bound later is really carrying a member with System.Random.Next defined on it. Obviously realistically the only object carrying this method is going to be a instance of System.Random but the idiom is easily extendable. If we are interested in making sure we do not get any dynamic exceptions then we can constrain the type variable bound to invoke with the constraint a <: { System.Random.Next (Integer) }, so that we can check it statically. Some immediate benefits over the JVM are an official release with support for Generics, parameteric polymorphism is now directly expressible in byte code and now *finally* we have contra/covariant delegate types which allows me to express proper subtype semantics over function types (where functions are passed using delegates, a natural homomorphism). Incidentally the above syntax has been adopted by Hugs98.NET [2], mostly because the original guy who worked on Mondrian, Eric Meijor, is development lead for Hugs98. Cheers, J. [1] www.mondrian-script.org [2] http://galois.com/~sof/hugs98.net/ ------------------- 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