问 HN:2025 年开始一个新 C++ 项目是不是个错误?

1作者: leo_e7 个月前
我们是一家正在构建专业搜索引擎的小型初创公司。刚开始时,我们的逻辑很简单:“性能是我们的主要特性,所以我们需要 C++。” 六个月过去了,运行时性能确实惊人,但我们的迭代速度却一落千丈。 感觉我们为每一个功能都付出了巨大的代价。就在昨天,我浪费了整个下午的时间与 CMake 斗争,仅仅是为了链接一个库,而这个库在其他任何生态系统中可能只需要一行代码的 go get 或 npm install 就能搞定。我们还经常遇到幽灵般的 bug,最终发现是我们的 M1 Mac 和 Linux CI 运行器之间微妙的 ABI 不匹配——这些问题在现代工具链中根本不存在。 这令人沮丧,因为我们“较慢”的竞争对手每周都在发布新功能,而我们却被困在调试链接器错误或等待 20 分钟的干净构建中。 我开始怀疑“性能护城河”是否是一个陷阱。对于那些最近开始基础设施项目的人:你们坚持使用 C++了吗?你们转向了 Rust/Go 吗?或者你们只是接受为了原始速度而牺牲开发速度?
查看原文
We are a small startup building a specialized search engine. When we started, the logic was simple: &quot;Performance is our main feature, so we need C++.&quot;<p>Six months in, the runtime performance is amazing, but our iteration speed is absolutely tanking.<p>It feels like we are paying a massive tax on every single feature. Just yesterday, I wasted an entire afternoon fighting CMake just to link a library that would have been a one-line go get or npm install in any other ecosystem. We also constantly deal with phantom bugs that turn out to be subtle ABI mismatches between our M1 Macs and the Linux CI runners—issues that simply don&#x27;t exist in modern toolchains.<p>It’s frustrating because our &quot;slower&quot; competitors are shipping features weekly while we are stuck debugging linker errors or waiting for 20-minute clean builds.<p>I&#x27;m starting to wonder if the &quot;performance moat&quot; is a trap. For those who recently started infra projects: did you stick with C++? Did you bail for Rust&#x2F;Go? Or do you just accept that velocity will be terrible in exchange for raw speed?