From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,571930b4ff0bc1ee X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-29 00:18:02 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!fr.usenet-edu.net!usenet-edu.net!fu-berlin.de!news.cid.net!news.enyo.de!news1.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Compile time executed functions Date: 29 Mar 2001 10:25:51 +0200 Organization: Enyo's not your organization Message-ID: <87g0fxrng0.fsf@deneb.enyo.de> References: <3AC03CCE.70E3C2D5@mida.se> <87ae67qdrv.fsf@deneb.enyo.de> <87lmprow3a.fsf@deneb.enyo.de> <874rweoo2p.fsf@deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: supernews.google.com comp.lang.ada:6194 Date: 2001-03-29T10:25:51+02:00 List-Id: Ted Dennison writes: > >Yes, but this way, values can be computed prior to run time which > >appear to be constants (even during compile time) but are in fact not. > > Ahhh. But that's not what he was talking about. He wants to be able > to supply some arbitrary function (like say an integrator or a > matrix math routine or a search routine) which the compiler will > then run during the compile phase, find the value of the result (eg: > 3.57) and then place that value in a constant which he can have the > compiler stick in the ROM section of the generated code. In order to > stick a value in the ROM section, it clearly cannot be computed at > runtime. Why not? You can do this certainly with FORTH: you run the system in 'compile mode', and just before starting the actual execution, you dump the entire environment. From the dump, a ROM image can be built; and there's no need to copy constants from ROM to RAM during initialization. (I think this works with some Lisp dialects as well, Emacs is probably an example.) > I'd claim that most developers will not accept the responsibility of > an X(1) compiler, Why not? There are already some programming languages where you have to some discipline not to write constructs which exhaust compile-time ressources (C++ comes to my mind, and the problem with C++ is nottime spent compiling, but the amount of core memory used).