all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* What are trampolines?
@ 2022-12-05 13:15 Alessandro Bertulli
  2022-12-05 13:28 ` Eli Zaretskii
  2022-12-05 21:38 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 4+ messages in thread
From: Alessandro Bertulli @ 2022-12-05 13:15 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all!

This is going to be very noob-ish, I apologize.

Going to update Emacs to ver. 30, I noticed in the AUR build script the
optional make target `trampolines'. The script documented them as
"Compile jitted elisp files with trampolines.", and allowed that target
to be built only if native compilation is on as well.

It's not clear to me what does it mean (particularly the documentation
string). What are trampolines? A quick Google-fu told me it's a
functional programming idiom related to continuation-passing-computation
(à la call/cc in Scheme). Does this mean is it something specific to
Elisp? But why do they need to be enabled at configuration time?

Thanks!
-- 
Alessandro Bertulli



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: What are trampolines?
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2022-12-05 13:28 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Alessandro Bertulli <alessandro.bertulli96@gmail.com>
> Date: Mon, 05 Dec 2022 14:15:47 +0100
> 
> It's not clear to me what does it mean (particularly the documentation
> string). What are trampolines?

Emacs built with native-compilation enabled uses them to support advising of
Emacs Lisp primitives.

> Does this mean is it something specific to Elisp?

Yes.

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

They don't.  The Make target you spotted allows building all the trampolines
ahead of time, which is needed for distributing MS-Windows binaries of
Emacs.  See bug#58318 for more details.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: What are trampolines?
  2022-12-05 13:15 What are trampolines? Alessandro Bertulli
  2022-12-05 13:28 ` Eli Zaretskii
@ 2022-12-05 21:38 ` Stefan Monnier via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2022-12-05 21:38 UTC (permalink / raw)
  To: help-gnu-emacs

> 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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: What are trampolines?
  2022-12-05 13:28 ` Eli Zaretskii
@ 2023-04-24 12:24   ` Alessandro Bertulli
  0 siblings, 0 replies; 4+ messages in thread
From: Alessandro Bertulli @ 2023-04-24 12:24 UTC (permalink / raw)
  To: Eli Zaretskii, Stefan Monnier; +Cc: help-gnu-emacs


I realized some time ago that I criminally never answered to your kind
replies. Thanks for your explanation! IIUC then trampolines are
something that will probably never be needed when running Emacs under
Linux with a GCC available. Thanks!

-- 
Alessandro Bertulli



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-24 12:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.