问HN:在2025年开始一个新的C++项目是否只是个错误?

1作者: leo_e2 个月前原帖
我们是一家小型初创公司,正在构建一个专门的搜索引擎。刚开始时,逻辑很简单:“性能是我们的主要特点,所以我们需要使用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?