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 AAA13310; Fri, 28 May 2004 00:09:12 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA13488 for ; Fri, 28 May 2004 00:09:11 +0200 (MET DST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i4RM97EV029377 for ; Fri, 28 May 2004 00:09:09 +0200 Received: from [192.168.1.200] (ppp114-11.lns1.syd3.internode.on.net [150.101.114.11]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i4RM94Zq051257; Fri, 28 May 2004 07:39:05 +0930 (CST) Subject: Re: [Caml-list] Looking for collaborators on a hobby project From: skaller Reply-To: skaller@users.sourceforge.net To: Christian Szegedy Cc: caml-list In-Reply-To: <40B65986.2030603@t-online.de> References: <40B65986.2030603@t-online.de> Content-Type: text/plain Message-Id: <1085695743.6826.154.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 28 May 2004 08:09:04 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 40B66703.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 sourceforge:01 2004:99 vyper:01 vyper:01 sourceforge:01 python:01 'eval':01 python:01 dynamically:01 extensible:01 optimise:01 optimised:01 checker:01 9660:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 2004-05-28 at 07:11, Christian Szegedy wrote: > Dear Skaller! > > Is the Vyper project public? > > I could not find any version of Vyper on the net. :( It used to be on Sourceforge, but it's gone now and I don't have a copy myself. What it did was interpret the AST directly. > You have written, that the analyis of the type information > turned out be difficult. I can believe this. :) For Python. Functions like 'eval' really make it hard. Python has deprecated 'eval(str)' now: you're supposed to use 'eval(str, dict)' so the dict captures the dynamic variables instead of the current scope. locals() hasn't work for ages due to compiled function locals (special fast fetch bytecode). But it is still very hard: Python class and objects are also both dynamically extensible. > Suppose, we have the following Ruby class: I've never seen a Ruby program before. I have no idea how dynamic it is..? > After that, OCaml would take care of all the typing stuff... Yes, but it won't help you optimise integer addition: you'll have to do some special checks yourself, and modify the generated Ocaml so it knows when something is an integer. > Of course using the myref class comes with a performance penalty also. > This can be eliminated if one does not allow nil at all: that is all > instance variables must have valid default value. > I think, this is a good idea anyway... Alternatively you can try to do flow analysis to see which variables can't be nil, ever, and change their type from 'a myref to 'a. Ocaml will propagate the typing and your result will be optimised .. but you will need to change all uses to match .. meaning you'll have to do type analysis yourself .. Ocaml will check your analysis, but it won't do it for you. In Felix I do this kind of thing, and the generated C++ is again type checked by g++, so only casting errors tend to escape early detection. Its very nice to check your static type checking with someone else's static type checker :) -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.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