Hacker News new | ask | show | jobs
by ilovecaching 2655 days ago
Why not just wrap libevent or some other battle tested network poller?

Also, this would be super cool if it were in Rust. As it stands writing web services in C++ is basically programming malpractice at this point. Would love to see the author contributing to tokio or hyper and helping us get rid of all this legacy inheritancey impl junk.

3 comments

> As it stands writing web services in C++ is basically programming malpractice at this point.

This is the kind of extremism that makes people hate Rust. Please don't make people hate Rust.

I guess n-gate is right about the horror that is the Rust Evangelism Strike Force.
I am unapologetic about the truth. The calculus engineers employee that leads them to defer the safety of user facing software for the familiarity of C++ has to stop.
Safety is one thing, but let's not pretend Rust has no downsides compared to modern C++. That's just inane.
I don't claim that Rust is bulletproof. You still have to verify the axiomatic unsafe sections of your code. There can still be bugs in Rust itself, or logical errors in your programs. What I do claim is Rust is a giant leap forward over C++, which is an inadequate tool to write software end users will use. As society continues to rely more and more on software, as it becomes the thing that we stake our lives on, we have a moral responsibility to modernize our tools.
Programming languages are not judged on a single gauge labeled "safety."
Rust is designed with the hindsight of C++ and many other languages, it frankly sweeps the floor in every way other than compile times and certain efficiencies, which will inevitably improve. The only legitimate reason to use C++ is to access legacy C++ libraries that Rust has not yet developed and maintain existing C++ projects.
You can catch more flies with honey than with vinegar
It would be much better to use asp.net core over Rust or Drogon. Safe, fast, easy to develop for, easy to hire engineers for, better for actually building a product quickly with fewer bugs.
I'm comparing using Rust versus C++ to build something like Drogon. We're talking about tools to build high performance infrastructure, which is completely different than using the infrastructure from an application developers perspective.
I agree. However your wording just makes you seem like a rust fanboy. Other decent new languages exist such as Nim and Zig.
Nim is playing much of the same tune of D, which ultimately failed to gain the needed traction to be a real competitor. It's already ruined by inheritance and the desire to please everyone with the multi-paradigm, take it or leave it GC, compile to everything approach.

Literally anything would be better than C++ at this point though. I'd take D or Nim over C++ in a heartbeat, which is drowning in the weight of its own specification, coupled with a desire to keep programmers in the dark ages of memory safety by convention and the C preprocessor. It's also impossible to find a C++ code base that doesn't have some sort of safety issue even with smart pointers and RAII. Fuzzing, testing, and trying to patch things up simply isn't enough.

The software landscape has changed, there are now more reasons than every to chose a language based on safety and efficiency than can run everywhere than ever before.

There is zero benefit to using Rust vs. C++ in a high-performance and memory-safe network server. C++ is better in every way you could think of.

(Rust is good idea, but about 10 years immature. Come back in 2029.)

>There is zero benefit to using Rust vs. C++ in a high-performance and memory-safe network server.

Except for, you know, the part where Rust is actually memory-safe and C++ isn't.

It's possible and actual not difficult to write memory-safe C++ code. In the last several years the C++ projects I worked on had close to zero memory issues (I cannot recall any). I think with the advancements of C++14/17 memory issues is a largely solved problem.