Re: Fastening the run-time interpretation of mathematical expressions

Darius Blasband <darius@raincode.com>
20 Nov 2006 08:06:36 -0500

          From comp.compilers

Related articles
[4 earlier articles]
Re: Fastening the run-time interpretation of mathematical expressions martin@gkc.org.uk (Martin Ward) (2006-11-13)
Re: Fastening the run-time interpretation of mathematical expressions tommy.thorn@gmail.com (Tommy Thorn) (2006-11-13)
Re: Fastening the run-time interpretation of mathematical expressions 148f3wg02@sneakemail.com (Karsten Nyblad) (2006-11-15)
Re: Fastening the run-time interpretation of mathematical expressions martin@gkc.org.uk (Martin Ward) (2006-11-15)
Re: Fastening the run-time interpretation of mathematical expressions idknow@gmail.com (idknow@gmail.com) (2006-11-15)
Re: Fastening the run-time interpretation of mathematical expressions gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-11-16)
Re: Fastening the run-time interpretation of mathematical expressions darius@raincode.com (Darius Blasband) (2006-11-20)
| List of all articles for this month |

From: Darius Blasband <darius@raincode.com>
Newsgroups: comp.compilers
Date: 20 Nov 2006 08:06:36 -0500
Organization: [ posted via Easynet Belgium ]
References: 06-11-052
Keywords: performance, design
Posted-Date: 20 Nov 2006 08:06:36 EST

One way of having very fast interpretation would be to generate
C code for the function, and compile it on the fly with TCC (which
performs very few optimization but I expect it to be faster than
an interpreter in such a case) and call it on the fly as well.


http://fabrice.bellard.free.fr/tcc/


The web site contains extensive examples where one has a C function
in a string, compiles it, and calls it repetitively. It might be
overkill for you app, but it's fun, for sure :-)


PAolo wrote:
> I am writing a piece of software that accept in input the definition
> of a mathematical function and a list of points in which evaluate the
> function and puts the result in output. The main feature of the progam
> is that once the function definition is read, the program evaluates
> the function very fast [Well this isn't done already...]. I was
> thinking to build a pair of stacks, one containig the operands
> (floats) and the other containig the operators (function pointers).



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.