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 IAA09868; Fri, 8 Jun 2001 08:58:28 +0200 (MET DST) 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 IAA09782 for caml-list@pauillac.inria.fr; Fri, 8 Jun 2001 08:58:27 +0200 (MET DST) 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 SAA01171 for ; Thu, 7 Jun 2001 18:30:46 +0200 (MET DST) Received: from localhost.localdomain (ppp81.dyn142.pacific.net.au [210.23.142.81]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f57GUff01271 for ; Thu, 7 Jun 2001 18:30:43 +0200 (MET DST) Received: from ozemail.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id CAA09947; Fri, 8 Jun 2001 02:30:24 +1000 Message-ID: <3B1FAC20.F93A7D5D@ozemail.com.au> Date: Fri, 08 Jun 2001 02:30:24 +1000 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: William Chesters CC: caml-list@inria.fr Subject: Re: [Caml-list] ocaml complexity References: <20010606095041.A93623@caddr.com> <15134.34352.642598.605606@beertje.william.bogus> <3B1E8AA1.22B71FA5@ozemail.com.au> <15134.36136.766030.251564@beertje.william.bogus> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk William Chesters wrote: > > John Max Skaller writes: > > The really BIG culture shift, in my opinion, > > is something much simpler: syntax. > > I agree that's very significant. C++-style syntax with camlp4, > anyone? :) I know there's a sort of smiley there, but this is more or less what I'm working on: I'm developing a new programming language, Felix, for C++ users, which has the main features of functional programming, including closures, higher order functions, variants, pattern matching, modules, and garbage collection. Felix provides overloading, uses {} to denote blocks in which all definitions are recursive, has type inference for variables but not functions, uses SML/Ocaml type grammar, and binds cleanly with C++ (partly because it's a C++ code generator). Here's a complete working example, I hope it is readable to both C++ and Ocaml programmers. [I also hope 6! = 720, because that's the answer that gets printed :=] -------------------------------------------- header '#include '; type bool = "bool"; type int = "int"; proc print: int = 'printf("%d\n",$1);'; fun sub: int * int -> int = "$1 - $2"; fun mul: int * int -> int = "$1 * $2"; fun gt: int * int -> bool = "$1 > $2"; fun fact(a:int): int { fun f (a:int, p:int) : int { if(a>1) return f(a-1, p*a); else return p; } return f(a,1); } print (fact 6); -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr