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 SAA18246; Sat, 22 May 2004 18:14:12 +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 SAA18923 for ; Sat, 22 May 2004 18:14:11 +0200 (MET DST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4MGE7SH006562 for ; Sat, 22 May 2004 18:14: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 i4MGE5Zq056357; Sun, 23 May 2004 01:44:05 +0930 (CST) Subject: Re: [Caml-list] Automatic wrapper generator From: skaller Reply-To: skaller@users.sourceforge.net To: "Marcin 'Qrczak' Kowalczyk" Cc: caml-list In-Reply-To: <1085235588.32267.78.camel@qrnik> References: <1084869517.19838.409.camel@pelican.wigram> <1085220553.32267.49.camel@qrnik> <1085231636.774.250.camel@pelican.wigram> <1085235588.32267.78.camel@qrnik> Content-Type: text/plain Message-Id: <1085242444.6065.51.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 23 May 2004 02:14:04 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 40AF7C4F.001 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 marcin:01 'qrczak':01 kowalczyk:01 organise:99 interfacing:01 ffis:01 statically:01 python:01 python:01 'eval':01 9660:01 glebe:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, 2004-05-23 at 00:19, Marcin 'Qrczak' Kowalczyk wrote: > Unfortunately in my case it has two problems: > > 1. My compiler doesn't produce as optimized code as it could. It's not > that bad, but dynamic typing make generating good code very hard. > It would be interesting to try to make some universal C binding for my > language (after macros). I'm leaving considering it for the future. What I think you will have to do is what I'm doing now with Felix. YOu actually commit to writing the bindings in your language. You make sure you can make them work. Then, you examine what would make it possible for the compiler to generate better code and extend your language to handle it. For example, Felix has a specialised 'domain specific sublanguage' which deals with C bindings. There is a whole class of statements which do nothing else than organise C interfacing. In your case, you might consiser a DSSL which has some static typing, just to deal with FFIs .. but which is higher level than C, and interfaces with the rest of your language. I think you can do this by saying 'we have many objects at the moment, all the same static type -- my language isn't typeless, just monotyped'. Ok, so add a type system with two types: native and foreign. You can't lose any dynamics here, since they're embodied in the native part already. Just a thought. I worked on statically typing Python .. and it turned out to be almost impossible but *only* because of a few nasty language features 99% of all Python programs could do without (unrestricted 'eval' and mutable modules being two such evils). -- 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