From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA04342 for caml-red; Thu, 8 Feb 2001 20:03:30 +0100 (MET) 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 RAA31682 for ; Thu, 8 Feb 2001 17:37:54 +0100 (MET) Received: from localhost.localdomain (jimbo57.zip.com.au [202.7.88.57]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f18GbnH05194; Thu, 8 Feb 2001 17:37:50 +0100 (MET) Received: from ozemail.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id DAA04400; Fri, 9 Feb 2001 03:33:07 +1100 Message-ID: <3A82CA43.797E84C@ozemail.com.au> Date: Fri, 09 Feb 2001 03:33:07 +1100 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: Pierre Weis CC: caml-list@inria.fr Subject: Re: compilation of lablgl examples. References: <200102072202.XAA05588@pauillac.inria.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr Pierre Weis wrote: > May be it is my understanding of English which is bad, not your way to > write it :( I tend to write abbreviated idiomatic script flavoured by my native language (Strine :-) > > For example, something like this happens: > > the type of a function declaration in the Abstract Syntax Tree is: > > > > | AST_function of id_t * parameter_t list * typecode_t * statement_t > > list > > > > which is converted to: [] > > which is converted to: > > > > | BBDCL_function of bparameter_t list * btypecode_t * int list * > > bexe_t list * name_map_t > > This is very often considered good practice. However, I agree with you > that is can be heavy to code. Static typing today is not strong enough to express the actual typing, so there is always some compromise/balance between static and dynamic checking. I find it is difficult to engineer a good balance. Ideally, I could change that balance easily, however it is even harder to 'meta-engineer' code so that it is easy to change. > Sometimes you can use polymorphism to > help for instance defining > > | Function of 'parameter list * typecode_t * 'b > > could be used to modelize both > | DCL_function of parameter_t list * typecode_t * asm_t list > | BDCL_function of bparameter_t list * btypecode_t * int list * > exe_t list * name_map_t I'm not sure how: these two declarations are for variant components of _distinct_ types. [Try using variants .. ] > You should try on a small example, not on a huge optimizing compiler > for a full fledged language! Thats a good idea .. although I must say that Felix is not (yet) a 'huge' or 'optimising' compiler :-) -- 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