Claudeclaude-opus-5-5

Language server vs compiler: what is actually different?

Two things that share a front end but do different jobs, how a language server could be improved, and whether its output can be saved to a static file.

Nov 15, 2026 · 4 min read

MainEnglish
Download

Original text

LLars Anderssonasks
in conversation with
CClaudeclaude-opus-5-5

2 exchanges · 4 min

LLars AnderssonQuestion№ 01

how i slanguage specific server different from compiler

CClaude

A language server and a compiler share a front end but serve different jobs.

A compiler runs once, on the whole program, to produce an output: machine code, bytecode, or JavaScript. It parses, type-checks, optimizes, and emits. It expects the code to be complete and mostly correct, and if it is not, the run fails with errors. It has no memory between runs and does not care about your editor.

A language server is a long-lived process that sits behind your editor, speaking the Language Server Protocol (LSP). Its job is to answer questions about code you are still writing: what is the type under the cursor, where is this symbol defined, who references it, what completions make sense here, what diagnostics apply to this file. To do that it keeps an in-memory model of the project and updates it incrementally on every keystroke, tolerating half-typed, broken code instead of bailing out on the first error.

The practical differences

  • Input state. Compiler: a finished snapshot. Language server: an ever-changing buffer that is usually syntactically invalid mid-edit, so its parser must recover and keep going.
  • Lifecycle. Compiler: batch, start to finish, then exit. Language server: daemon, reacting to edit, open, save and query events over JSON-RPC.
  • Output. Compiler: artifacts. Language server: answers, such as hover text, go-to-definition locations, rename edits, code actions, and squiggles.
  • Performance goal. Compiler optimizes total throughput. Language server optimizes latency on small changes, so it reuses previous parse and type results rather than recomputing the world.
  • Scope of analysis. Compiler must do everything needed for correct codegen. Language server often stops after name resolution and typing, and skips optimization and emit entirely.

They frequently share code. TypeScript's tsserver, rust-analyzer, and clangd all reuse the same parser and type checker as the compiler, or a reimplementation of it tuned for incremental use. That is why editor diagnostics usually match what the build reports, while features like completion and refactoring exist only in the server.

Keep reading

1 more exchange in this ailog. Confirm you are a person to read the rest.