clice v1.0 Released: Welcome to Modern C++

clice recently hit 1,000 commits, a special milestone for the project. Since July 19, 2026, clice has been shipping nightly builds and going through roughly four months of alpha testing, with a huge number of bugs fixed thanks to real-world feedback from early users. Over the same stretch, I built a rigorous testing system for clice and ran extensive tests across many real open-source projects, tracking down and fixing the issues they uncovered. What does that mean? Every core feature is now stable, and you rarely run into problems in day-to-day use. So I think the time is right to ship the first stable release. The project looks very different today from where it stood two years ago in Design and Implementation of a New C++ Language Server, and this is probably the first time I’m promoting it widely, so please let me introduce it to you once again! This is the project I have poured the past two and a half years into, the work I am proudest of, the one that has excited me the most and left me sad and anxious more times than I can count, and the most ambitious thing I have taken on in my short life. ...

2026-11-15 · 9 min · 4248 words · ykiko

Starting with import std: Modern C++ Toolchain Best Practices

TL;DR: xclang is a cross-compiling Clang toolchain we developed for clice—essentially rustup for Clang. It bundles the compiler, linker, and sysroots with prebuilt runtimes for all six x64 and arm64 targets across Linux, Windows, and macOS into a single archive under 100 MB, so cross-compiling just takes passing --target. Compiled binaries statically link the C++ runtime: copy a single file over and it runs on Linux with glibc 2.17+, Windows 10+, and macOS 13+. Apple and Microsoft SDKs are not bundled; users can download them from official sources with xclang sdk fetch, making it possible to build for macOS and MSVC targets even on Linux. It integrates directly with CMake and Bazel, with import std working out of the box. The compiler itself is built with PGO + ThinLTO, matching official LLVM releases in C++ compilation speed and running even faster on Windows. ...

2026-10-06 · Updated 2026-10-08 · 21 min · 4301 words · ykiko

Beyond the Language Server

Three months have passed since my last post. A lot has happened in the meantime, so I figured I’d write another post to share some recent progress and what’s been on my mind lately. ...

2026-08-09 · Updated 2026-08-11 · 26 min · 5329 words · ykiko

clice in the Agent Era

It has been almost half a year since my last update on clice. Taking advantage of a rare stretch of free time over the May Day holiday, I’d like to write down our recent progress along with some personal thoughts. The topics are somewhat scattered, though they might be interconnected in a few ways. ...

2026-05-04 · Updated 2026-05-06 · 27 min · 5651 words · ykiko

Building an Elegant C++ Cross-Platform Development and Build Workflow

C++ build issues have always been a hot topic, especially in various language wars, where they are often used as a negative example. Interestingly, most C++ programmers are often involved in maintaining existing systems, facing highly solidified, unchangeable build processes. The number of people who actually need to set up a project from scratch is in the minority. ...

2025-12-20 · Updated 2026-03-27 · 25 min · 5284 words · ykiko

Support AOT for CuTe DSL

Why do we need AOT for CuTe DSL? CUTLASS C++ is a library for writing high-performance CUDA operators, known for its complexity and difficulty. To reduce the learning curve, NVIDIA introduced the Python-based CuTe DSL. Using Python instead of C++ templates for metaprogramming offers many benefits. First, users no longer have to struggle with the obscure template errors of C++, which is a major headache for C++ beginners; now they can focus on the code logic. Additionally, nvcc compilation is slow, and most of that time is spent in the compiler frontend, parsing C++ code. Especially for template-heavy libraries like CUTLASS, most of the time is spent processing template instantiations. Using CuTe DSL can bypass this issue. Compared to C++ code using CUTLASS, its compilation speed can be tens or even hundreds of times faster. Furthermore, operators and unit tests can now be written together in Python, which is much more convenient. ...

2025-11-11 · Updated 2025-11-17 · 7 min · 1294 words · ykiko

Clice, how have you been lately?

Last night, I bought the domain name clice.io and deployed clice’s documentation website on it. There’s an indescribable joy in my heart. On one hand, I really like the clice.io domain; it looks very refined and beautiful. I actually had a few other candidates, such as .dev, but in the end, I chose this one, which is relatively more expensive (500 per year) but looks better. On the other hand, it signifies that clice has entered a new phase. ...

2025-07-24 · Updated 2025-07-25 · 3 min · 1324 words · ykiko

Reflection for C++26!!!

At the C++26 Sofia meeting, which just concluded yesterday, seven proposals related to Static Reflection: Reflection for C++26 Function Parameter Reflection Annotations for Reflection Splicing a base class subobject Expansion Statements definestatic{string,object,array} Error Handling in Reflection All passed plenary and were officially incorporated into the C++26 standard. This is an exciting moment. In my opinion, static reflection is undoubtedly the most important new feature in C++ in 20 years. It completely changes the previous pattern of metaprogramming using templates, making meta programming code as easy to read, write, and use as ordinary code logic, rather than the template-based DSLs of the past. ...

2025-06-21 · Updated 2025-07-08 · 11 min · 5407 words · ykiko

Deep Dive into Clang (Part 1)

After the article about clice was published, the response I received far exceeded my expectations, and many friends expressed a desire to participate in the development. While this enthusiasm is good, the barrier to entry is not low, mainly due to the difficulty of interacting with clang’s API. What makes it difficult? On the one hand, there is relatively little information about clang on the internet, whether in Chinese or English communities (this is expected, as there is very little demand for it, so naturally few people discuss it). On the other hand, due to the complexity of the C++ language itself, many details require a deeper understanding of the language before they can be grasped, and connecting theory with implementation is not easy. ...

2025-02-04 · Updated 2025-02-05 · 6 min · 2893 words · ykiko

Design and Implementation of a New C++ Language Server

It’s been several months since my last blog post. The reason for this long hiatus is that I’ve been busy working on clice – a brand new C++ language server. Some readers might be unfamiliar with the concept of a language server. However, you’ve certainly used IDEs like Visual Studio or CLion and experienced features such as code completion, navigation, and refactoring. In traditional IDEs, these features were implemented by IDE plugins or built-in functionalities. This approach meant that each language required separate support development for every editor, leading to high maintenance costs. When Microsoft released Visual Studio Code, they aimed to solve this problem and thus introduced the LSP (Language Server Protocol) concept. LSP proposes a standard client-server model. Language features are provided by an independent language server, and VSCode only needs to implement a generic client to communicate with it. This method decouples the editor from language support, allowing VSCode to easily support multiple languages. For example, if you want to view the implementation of a method, your editor will send a go to implementation request to the language server. The specific content of this request might include the file path and the current cursor position in the source file. The language server processes this request and returns a file location and coordinates, which the editor then uses to open the corresponding file and navigate. ...

2024-12-18 · Updated 2025-11-27 · 7 min · 3473 words · ykiko

St. Louis WG21 Meeting Review

Due to a series of coincidences, I participated in last week’s WG21 meeting (the C++ Standards Committee meeting). Although I often browse new proposals for the C++ standard, I never expected to one day actually attend a WG21 meeting and get real-time updates on the latest progress of the C++ standard. Of course, this was my first time attending, and I was very excited. I’m writing this to record my feelings and the progress of the meeting. ...

2024-07-01 · Updated 2024-07-01 · 10 min · 1990 words · ykiko

The Perfect Combination of Python and C++: Object Design in pybind11

I participated in Google Summer of Code 2024. The main task was to implement a pybind11-compatible interface for a Python interpreter. Saying “implement a compatible interface” is somewhat of an understatement — it was essentially a rewrite of pybind11, so I’ve been spending a lot of time reading through its source code lately. ...

2024-06-07 · Updated 2024-12-02 · 4 min · 1675 words · ykiko

Is the singleton pattern in C++ truly a 'singleton'?

Singleton Pattern is a common design pattern, often applied in scenarios such as configuration systems, logging systems, and database connection pools, where object uniqueness must be ensured. But can the Singleton Pattern truly guarantee a single instance? What are the consequences if uniqueness is not guaranteed? ...

2024-05-09 · Updated 2024-05-14 · 4 min · 1999 words · ykiko

Super easy-to-use C++ Online Compiler (VSCode Version)

Compiler Explorer is a very popular online C++ compiler, which can be used to test different compilation and execution environments, or to share code. As a C++ enthusiast, I interact with it almost every day, and its frequency of use far exceeds my imagination. At the same time, I am also a heavy VSCode user, completing almost everything within VSCode. Considering that I often write code locally and then copy it to Compiler Explorer, it always felt uncomfortable. Sometimes I would directly modify it on its web editor, but without code completion, that was also uncomfortable. Therefore, I collaborated with @iiirhe to write this extension Compiler Explorer for VSCode, which integrates Compiler Explorer into VSCode based on the API provided by Compiler Explorer, allowing users to directly use Compiler Explorer’s features within VSCode. ...

2024-04-24 · Updated 2024-05-04 · 3 min · 607 words · ykiko

Thoroughly Understanding C++ ABI

Application Binary Interface, or ABI as we commonly call it, is a concept that feels both familiar and unfamiliar. Familiar in what sense? It’s often discussed when troubleshooting, frequently mentioned in articles, and sometimes we even have to deal with compatibility issues it causes. Unfamiliar in what sense? If someone asks you what an ABI is, you’ll find that you know what it’s about, but describing it in precise language is quite difficult. In the end, you might just resort to saying, as WIKI does: an ABI is an interface between two binary program modules. Is there a problem with that? No, as a general description, it’s sufficient. But it can feel a bit hollow. ...

2024-04-16 · Updated 2025-12-24 · 11 min · 5266 words · ykiko

Where exactly does C++ code bloat occur?

Readers probably often hear people say that C++ code suffers from severe binary bloat, but usually few people point out the specific reasons. After a search online, I found that there aren’t many articles that delve deeply into this issue. The above statement is more like part of a cliché, passed down by word of mouth, but few can explain why. Today, your editor ykiko will take everyone on a journey to explore the ins and outs of C++ code bloat (^ω^) ...

2024-03-11 · Updated 2024-12-24 · 9 min · 4190 words · ykiko

The History of constexpr in C++! (Part Two)

Prequel: The History of constexpr in C++! (Part One) 2015-2016: Syntactic Sugar for Templates In C++, there are many templates that support full specialization, but not many that support partial specialization. In fact, only class templates and variable templates support it. Variable templates can actually be seen as syntactic sugar for class templates, so rounding it up, only class templates truly support partial specialization. The lack of partial specialization can make some code very difficult to write. ...

2024-02-22 · Updated 2024-11-30 · 8 min · 3732 words · ykiko

The History of constexpr in C++! (Part One)

A few months ago, I wrote an article introducing C++ templates: Looking at Flowers in a Fog: A True Understanding of C++ Templates. It clarified the position of templates in modern C++. Among the changes, using constexpr functions to replace templates for compile-time computation is arguably one of the most important improvements in modern C++. constexpr itself is not difficult to understand; it’s very intuitive. However, because it has been improved in almost every version of C++, the features available in different C++ versions vary greatly, which can sometimes give a feeling of inconsistency. ...

2024-02-10 · Updated 2024-12-18 · 9 min · 4466 words · ykiko

How to elegantly convert enum to string in C++?

no hard code Define an enum enum Color { RED, GREEN, BLUE }; Try to print Color color = RED; std::cout << color << std::endl; // output => 0 If we need enums as log output, we don’t want to manually look up the corresponding string based on the enum value when viewing logs, which is troublesome and not intuitive. We want to directly output the string corresponding to the enum value, such as RED, GREEN, BLUE. ...

2024-01-29 · Updated 2025-07-08 · 8 min · 1514 words · ykiko

Relocate Semantics in C++

As is well known, there are currently two special constructors in C++: the copy constructor and the move constructor. The copy constructor was added in C++98 to copy an object. For resource-owning types like vector, copying involves copying the resources it owns. ...

2024-01-25 · Updated 2024-12-18 · 5 min · 2364 words · ykiko

A 7-Year Relay Race: Getting the Number of Fields in a C++ Struct

Introduction In C++17, a feature called “structured binding” was introduced. This feature is similar to pattern matching in other languages and allows us to conveniently access members of a struct. ...

2023-12-25 · Updated 2025-01-14 · 10 min · 4674 words · ykiko

Implement Object in C++!

Static and Dynamic The terms static typing and dynamic typing are probably familiar to everyone. The key to distinguishing between them lies in the timing of type checking. What does that mean? ...

2023-12-03 · Updated 2024-11-30 · 4 min · 1812 words · ykiko

Why is it said that C/C++ compilers do not preserve metadata?

First, what is metadata? Consider the following python code. We want to automatically modify the corresponding field value based on the input string. class Person: def __init__(self, age, name): self.age = age self.name = name person = Person(10, "xiaohong") setattr(person, "age", 12) setattr(person, "name", "xiaoming") print(f"name: {person.name}, age: {person.age}") # => name: xiaoming, age: 12 setattr is a built-in python function that perfectly meets our needs. It modifies the corresponding value based on the input field name. ...

2023-12-03 · Updated 2024-11-30 · 4 min · 1949 words · ykiko

Master your C++ code with Clang tools.

Clang is a C-language family compiler frontend provided by the LLVM project. It was originally developed to replace the C language frontend of the GNU Compiler Collection (GCC), with the goal of providing faster compilation speeds, better diagnostic information, and a more flexible architecture. Clang includes C, C++, and Objective-C compiler frontends, which are designed to be embedded in other projects. A key feature of Clang is its modular architecture, which makes it easier for developers to extend and customize compiler functionality. Clang is widely used in many projects, including LLVM itself, the development of some operating system kernels, and the implementation of compilers for some programming languages. ...

2023-11-29 · Updated 2024-11-30 · 6 min · 2900 words · ykiko

Various approaches to code generation

Introduction Let’s take a recent requirement as an introduction. We all know that Markdown can use lang to fill in code blocks and supports code highlighting. However, I wanted to support my own custom code highlighting rules and encountered the following problems: ...

2023-11-29 · Updated 2024-11-30 · 4 min · 1801 words · ykiko

A Reflection Tutorial for C++ Programmers

What is Reflection? The term Reflection is probably not new to anyone; perhaps you haven’t used it, but you’ve certainly heard of it. However, like many other idiomatic terms in the CS field, there isn’t a clear and precise definition for reflection. This leads to a situation where, for languages like C#, Java, and Python that have reflection, discussing it naturally brings to mind related facilities, APIs, and code examples in those languages, making it very concrete. But for languages like C, C++, and Rust, which don’t have reflection, when reflection is discussed, people are often unsure what the other person is referring to, making it very abstract. For example, someone might tell me that Rust has reflection, and the example they provide is the introduction to std::Any module in Rust’s official documentation. It mentions: ...

2023-11-29 · Updated 2024-10-21 · 3 min · 1215 words · ykiko

C++26 Static Reflection Proposal Analysis

Recently, I’ve been planning to write a series of articles discussing the concept of reflection in detail. Coincidentally, C++26 has a new reflection proposal, and I noticed there aren’t many related articles on Zhihu, despite this topic being frequently discussed. So, I’m taking this opportunity to talk about static reflection in C++, as a warm-up for the series. ...

2023-10-16 · Updated 2025-06-22 · 5 min · 2379 words · ykiko

C++ Pointers to Members: A Comprehensive Guide

Introduction In C++, an expression like &T::name returns a pointer to member. It’s occasionally used when writing code, but this concept might not be familiar to many. Consider the following code: ...

2023-10-04 · Updated 2024-12-18 · 11 min · 2283 words · ykiko

Seeing Through the Fog: A True Understanding of C++ Templates

The concept of templates in C++ has existed for over twenty years. As one of the language’s most important constructs, there is no shortage of related discussion. Unfortunately, truly in-depth and valuable discussions are rare — especially those that examine the feature from multiple perspectives. Many articles on templates tend to entangle the topic with various syntactic details, easily leaving readers with a hazy impression. Similar things happen elsewhere: introductions to coroutines often mix them with all kinds of I/O concerns, and discussions of reflection seem confined to reflection in Java or C#. This isn’t unreasonable, but it often leaves readers unable to grasp the essence. After consuming a lot of content, one still can’t get to the heart of the matter, and it becomes easy to conflate different concepts. ...

2023-09-12 · Updated 2025-12-24 · 10 min · 4634 words · ykiko

C++ Forbidden Black Magic: STMP (Part 2)

In the previous article, we gained a preliminary understanding of the principles of STMP and used it to implement a simple compile-time counter. However, its power extends far beyond that. This article will discuss some advanced applications based on STMP. ...

2023-07-30 · Updated 2026-03-14 · 8 min · 1574 words · ykiko

C++ Forbidden Black Magic: STMP (Part 1)

As is well known, traditional C++ constant expression evaluation neither depends on nor changes the global state of the program. For any identical input, its output is always the same, and it is considered purely functional. Template Meta Programming, as a subset of constant evaluation, should also adhere to this rule. ...

2023-07-29 · Updated 2026-03-14 · 10 min · 2118 words · ykiko

std::variant is hard to use!

std::variant was added to the standard library in C++17. This article will discuss the background of its inclusion and some issues related to its usage. sum type First, let’s discuss sum types, also known as tagged unions. A sum type is a type that can hold a value of only one of several possible types. ...

2023-07-25 · Updated 2024-07-20 · 3 min · 1388 words · ykiko