Skip to content

What is clice? ​

In short, clice is a C/C++ language server written in modern C++, and more than a language server. It is still built on LLVM/Clang, but unlike clangd and ccls, which are built on Clang too, it is redesigned from the ground up to solve for good the problems their architecture has left unsolved for years. It is written entirely in C++23 and is itself a showcase of modern C++, with every major modern C++ feature fitting together in a remarkable way:

  • Written entirely with C++20 coroutines, on our structured-concurrency async library built on libuv, for its complex asynchronous logic. It is a complex concurrent program: an event loop on the main thread, with multiple processes (IPC) and multiple threads.
  • Written entirely in C++20 named modules and C++23 import std, and self-hosted: the module wrappers of the third-party libraries are generated by the clice modularize tool, and clice runs well on its own codebase, providing module-aware language services there.
  • Serialization and deserialization in many formats — toml, json, bincode, blob, cli — through static reflection built on templates and C++20 concepts, with annotations declared in the style of Rust macros and no boilerplate to write.
  • Data-oriented throughout: apart from the callback interfaces Clang requires, it uses almost no virtual functions. It leans on modern C++ APIs such as std::format, std::expected, std::ranges and std::views, and none of the outdated APIs of C++98/11.
  • A fully hermetic, reproducible build with Bazel. Everything compiles with the one xclang toolchain, the same cross-compiling experience on every platform. The binaries are highly optimized (ThinLTO) and depend on nothing but the system libraries.

Whether modules and other modern C++ features are usable has long been debated. clice's answer: yes, of course, entirely! They can build complex software of hundreds of thousands of lines like clice, and this may be what modern C++ was meant to look like. On the other hand, today's ecosystem is so inconvenient that making it all work took a great deal of effort to follow and adapt to it.

Language Server ​

The main features of clice:

  • Multi-process compilation: clice compiles in a pool of processes, in the way modern browsers are designed, where clangd uses threads. Why processes? Because C++ is just too complex: on some corner cases the compiler easily crashes or leaks memory. All the more on incomplete code being edited: many downstream users verify the compiler on complete code, very few on incomplete code, where the compiler guesses heuristically as best it can. In clangd, a crashing compile takes the whole server down with it. In clice, compiles run in isolated child processes: one worker crashing affects nothing else, and navigation, highlighting and the like keep working. It also manages memory use and compile priorities better, and spends fewer resources for nothing.

    Left, clangd 23.1.0 with its default settings; right, clice: completion at the same spot crashes Clang every time. After 5 crashes of its whole process, clangd's extension stops restarting it, and hover is gone too; clice loses one worker, notes the crash on the file, and everything else keeps working.

  • Modules and a shared cache: clice fully supports C++20 named modules. Given a compile_commands.json holding all the module files, clice scans the dependencies itself and builds the modules needed, lazily and on demand, whatever your build system or compiler. Completion, highlighting, navigation and hover all support modules fully. The PCHs and PCMs it builds are cached on the local disk and reused across sessions. clangd, by comparison, has only very limited module support, and no persistent cache.

    Left, clangd 23.1.0 with its default settings; right, clice: completing a module name, hovering it to see its comment, Ctrl+clicking into math.cppm, then completing a function the module exports and hovering it.

  • Compilation contexts: clice fully supports non-self-contained files and, more generally, the concept of a compilation context. You can pick the context a file works in explicitly: for a source file, one of its compile commands; for a header, one of the places it is included. Opening a non-self-contained file detects its context automatically, so such files work out of the box. A more general grouping of compiles is supported too, letting you group them by build configuration, for example to switch the compile commands between debug and release.

    Left, clangd 23.1.0 with its default settings; right, clice: opening the non-self-contained real.hpp from precise.cpp, clangd reports 3 errors and clice none; then switching the context from fast.cpp to precise.cpp, the skipped regions and the type of Real follow.

  • Better template support: clice implements a DFS pseudo-instantiator, which works out what many dependent names refer to without instantiating the template with concrete arguments. When the template is instantiated once, clice also uses that instantiation to answer, such as completing the auto parameter of a lambda passed to a ranges call. Beyond that, clice treats a template as a duck-typed interface and each instantiation as one of its implementations, as a virtual function and its overrides: go to implementation on a dependent call in a template lists the function it actually calls in each instantiation, and so do find references and the call hierarchy.

    Completing the dependent name grid[0]. in a template, and the auto parameter of a lambda passed to ranges::for_each.

    Go to implementation on the dependent call shape.draw() lists Circle::draw and Square::draw.

  • Works out of the box: most projects need nothing but a compile_commands.json. clice detects the environment of 50+ toolchains, nvcc, MSYS2, Cygwin and zig cc among them, and handles the differences between the compiler actually used and Clang on its own. No adding piles of compile flags to a configuration file, as clangd needs.

Beyond these main features, clice also solves many small, long-standing clangd issues nobody took up, across semantic highlighting, folding, hover and more; try it now and see what surprises you find. All in all, clice surpasses clangd in ease of use, features and performance.

Why Not Improve clangd? ​

First, why write a new project instead of improving clangd? It is the question asked most often. There are several reasons, some of them set out in my earliest article:

  • Investment: the root problem is that clangd has been effectively unmaintained since around 2024. That is surprising: how can a tool hundreds of thousands of developers use go unmaintained? I found out by accident in 2024, preparing a PR to improve code completion inside templates. As far as I know, it follows a shift in Google's C++ strategy: clangd used to be maintained mainly by a few Google employees, and around 2024 Google's investment in C++ (Clang) began to shrink, clangd was considered to meet Google's internal needs, and those employees were moved to other work. Since then clangd has had no real long-term maintainer: only Nathan Ridge answers questions in his spare time, purely out of love for it (without any pay), and one person's time is limited, leaving large PRs nearly impossible to handle. That is why clangd's modules PR dragged on for nearly a year, and to this day it cannot be used for real on large projects, with many defects nobody handles. In 2026 Aaron Ballman, Clang's lead maintainer, recognized the problem and posted a call for help on the community forum: clangd is very close to unmaintained, with a large backlog of PRs and issues, and without new community maintainers it might eventually be removed from the LLVM project.
  • Scale of the change: as said above, clice makes many architectural innovations, such as multi-process compilation. Implementing them in clangd would come close to rewriting clangd, and nobody would review and accept a change that size. Self-hosting on modules would also change LLVM's build a great deal.
  • The limits of the LLVM repository: clice depends on many third-party libraries for better performance and user experience, such as libuv, simdjson and tomlplusplus. For the convenience of its build, LLVM must be self-contained and cannot take in that many third-party libraries: either they are rewritten and ported into LLVM, or features suffer and performance stays low. Moreover, a language server is not a standalone project: it also includes the plugins adapting it to each editor, which are easiest to maintain in the language server's repository, and LLVM is unlikely to accept that code either (written in Rust, Lua, TypeScript and more). For long-term maintainability and for our core goals, a repository of its own was a must.

So in mid-2024 I began studying how to design and write a new language server, and at the end of 2024 I published The Design and Implementation of a New C++ Language Server, which set clice's core goals, and clice's development formally began.