2021-12-07, updated: 2024-03-12

Tested with Nyxt 2.2.2.

Tags: lisp.

Why isn't Nyxt just an Emacs extension?

Why isn't Nyxt just an Emacs extension?

By Pedro Delfino and John Mercouris

The pointer

Emacs and Nyxt share multiple similarities. This is such an interesting topic that a whole article was written about it! How can I make Emacs my web browser?

Speaking of which, it ended with the following question:

After all this notorious synergy, a question arises: If Nyxt has so many similarities to Emacs and if Emacs has a vibrant ecosystem of extensions and packages, why not build Nyxt as an Emacs package instead of a solo application?

Today, we will attempt to answer just that! :)

Domenico Fetti, Thoughtfull Archimedes - 1620.

Emacs is a survivor, but with scars

Emacs history is beautiful. More relevant than its 36 years of age however, is the fact that Emacs is still being used and developed. To this day, newly minted engineers still pick it up as their editor of choice- not just geezers. It is an editor that has transcended the generations.

Emacs also has an important role in the history of software, according to the book Mastering Emacs, the fork of XEmacs marks the first famous fork in history. A dubious achievement, but one nonetheless.

Even with all these merits, there is a lot of technical debt that saddles Emacs. Thus, it was better to start from a fresh slate. Some of Emacs' critical limitations worth mentioning are the single-threaded nature, Elisp (the language itself), and the difficulty to make use of WebKitGTK within Emacs.

A dispensable barrier

In Statistics, there is a theorem called The Infinite Monkey Theorem. It states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type any given text, such as the complete works of William Shakespeare. Linus Torvalds has a comic adaption for Emacs:

An infinite number of monkeys typing into GNU Emacs would never make a good program

Well… although we love Emacs, we must admit it is hard for newcomers. Even the basics of Emacs are hard to grasp. From my personal experience, Emacs is the hardest and most complex software I have ever used. I learn something new almost every day. For sure, every week. And I've been using it on a daily basis since May, 2021.

Thus, if Nyxt was an Emacs package, by definition, it would be a subset of Emacs. As a consequence, people would need to know and use Emacs to use Nyxt. Instead of having this unnecessary barrier, we chose to build a separate application.

Learning from history

This article discusses the technical trade-off of having the Nyxt browser as an Emacs package instead of a solo application. This is so feasible that Emacs already has a package called EWW, or Emacs Web Wowser.

As most Emacs hackers will admit, despite the cool name, EWW is not great. The main drawbacks hindering the user experience are the lack of JavaScript and the absence of proper CSS rendering.

The Artist in his studio, Rembrandt - 1628

The big dream

The main reason why Nyxt is not built as an Emacs package is the big dream behind Nyxt. As a fully computable environment, Nyxt can be whatever people want it to be, including a full alternative to Emacs. We have a dream… that one day hackers will have an experience better than Emacs :)

Léonidas aux Thermopyles, Jacques-Louis David, 1814

One day, we will bask in the glory of the lispland, without worrying about a single global thread lock. One day, we will have beautiful full color varied width fonts! One day, we will have built-in icons, and sound, and all of the cool things! One day, we will stand tall and look VS code in the eye! :-D

King Leonidas: The world will know that free men stood against a tyrant, that few stood against many, and before this battle was over, even a god-king can bleed.

Nyxt can be more modern, use better looks, have more sane default keybindings, and be easier to approach for newcomers. Stay tuned and may the power of Nyxt be with you!

Did you enjoy this article? Register for our newsletter to receive the latest hacker news from the world of Lisp and browsers!