Path: news.daimi.aau.dk!news.uni-c.dk!sunic!sunic.sunet.se!columba.udac.uu.se!news.mdh.se!news.seinf.abb.se!eua.ericsson.se!erinews.ericsson.se!cnn.exu.ericsson.se!convex!cs.utexas.edu!howland.reston.ans.net!xlink.net!xlink100!ka.sub.net!rz.uni-karlsruhe.de!news.uni-stuttgart.de!news.belwue.de!news.belwue.de!fu-berlin.de!zrz.TU-Berlin.DE!lise!wpp From: wpp@lise.physik.tu-berlin.de (Kai Petzke) Newsgroups: comp.lang.beta Subject: Re: combining interpreted and compiled beta Date: 12 May 95 22:04:02 GMT Organization: Technical University Berlin, Germany Lines: 51 Message-ID: References: <3odc7a$dac@belfort.daimi.aau.dk> <3opg2s$12a9@hearst.cac.psu.edu> NNTP-Posting-Host: lise.physik.tu-berlin.de bjj@ecl.psu.edu (Bryan J Jensen) writes: >In article , wpp@lise.physik.tu-berlin.de (Kai Petzke) writes: >...a complex example omitted... >>These and other features of BETA make it hard to interprete it >>in a strictly sequential fashion. >> >>The alternative would be to let the interpreter resolve the most >>complicated expressions and declarations, before it executes any >>code. But this resolution, called "checking" by the Mjolner >>BETA compiler, is a substantial fraction of the total compile >>time. >> >>The resolving interpreter would not be much faster than the >>compiler. >Except you are generating C. How would the C compilation time >(avoided by an interpreter) compare to the interpreter setup time? It is probably too early to estimate any real numbers here, just because my translator at the moment only handles declarations and assignment expressions (both directly, and through exit lists). So take the following numbers not for real: For a very small program (10 lines of BEAT), I found that the BETA checking needed 0.3 seconds, while generating 176 lines of C code, compiling and linking them needed 2.4 seconds. In a somewhat bigger example, I needed 1.0 seconds for BETA checking compared to 5.5 seconds for the compiler. So the time needed for the BETA part increased by a factor of 3.3, the C part only by 2.3. I am quite sure, that this tendency remains, when your BETA code gets bigger: BETA checking time grows faster than C compile time. C compile time depends almost linear of the C file size, because the simple structure of the generated C code is simple. This is not true for BETA: often, you have to iterate over all superpatterns or enclosing patterns of a given pattern. The more nesting you use, the more effort is needed for checking. I estimate, that for the final compiler and realistic examples, the ratio "BETA check time" to "C compile time" will be around 1:2, or 1:3. Kai -- Kai Petzke | How fast can computers get? Technical University of Berlin | Berlin, Germany | Warp 9, of course, on Star Trek. wpp@marie.physik.tu-berlin.de |