TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A year of Rust in ClickHouse

125 pointsby valyalaabout 1 month ago

12 comments

pjmlpabout 1 month ago
I love that it goes both ways, about plus and minus of both languages, including rewriting back into C++ when it made sense, and the side joke about rewriting existing CLI tools in Rust.<p>While C++ isn&#x27;t perfect, has the warts of a 50 year&#x27;s old language, and probably will never match Rust&#x27;s safety, we would already be in a much better place if at least everyone used the tools at their disposal from the last 30 years.<p>While I would advise to use Rust for some security critical scenarios, there are many others where it is still getting there, and there are other requirements to take into account other than affine types.
评论 #43629611 未加载
评论 #43629680 未加载
mplanchardabout 1 month ago
I love this. We are a rust shop and we use clickhouse a fair bit. We’ve been quite impressed with its speed and flexibility. I’m glad to see this kind of direct, real-world feedback around both the benefits and difficulties of mixing rust and C++, which we have also had to do a bit of (albeit in the opposite direction: a smattering of C++ in a sea of rust).<p>I’m not sure if the poster here is the post author, but it would be great if the author would consider filling out this survey that was recently released asking for feedback on the future of rust’s vision: <a href="https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;04&#x2F;04&#x2F;vision-doc-survey.html" rel="nofollow">https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;04&#x2F;04&#x2F;vision-doc-survey.html</a><p>I’d love to see rust become the de facto standard for cross-language portable code by virtue of its ease of use, but as this and our experience highlights, there’s some way to go yet!
评论 #43597797 未加载
ChocolateGodabout 1 month ago
&gt; If you do an experiment and say &quot;C++&quot; anywhere on the Internet, in a minute someone will chime in and educate you about the existence of Rust.<p>Many people see this as a problem. The response to TypeScript choosing Go over Rust was pretty gross imho, no one should be abused for choosing a language.
评论 #43601578 未加载
评论 #43602030 未加载
IshKebababout 1 month ago
This guy seems to be both very positive about Rust and unfairly cynical about it at the same time...<p>Rust is a really fantastic language but having worked on a mixed C++&#x2F;Rust codebase I can see why they had so many issues. Rust just wasn&#x27;t really designed with C++ interop in mind so it&#x27;s kind of painful to use them together. Impressive that they made it work.
评论 #43601424 未加载
评论 #43608329 未加载
epageabout 1 month ago
&gt; As a downside, Rust libraries typically have a large fan-out of dependencies, much like Node.js. This requires taking care to avoid the blow-up of dependencies, and to deal with annoyances of dependabot.<p>In the linked situation, the were using the library of a binary. This get into the tension between &quot;make it easy for `cargo install` (and have a `cli` feature be default) and &quot;make it easy for `cargo add` (and make `cli` opt-in).<p>This is not a great experience and we should improve it. There was an RFC to auto-enable features when a build-target is built (allowing `cli` to be opt-in but `cargo install` to auto-opt-in), rather than skip it, but the dev experience needed work, The maintainer can split the package which helps with semver for the two sides but needs to break one side to do so and if its the bin, people need to discover the suffix (`-bin`, `-cli`, etc).<p>Current workarounds:<p>- `cargo add skim` will show the `cli` feature is enabled and you can re-run with `--no-default-features`<p>- if `cli` wasn&#x27;t a default, `cargo install skim` would suggest adding `--features cli`
alkonautabout 1 month ago
Re: panics: If you have a single long lived process that must do multiple short-lived things (web requests, say) and a panic in one of them MUST NOT take down the whole process, is that extremely difficult to pull off in Rust? I thought you could set up panic boundaries much like you would use catch-all exception handlers around e.g. each web request or similar, in other languages?
评论 #43631461 未加载
评论 #43631411 未加载
chenhoey1211about 1 month ago
Love this approach — Rust in the right places. I’ve been wondering if using Wasm modules (e.g. from MoonBit) for isolated components might offer a similar balance: memory safety without full rewrite.
rokobabout 1 month ago
Given the date on the post, I can’t tell if this is real.
hexoabout 1 month ago
This web is impossible to scroll. Sadly, when I see that I don&#x27;t think I need to read about any technical stuff they did anymore.
loicalleyneabout 1 month ago
<a href="https:&#x2F;&#x2F;github.com&#x2F;UoCCS&#x2F;project-GROS">https:&#x2F;&#x2F;github.com&#x2F;UoCCS&#x2F;project-GROS</a>
评论 #43677861 未加载
dathinababout 1 month ago
One thing I often see pop up in larger projects, which in the article is likely the fault of way to large symbols, is overuse of generics&#x2F;type state&#x2F;etc.<p>Or you could formulate this as needless obsession with not using `dyn`.<p>And sure generics are more powerful, dyn has limitations, etc. etc.<p>It&#x27;s one of this &quot;Misconceptions Programmers believe about Monomorphisation vs. Virtual Calls&quot; things as in:<p>TL;DR: dyn isn&#x27;t as bad as some people make it out to be; Weather perf. or convenience it can be the better choice. Any absolute recommendation of always use this or that is wrong.<p>- wrong: monomorphisation is always faster; reason: monomorphisation pollutes the instruction cache way worse, as such in some situations switching some parts (not all parts) to virtual calls and similar approaches can lead to major performance improvements. Good example here are various experiments about how to implement something like serde but faster and with less binary size.<p>- wrong: monomorphisation was picked in rust because it&#x27;s better for rust; right: it was picked because it is reasonable good and was viable to implement with available resources. (for low level languages it&#x27;s still better then only using vtables, but technically transparent hybrid solutions are even more desirable)<p>- wrong: virtual calls are always slow in microbenchmarks; right: while they are more work to do modern cpus have gotten very very good at optimizing them, under the right conditions the might be literally as fast as normal function calls (but most times they are slightly slower until mono. trashes icache too much)<p>- wrong: monomorphisation is always better for the optimizer; right: monomorphisation gives the optimizer more choices, but always relevant or useful choices but they always add more work it has to do, so slower compiler times and if you are unlucky it will miss more useful optimizations due to noise<p>- wrong: in rust generics are always more convenient to use; right: Adding a generic (e.g. to accomodate a return position impl trait) in the wrong place can lead you to having to write generic parameters all through the code base. But `dyn` has much more limitations&#x2F;constraints, so for both convenience and performance it&#x27;s a trade of which more often favors monomorphisation, but not as much as many seem to believe.<p>- wrong: always using dyn works; right: dyn doesn&#x27;t work for all code and even if it would using it everywhere can put too much burden on the branch predictor and co. making vcalls potentially as slow as some people thing they are (it&#x27;s kinda similar to how to much monomorphisation is bad for the icache and it&#x27;s predictors, if we gloss over a ton of technical details)<p>So all in all understand what your tools entail, instead of just blindly using them.<p>And yes that&#x27;s not easy.<p>It&#x27;s on of the main differences between a junior and a senior skill level.<p>As a junior you follow rules, guidelines (or imitate other) when to use which tool. As a senior you deeply understand why the rules, guidelines, actions of other people are the way they are and in turn know when to diverge from it.
评论 #43646877 未加载
j16sdizabout 1 month ago
Those github pr linked from the blog don&#x27;t give me much confident:<p>Links to &quot;Better C++&quot; is a PR for removing c++ template for build time. Unwinding stack in a &quot;funny&quot; way. PR comment saying something shouldn&#x27;t be public and go on merging anyway.
评论 #43630354 未加载