[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this a good use for "compile"

From: Matt Wette
Subject: Re: Is this a good use for "compile"
Date: Mon, 19 Feb 2018 09:30:57 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 02/18/2018 01:56 PM, Mark Carter wrote:
New scheme user here.

Suppose I'm writing a spreadsheet. The user inputs a formula for a cell.

The plan is to use guile's peg parser to convert the formula into a lambda expression, which I then compile in order to speed-up subsequent processing.

So, suppose I convert the user's formula to a list, which turns out to be, for example: '(lambda (x) (+ x 13)) and compile it and save it in a formula table:

(hash-set! my-cell-formulae some-cell-ref (compile '(lambda (x) (+ x 13))))

So I can I expect a speed-up by having done the compile, as opposed to an eval?

I assume the answer is "yes", but I wanted to check

It is not clear to me how this will work.  First of all, compile may generate machine-dependent code.  Second, how do you propose to evaluate my-cell-formulae ?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]