HeadlinesBriefing favicon HeadlinesBriefing.com

A Curmudgeon Tries a Language Server

Hacker News •
×

I write code roughly the same way I did ten years ago: make edits in my text editor, switch to a terminal, and run a command to compile and execute. I look at the result, then switch back to my editor. If unsure, I add tracer prints or restart in a debugger. If an exception crashes my program, I fix it and restart.

I’m envious of what Lisp programmers do. Lisp development happens by typing code directly into the repl to add, remove, and replace parts of the live, running system. A Lisp programmer does not need to “switch over” because they are already inside their program process. They never “compile and execute” because the code is already running, and they edit by hot-swapping. They don’t restart in a debugger because they can inspect anything. They don’t restart on exceptions because the condition system allows resuming from anywhere.

A consequence is that early in a Lisp project, there may not be any source code; the evolving definition exists only in the memory image. This is like how people treat relational databases at the start—the schema exists only in the running database. Eventually, it gets dumped to a file under version control.

I’m not a Lisp developer, so I’ll stay envious. But I realized I haven’t tried to get closer. In Haskell, there are partial wins: the type system reduces exceptions, and the Haskell language server (hls) with Emacs’s Eglot gives better introspection. ghcid watches for changes and recompiles quickly.