I discovered Clice a few months ago, but it wasn't stable enough for my needs at the time. It looked very promising, though. I'm glad to hear it's moving to v1.0.
I didn't expect this technical article to end on such a melancholy note. I'm sad that the author feels this way about his work of last years. But it was an interesting read, and I think many of us share these concerns and doubts. Hopefully, even in a world of AI agents, there will still be people that write and read code, and who will enjoy using Clice.
The biggest issue with clangd (and a derivate like this) is that it is at least three orders of magnitude slower than non-clang based indexers like the old ones in Eclipse and Qt Creator. It used to be that I could index a huge codebase in a couple minutes; clangd takes days and therefore we have to trouble with stuff such as remote indices. Frankly, I'd trade anything in the world for a fast indexer that is NOT based on clang, even if it were not perfect (which is kind of the point).
Are you sure? This is explicitly not a ‘derivative’ and has a fascinating coroutine with multiprocess architecture. I would not automatically expect it to be too slow.
I agree re the old ones though. But they did far less. This design is heavy on completing templates. That’s tricky!
I think you should reconcile with Clang and hope that they can work on performance for LSP tasks, because while C++ 26 reflections does a lot of "conservative" things right, it also enabled consteval to create structures with novel shapes, so you need consteval in an indexer.
ie.
auto val = make_named<"x","y">(1, 2.3);
// val is now a struct with an integer field named x and a double field named y
It is still built on LLVM/Clang, but unlike clangd and ccls, which are also Clang-based, clice was redesigned from the ground up to fix architectural problems that have gone unsolved in those servers for years.
Just one data point, because I have to get it off my heart. I loved Modern C++ when it meant C++11, but I've become more negative with each new language standard reaching my workplace.
Using string_view over string by default is probably the #1 cause of memory errors that landed on my desk. I also keep hearing that "int x{0}" is preferable to "int x = 0" which allows for super dangerous implicit conversions, but then the same people rewrite push_back into emplace_back, which is much more lenient w.r.t. type conversions. It is also much easier to litter every function with [[nodiscard]] constexpr nothrow than it is to argue for readability.
My best explanation is that "Modern C++" is making developers biased towards whatever language feature is newer, instead of making good decisions. I wish the community gave up on the moniker.
`string_view` (and `std::span`) is great! Finally I don't have to use concrete types like `const std::string&` or `const std::vector<float>&` as function parameters when all I really want is just something that behaves like a string or array/vector type.
In fact, `std::string_view` can lead to very elegant and efficient (zero-allocation) string parsing code.
IME, taking a string_view as an argument is pretty unproblematic. Two areas where I have seen problems:
1. returning a string_view from a function. Think twice before doing that.
2. calling data() and passing the result to a function that expects a null-terminated C strings. (std::string_view is not guaranteed to be null-terminated.)
---
Apart from that, there are so many great features and libraries in C++17 and C++20 that I use on a regular basis and that I would really miss:
- structured bindings
- if-statement initializers
- fold expressions
- inline variables (very useful for handling global state in header-only stuff)
- if constexpr (replaces many uses of SFINAE)
- concepts (replaces all of the remaining uses of SFINAE)
- coroutines (really nice to use with ASIO)
- std::optional
- std::variant
- std::filesystem
- std::format (although I personally stick to fmt::format)
- from_chars() and to_chars() (fast, local-independent string-number conversion routines)
> all I really want is just something that behaves like a string or array/vector type.
What does behave like a std::string/std::vector but is not std::string/std::vector, respectively? In my experience, if you want a flat array behind a T* (or std::dequeue<T> at the worst) — so that the autovectorization can kick in — then that's precisely what you want, and no generalization to e.g. a linked list, or a heap, or a red-black tree is really possible.
To be fair, string_view has one very attractive feature over const ref string. String's char constructor is not explicit. With string view, you are guaranteed to not allocate by accident.
In the case of C++, "modern" conventionally denotes "C++11 or later". Idiomatic code between "legacy" and "modern" dialects of C++ that they almost look like different languages. C++11 was a breaking change to the idioms of older C++.
This is helpful context to the reader. Many C++ programmers are unfamiliar with either idiomatic legacy or modern dialects and would have difficulty following the code.
There are arguably three different idiomatic dialects of C++ now: legacy, C++11, and C++20. We don't really have a common term for distinguishing between C++11 and C++20 even though the idiomatic code looks quite different.
It has been an interesting evolutionary strategy. C++ standards meticulously avoid breaking changes but will happily do a major redesign of how idiomatic code is written.
Yes. Using C++23 in work with house-built coroutine abstraction is very fun and robust. Have to admit that it just requires certain level of skills of your colleague, and unfortunately general hires don't have.
Interesting they show clangd crashing in vscode. That's been my biggest gripe with it. But they also show clice crashing in the same spot? Seems odd to not just fix it
Because C++ is simply too complex, and on certain corner cases the compiler can easily crash or leak memory. That is especially true for incomplete code in the middle of editing: a huge downstream user base tests compilers on complete code, while very few people test them on half-written code, where the compiler mostly falls back on best-effort heuristics
It's the compiler that crashes. Both clangd and clice are built on top of the same compiler (clang) which is why both experience a crash on the same code.
I'm not a C++ expert, but I don't see anything in the shown snippet that would cause a language server crash, so I imagine the server is crashing on something off screen.
I could understand them showing off crash recovery by using code deliberately written to crash the language server, and so not being something you can "fix".
IME it's nothing about the code. It'll be weird setup issues that aren't traceable. In one IDE I end up having to just have a new workspace and copy the code over and somehow that fixes it. It's truly beyond me. At best I'll see an ENOENT error but that doesn't help me much.
Meh, I will stick with the kind of C++ that is useful and readable, basically C++98 or C with classes. There are now ten ways of doing the same thing, the language is a complete mess.
I'm not against agentic coding, but insanely verbose commit messages in place of actual decision making records are definitely an anti-pattern.
Requirements, specs, and ADRs shouldn't be thrown out with agentic development. I've found that using rust-style `r[rule.id]` for requirements and specs with ADRs works a lot better than verbose commits.
I discovered Clice a few months ago, but it wasn't stable enough for my needs at the time. It looked very promising, though. I'm glad to hear it's moving to v1.0.
I didn't expect this technical article to end on such a melancholy note. I'm sad that the author feels this way about his work of last years. But it was an interesting read, and I think many of us share these concerns and doubts. Hopefully, even in a world of AI agents, there will still be people that write and read code, and who will enjoy using Clice.
The biggest issue with clangd (and a derivate like this) is that it is at least three orders of magnitude slower than non-clang based indexers like the old ones in Eclipse and Qt Creator. It used to be that I could index a huge codebase in a couple minutes; clangd takes days and therefore we have to trouble with stuff such as remote indices. Frankly, I'd trade anything in the world for a fast indexer that is NOT based on clang, even if it were not perfect (which is kind of the point).
Are you sure? This is explicitly not a ‘derivative’ and has a fascinating coroutine with multiprocess architecture. I would not automatically expect it to be too slow.
I agree re the old ones though. But they did far less. This design is heavy on completing templates. That’s tricky!
I think you should reconcile with Clang and hope that they can work on performance for LSP tasks, because while C++ 26 reflections does a lot of "conservative" things right, it also enabled consteval to create structures with novel shapes, so you need consteval in an indexer.
ie.
auto val = make_named<"x","y">(1, 2.3);
// val is now a struct with an integer field named x and a double field named y
Derivative?
Going on a tangent, but I'm always owndering if "modern C++" sounds rather appealing or off-putting to most people?
Just one data point, because I have to get it off my heart. I loved Modern C++ when it meant C++11, but I've become more negative with each new language standard reaching my workplace.
Using string_view over string by default is probably the #1 cause of memory errors that landed on my desk. I also keep hearing that "int x{0}" is preferable to "int x = 0" which allows for super dangerous implicit conversions, but then the same people rewrite push_back into emplace_back, which is much more lenient w.r.t. type conversions. It is also much easier to litter every function with [[nodiscard]] constexpr nothrow than it is to argue for readability.
My best explanation is that "Modern C++" is making developers biased towards whatever language feature is newer, instead of making good decisions. I wish the community gave up on the moniker.
`string_view` (and `std::span`) is great! Finally I don't have to use concrete types like `const std::string&` or `const std::vector<float>&` as function parameters when all I really want is just something that behaves like a string or array/vector type.
In fact, `std::string_view` can lead to very elegant and efficient (zero-allocation) string parsing code.
IME, taking a string_view as an argument is pretty unproblematic. Two areas where I have seen problems:
1. returning a string_view from a function. Think twice before doing that.
2. calling data() and passing the result to a function that expects a null-terminated C strings. (std::string_view is not guaranteed to be null-terminated.)
---
Apart from that, there are so many great features and libraries in C++17 and C++20 that I use on a regular basis and that I would really miss:
- structured bindings
- if-statement initializers
- fold expressions
- inline variables (very useful for handling global state in header-only stuff)
- if constexpr (replaces many uses of SFINAE)
- concepts (replaces all of the remaining uses of SFINAE)
- coroutines (really nice to use with ASIO)
- std::optional
- std::variant
- std::filesystem
- std::format (although I personally stick to fmt::format)
- from_chars() and to_chars() (fast, local-independent string-number conversion routines)
- std::bit
- std::apply, std::invoke, std::bind_front
- etc.
> all I really want is just something that behaves like a string or array/vector type.
What does behave like a std::string/std::vector but is not std::string/std::vector, respectively? In my experience, if you want a flat array behind a T* (or std::dequeue<T> at the worst) — so that the autovectorization can kick in — then that's precisely what you want, and no generalization to e.g. a linked list, or a heap, or a red-black tree is really possible.
To be fair, string_view has one very attractive feature over const ref string. String's char constructor is not explicit. With string view, you are guaranteed to not allocate by accident.
In the case of C++, "modern" conventionally denotes "C++11 or later". Idiomatic code between "legacy" and "modern" dialects of C++ that they almost look like different languages. C++11 was a breaking change to the idioms of older C++.
This is helpful context to the reader. Many C++ programmers are unfamiliar with either idiomatic legacy or modern dialects and would have difficulty following the code.
There are arguably three different idiomatic dialects of C++ now: legacy, C++11, and C++20. We don't really have a common term for distinguishing between C++11 and C++20 even though the idiomatic code looks quite different.
It has been an interesting evolutionary strategy. C++ standards meticulously avoid breaking changes but will happily do a major redesign of how idiomatic code is written.
Yes. Using C++23 in work with house-built coroutine abstraction is very fun and robust. Have to admit that it just requires certain level of skills of your colleague, and unfortunately general hires don't have.
Maybe they are referring to Effective Modern C++ book by Scott Meyers.
I think "modern" is used to contrast newer C++ standards from C++98.
Or an older book.
"Modern C++ Design: Generic Programming and Design Patterns Applied" by Andrei Alexandrescu
Actually, he coined the term. Then Scott Meyers reused it, and now it is a common adjective used before C++ books, libraries, tooling, and so on.
They are quite explicitly referring to C++23
Sounds tiring, CPP has been modernised, killed, solved, so many so so many times now, not even one was for real, this wont be the one either
Interesting they show clangd crashing in vscode. That's been my biggest gripe with it. But they also show clice crashing in the same spot? Seems odd to not just fix it
They explain exactly why in article:
Because C++ is simply too complex, and on certain corner cases the compiler can easily crash or leak memory. That is especially true for incomplete code in the middle of editing: a huge downstream user base tests compilers on complete code, while very few people test them on half-written code, where the compiler mostly falls back on best-effort heuristics
It's the compiler that crashes. Both clangd and clice are built on top of the same compiler (clang) which is why both experience a crash on the same code.
I'm not a C++ expert, but I don't see anything in the shown snippet that would cause a language server crash, so I imagine the server is crashing on something off screen.
I could understand them showing off crash recovery by using code deliberately written to crash the language server, and so not being something you can "fix".
IME it's nothing about the code. It'll be weird setup issues that aren't traceable. In one IDE I end up having to just have a new workspace and copy the code over and somehow that fixes it. It's truly beyond me. At best I'll see an ENOENT error but that doesn't help me much.
Interesting project and great writeup! Looking forward to try this.
Meh, I will stick with the kind of C++ that is useful and readable, basically C++98 or C with classes. There are now ten ways of doing the same thing, the language is a complete mess.
The vibe smell is one of the strongest I've ever encountered. Who thought commit messages each dwarfing a Dumas novel was a good idea?
https://github.com/clice-io/clice/commits/main/
I'm not against agentic coding, but insanely verbose commit messages in place of actual decision making records are definitely an anti-pattern.
Requirements, specs, and ADRs shouldn't be thrown out with agentic development. I've found that using rust-style `r[rule.id]` for requirements and specs with ADRs works a lot better than verbose commits.
Requirements cover what, specs cover how, ADRs cover why, and git commits cover when.
It's slop, unfortunately.