Building even faster interpreters in Rust
blog.cloudflare.com
blog.cloudflare.com
PL evangelism and marketing are fine, but these blogs about Rust that come out 2-3 times a week and always make it to the HN or Lobsters front page seem a bit contrived.
https://hn.algolia.com/?dateRange=all&page=0&prefix=true&sor...
https://hn.algolia.com/?dateRange=all&page=0&prefix=true&sor...
Please see my reply to you downthread: https://news.ycombinator.com/item?id=24601088. You've broken the site guidelines badly and normally we'd be banning an account for doing this.
I don't see many such articles on HN, but is that because they are ignored, or because there aren't many submitted?
> This isn't an optimization article that incidentally mentions Rust. It's a Rust-evangelism article that incidentally mentions optimization
I'm not sure we read the same article - I don't use Rust, but I followed along with the article just fine. It seemed to me much more about SIMD and string matching algorithms
I don't think "the people have spoken, and they want Rust!" I think you have a small number of very obsessive people who treat a programming language's popularity of all things as a crusade. JetBrains publishes the data from their developer surveys, and you can see the last one that very few people use Rust at all, and of those, very few, less than 1 in 8, have ever used it for actual work. If you look at surveys from previous years, you can see very little user retention. Why does nobody keep using the most-loved lang for more than a year?
Because it's just a sham, like how a decade ago everyone was 'learning' Haskell and writing blogs about Monads and how FP was the secret sauce for their next-big-thing. It's exhausting. We've had non-stop but-what-about-Rust since, what, 2011?
This horse is dead.
Rust is at the top of the hype cycle heap these days. The programming language in that position always gets undue attention on internet forums. HN has seen it happen more than once over the years, including with Go, Node, and so on. Forum readers like to read about shiny newness, and it's natural to they want to read about languages they don't use yet, especially when they find them exciting and want to believe the "this time is different" story.
That bias may be a problem in the software world (I personally think it is), but it's not evidence of brigading, and you can't make up stories about that here, and particularly not attack others personally about it (https://news.ycombinator.com/item?id=24596207). If you think you're seeing actual evidence of manipulation, please follow the guidelines and email hn@ycombinator.com so we can investigate.
Rust is just a more modern, better and more approachable programming language than C and C++, and people care about it more and prefer to get their little system programming lessons in it.
And I say this as the person who wrote the only non-PCRE regex engine that appears in the top 20 entries of the regex-redux benchmark.
Besides, if people want to use PCRE2 from Rust, then it's as simple as using a crate (which I also wrote): https://docs.rs/pcre2
Let it go. Even by your own reasoning, reading anything into the Cloudfront article would be a mistake, right? Yet, here it is on the front page. Dutifully upvoted.
These kind of conditions occur in libc implementations where the library interfaces don't provide separate initialization and search phases; all you get is a substring search routine. (The interface is limiting; you can never avoid the overhead of constructing the searcher for a particular needle, even if you are using the same needle to search many different short haystacks.)
Whether one is better than the other is hard to say. Substring search routines these days are dominated by vector instructions and how effective you use them in the common cases.
KMP is basically never used. I can't think of a single place where it is used off the top of my head.
Probably why I love native binaries.
A sufficiently smart interpreter for a language can be faster than a native binary as the former has the freedom to adapt to dynamic conditions. This is the essential point of JITs. It beats ahead of time compilation when dynamic conditions do change but slowly enough to amortize the overhead of adapting to it.
The only reason why interpreted languages are usually much slower is semantics of the language itself. And maybe JITing itself, but that tends to get amortized rather quickly.