Website is served from nine Neovim buffers on my old ThinkPad

https://news.ycombinator.com/rss Hits: 3
Summary

This Website is Served from Nine Neovim Buffers on My Old ThinkPad August 18, 2025 TL;DR: I wrote a Neovim plugin in Lua that serves HTTP requests from open buffers. It has no external dependencies, it has first-class support for serving content in Djot, and it is faster than Nginx so it won’t be a performance bottleneck behind a reverse proxy. What’s not to like? There is that famous story from the 1990s about the man who was a Lisper but could not afford any of the commercial Lisps, so he deployed message routing for a German air traffic control system in a headless instance of Emacs. This, of course, is horrific. But it does remind us: our editors are capable of more, if we just let them out of the little nook that they occupy in our imagination. Like Emacs, Vim is also fairly well-regarded for its versatility, although not in the typical systems programming sense. Yet part of the origin story of Neovim specifically is a desire for an editor that can handle asynchronous IO.1 The result of the efforts that that desire spurred is an API that can be put to good use in networking. Fig. 1. A running instance of nvim-web-server. I’ve written a plugin called nvim-web-server that serves HTTP requests in pure Lua. It doesn’t require Node.js, a Python interpreter, or any other external tools. Only Neovim’s Lua API. Benefits (tongue-in-cheek): Instant deployment of new content.2 The lowest-overhead content management system in existence.3 Seamless Git integration.4 Native support for Vim keybindings. Downsides: Of course there are but we will ignore them. This must be slow I had expected nvim-web-server to be slow, given that Lua is a dynamically typed, interpreted language. But it’s not. It is faster than Nginx. How can that be? Well, for one thing, it is purposefully built for serving a static website and nothing more. Nginx can do a lot more than that (even though in this benchmark it doesn’t). Then, nvim-web-server also leverages Neovim’s bindings to libuv, a library th...

First seen: 2025-08-18 12:41

Last seen: 2025-08-18 14:41