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 NAA14530; Fri, 24 Jan 2003 13:02:57 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA15500 for caml-list@pauillac.inria.fr; Fri, 24 Jan 2003 13:02:57 +0100 (MET) 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 MAA13662 for ; Fri, 24 Jan 2003 12:00:57 +0100 (MET) Received: from ep09.kernel.pl (ep09.kernel.pl [212.87.11.162]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h0OB0ur17595 for ; Fri, 24 Jan 2003 12:00:56 +0100 (MET) Received: (qmail 28244 invoked by uid 566); 24 Jan 2003 11:00:54 -0000 Date: Fri, 24 Jan 2003 11:59:19 +0100 From: Michal Moskal To: Oleg Cc: caml-list@inria.fr Subject: Re: [Caml-list] Baby Steps (was: ChartPak - a data visualization library for the web) Message-ID: <20030124105919.GB3390@roke.freak> References: <200301232319.59207.oleg_inconnu@myrealbox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200301232319.59207.oleg_inconnu@myrealbox.com> User-Agent: Mutt/1.4i X-PGP-Fingerprint: CF89 1B14 11BE 1CC9 2CA3 7497 5E32 69B4 BC71 B4C2 X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Jan 23, 2003 at 11:19:59PM -0500, Oleg wrote: > On Monday 20 January 2003 03:37 pm, Brian Hurt wrote: > > The trend here is that the mainstream only takes baby steps. > > If someone merely added > - ADTs > - variant types > - GC > - strict[er] typing > - and perhaps polymorphism > > to C, I wonder if such a language would take off. Take a look at http://www.research.att.com/projects/cyclone/ and http://gont.pld.org.pl/ . But if you want to know my opinion... I designed such a language, wrote compiler for it in OCaml, rewrote compiler in this language (getting it to bootstrap was a lot of fun :-), and finally coded something else (kind of extended lambda calculus interpreter) in OCaml. And the final impression was: it's far easier in OCaml. The main difference between OCaml (the part that I was using) and Gont was syntax. And OCaml syntax is better, once you get used to FP. For example: <'b>list map(*('b ('a)) f, <'a>list l) { switch l { case Nil: return Nil; case Cons(hd, tl): return Cons(f(hd), map(f, tl)); } } Or version using type inference: def map2(f, l) { switch l { case Nil: return Nil; case Cons(hd, tl): return Cons(f(hd), map2(f, tl)); } } And now in OCaml let rec map f = function | [] -> [] | x :: xs -> f x :: map f xs -- : Michal Moskal ::::: malekith/at/pld-linux.org : GCS {C,UL}++++$ a? !tv : PLD Linux ::::::: Wroclaw University, CS Dept : {E-,w}-- {b++,e}>+++ h ------------------- 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