help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: What are trampolines?


From: Stefan Monnier
Subject: Re: What are trampolines?
Date: Mon, 05 Dec 2022 16:38:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> 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




reply via email to

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