unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: What are trampolines?
Date: Mon, 05 Dec 2022 16:38:44 -0500	[thread overview]
Message-ID: <jwvfsdtczso.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: 87cz8yyogp.fsf@gmail.com

> It's not clear to me what does it mean (particularly the documentation
> string).  What are trampolines?

Trampolines are a general concept similar to "proxy" or "stub",
basically something that solves a problem related to code using
an indirection.  In the case of trampolines, it's usually an indirection
to which you jump in order to actually jump elsewhere.

> A quick Google-fu told me it's a functional programming idiom related
> to continuation-passing-computation (à la call/cc in Scheme).

That's one use of them, indeed.

> Does this mean is it something specific to Elisp?

AFAIK it's never related to an actual language but only to a specific
implementation, so no it's not specific to ELisp.
In this case, it's specific to the new native compiler in Emacs-28.

> But why do they need to be enabled at configuration time?

Whether they do or not depends on the details.  But basically, the
native compiler may sometimes need to compile further code (those small
snippets we call "trampolines") at run time, so it's necessary to
precompile them in those cases where the native compiler may be
available when compiling Emacs but not when running it.


        Stefan




      parent reply	other threads:[~2022-12-05 21:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 13:15 What are trampolines? Alessandro Bertulli
2022-12-05 13:28 ` Eli Zaretskii
2023-04-24 12:24   ` Alessandro Bertulli
2022-12-05 21:38 ` Stefan Monnier via Users list for the GNU Emacs text editor [this message]

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/emacs/

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

  git send-email \
    --in-reply-to=jwvfsdtczso.fsf-monnier+emacs@gnu.org \
    --to=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).