unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matt Wette <matt.wette@gmail.com>
To: guile-user@gnu.org
Subject: Re: Is this a good use for "compile"
Date: Mon, 19 Feb 2018 09:30:57 -0800	[thread overview]
Message-ID: <996005ca-fce3-83f6-b7fb-8b21e7467c20@gmail.com> (raw)
In-Reply-To: <d5f145f3-ce31-71e4-d256-229ec21d2668@gmail.com>


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	other threads:[~2018-02-19 17:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-18 21:56 Is this a good use for "compile" Mark Carter
2018-02-19 17:30 ` Matt Wette [this message]
2018-02-20  0:08 ` Vítor De Araújo
2018-02-20  9:28   ` Mark Carter
  -- strict thread matches above, loose matches on Subject: below --
2018-02-20 11:03 Mark Carter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=996005ca-fce3-83f6-b7fb-8b21e7467c20@gmail.com \
    --to=matt.wette@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).