summaryrefslogblamecommitdiffstats
path: root/2021/talks/native.md
blob: 3de0494e4113e59dbe7bd0ef24f8fa0d7defe8d2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                                                    
 
 

                                                                 


















                                                                       




















                                                                                                                                                                                                                                                                                                                                                                                                              
 
                                                            
 
                                                            
[[!meta title="Emacs Lisp native compiler, current status and future developments"]]
[[!meta copyright="Copyright © 2021 Andrea Corallo"]]
[[!inline pages="internal(2021/info/native-nav)" raw="yes"]]

<!-- You can manually edit this file to update the abstract, add links, etc. --->


# Emacs Lisp native compiler, current status and future developments
Andrea Corallo



[[!inline pages="internal(2021/info/native-schedule)" raw="yes"]]

Emacs Lisp (Elisp) is the Lisp dialect used by the Emacs text editor
family.  GNU Emacs is traditionally capable of executing Elisp code
either interpreted or byte-interpreted after it has been compiled to
byte-code.

In this talk I'll discuss the Emacs Lisp native compiler.  This feature
recently merged into the main Emacs development line allow for
automatically compiling and executing Elisp as native code.

During the presentation I'll touch on:

-   design goals
-   compiler and runtime design and implementation
-   performance implications
-   upstream process
-   area of improvements and future developments

Format: 40 minutes

# Discussion

IRC nick: akrl

- What's the risk of (setq native-comp-speed 3)? will it melt my cpu?
  - The same as the risk of using -O3 with gcc. It gives itself the latitude to aggressively optimise away code elements which it believes are unnecessary, up to and including violating the language semantics of lisp (which gcc doesn't inherently care about). -O3 is something which is fine for specific cases where you test afterwards, but you would never, for example, set -O3 globally in Gentoo.
- so we can get type annotations in Elisp?!
- Is there a benefit in setting native-comp-compiler-options to "-mtune=native -march=<cpu>"?
- Would Eli agree on replacing the C parts of Emacs with Elisp? ;)
- Why not implement Emacs Lisp in Guile and use Guile's compiler?
  - https://www.emacswiki.org/emacs/GuileEmacs
    - guile elisp is a very-long-term project, but so far has never been good enough: the problem seems to be, alas, time overhead involved in bidirectional conversion of strings and things like that: and unfortunately Emacs is all about strings... guile can run elisp (or something very like it) but that's not anywhere near replacing the elisp interpreter...

Feedback:

- what a great talk. this will rise the hype for emacs 28
- This work is really amazing. Congratulations on the effort and the deep insights that made this possible.
- excellent presentation and work that will be greatly appreciate by all Emacs users.
- It is very humbling to see this depth of knowledge and how it positively impacts my day to day computing experience.
- this is a very interesting update on his talk at last year's GNU Tools Track at LPC :)
- The worse thing about native comp is that you get used to it after a couple of days and you don't appreciate it anymore! ;) which is not fair...

[[!inline pages="internal(2021/captions/native)" raw="yes"]]

[[!inline pages="internal(2021/info/native-nav)" raw="yes"]]