From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id F3DF8BC0B for ; Mon, 8 Jan 2007 19:51:10 +0100 (CET) Received: from coriana6.cis.mcmaster.ca (coriana6.CIS.McMaster.CA [130.113.128.17]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l08Ip9bj004379 for ; Mon, 8 Jan 2007 19:51:10 +0100 Received: from Gorash7.UTS.McMaster.CA (Gorash7.UTS.mcmaster.ca [130.113.196.61]) by coriana6.cis.mcmaster.ca (8.13.7/8.13.7) with ESMTP id l08IoufQ011791; Mon, 8 Jan 2007 13:51:06 -0500 (EST) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.mcmaster.ca [130.113.64.46]) by Gorash7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id l08IoBer031954; Mon, 8 Jan 2007 13:50:11 -0500 Received: from [130.113.68.27] (account carette@univmail.cis.mcmaster.ca [130.113.68.27] verified) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.1.8) with ESMTP id 156435938; Mon, 08 Jan 2007 13:50:29 -0500 Message-ID: <45A29223.3090600@mcmaster.ca> Date: Mon, 08 Jan 2007 13:49:07 -0500 From: Jacques Carette Organization: McMaster University User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: robert@fischerventure.com Cc: OCaml Subject: Re: [Caml-list] Before teaching OCaml References: <1168193722.6133.38.camel@Blefuscu> <1168209464.8650.36.camel@rosella.wigram> <60198.151.151.21.104.1168280811.squirrel@webmail.fischerventure.com> In-Reply-To: <60198.151.151.21.104.1168280811.squirrel@webmail.fischerventure.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version-Mac: 4.7.1.128075, Antispam-Engine: 2.4.0.264935, Antispam-Data: 2007.1.8.103432 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='SUPERLONG_LINE 0.05, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' X-j-chkmail-Score: MSGID : 45A2929D.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45A2929D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml's:01 algebra:01 functors:01 renaud:01 functors:01 polymorphism:01 functionnal:01 algebra:01 abstraction:01 polymorphism:01 ocaml:01 behaves:01 haskell:01 polymorphic:01 robert@fischerventure.com wrote: > This was actually going to be my suggestion. I'd suggest a very > toned-down version of a mathematics interpreter (think of a baby > Mathematica). That's the kind of problem that will play well to Ocaml's > strengths, and since you're looking at math-oriented problems, it'd be > reasonably forward. > > It'd be really fun to do this post-abstract algebra. Define Rings and > that kind of stuff as functors, and then go to town. :-D > You would think so - and then when actually doing it, realize that it doesn't *quite* work. See for example http://focal.inria.fr/site/images/stories/articles/boulme_rr00b.ps.gz i.e. @TECHREPORT{BoulmeRR00b, AUTHOR = {Sylvain Boulm\'e and Th\'er\`ese Hardin and Renaud Rioboo}, TITLE = {Polymorphic Data Types, Objects, Modules and Functors: is it too much?}, INSTITUTION = {LIP6}, TYPE = {Research report}, YEAR = 2000, NOTE = {Available on \url{http://www.lip6.fr/reports/lip6.2000.014.html}{http://www.lip6.fr/reports/lip6.2000.014.html}}, KEYWORDS = {classes, modules, functors, objects, types, polymorphism, functionnal programming, Computer Algebra, specification, library}, ABSTRACT = {Abstraction is a powerful tool for developers and it is offered by numerous features such as polymorphism, classes, modules and functors, ... A working programmer may be confused with this abundance. We develop a computer algebra library which is being certified. Reporting this experience made with a language (Ocaml) offering all these features, we argue that they are all needed together. We compare several ways of using classes to represent algebraic concept, trying to follow as close as possible mathematical specification. Then we show how to combine classes and modules to produce code having very strong properties. Currently, this library is made of one hundred units of functional codes and behaves faster than analogous ones such as Axiom} } To really make it 'work', you need quite a bit of technology. You can do a toy version without getting too fancy, but you have to be careful because so many different extensions you might want to implement do not *quite* work. I have also seen a "baby Maple" written in Haskell -- the level of necessary technology is also quite high. Jacques