Emacs architecture
Welcome! I am excited to explore the inner workings of Emacs with you. Before we dive into how its unique C core and Lisp environment collaborate, I'd love to know a bit about your background so I can tailor our conversation.
I already know some Lisp and want to understand Emacs internals.
Since you already know some Lisp, you're going to love how Emacs is structured. At its heart, Emacs isn't actually a text editor that happens to have a scripting language; it is a that is specifically geared toward text manipulation.
The C Core vs. the Elisp Environment
To understand the boundaries, think of Emacs as a two-layer cake. The bottom layer is a lean, highly optimized engine written in C, and the top layer is a massive, flexible environment written in Emacs Lisp (Elisp).
The C Core provides the raw primitives: things like memory management, basic garbage collection, low-level file I/O, the fundamental terminal/GUI display engine, and the Elisp interpreter itself. It's built to interface directly with the host operating system.
The Elisp Environment is where almost all the magic happens. Over 80% of Emacs is actually written in Elisp. When you move a cursor, open a file, or compile code, you are executing Elisp code that sits on top of those low-level C primitives.
The architectural layers of Emacs, showing the Elisp Environment stacked above the C Core, with control flow pointing down to the Host OS.
Next, let's look at why this relationship makes developers refer to Emacs as a "Lisp machine" running as an application.