Live data from Hacker News

Rust Is Surprisingly Good as a Server Language

stu2b50.dev

1–10 of 352 posts

Re: Rust Is Surprisingly Good as a Server Language

#3

You guys think Rust is good - you should check out Ada++ (you'll have to build GCC yourself though) http://www.adapplang.com

Does it provide the same/better safety guarantees as Rust? The website has extremely limited information about the language.

Re: Rust Is Surprisingly Good as a Server Language

#4
I took an example of a server straight from the Rust async book, and to my surprise, it performed very well for a long time serving real internet requests till I actually had to modify it:

https://rust-lang.github.io/async-book/01_getting_started/05...

My server processes JSON requests and returns JSON and also serves a couple of static files that I simply read with

    include_bytes!("../files/index.html")
Once you understand Rust async model (which I recommend as a mental exercise for any programmer), it's all very simple.

Re: Rust Is Surprisingly Good as a Server Language

#5
I started learning Rusit and using it for hobby projects in 2014, but I have to agree: for a full-blown product development it's just not there yet. Static typing your code up to the point where you can assume it's correct if it compiles and managing memory manually without the need for a garbage collector, these two things alone just light up my inner nerd with excitement. But as an engineer who has to deliver a product in time and in a maintainable shape (which means "hiring considerations"), I just can't excuse using Rust instead of NodeJS or Python. Web servers that work on request/response model are ideally suited for garbage collection, and just as OP says, they're IO bound, not CPU bound. All these wonderful things that Rust offers are just not that important in the real world.

But if I ever have to write a small (in terms of requirements and potential LOC, not load), atomic, CPU-bound microservice that will probably not require a lot of maintenance work, Rust will be my first choice.

Re: Rust Is Surprisingly Good as a Server Language

#6
I'm building with Rust, Rocket, Diesel, and agree with much of the original article. I can also add more: in my direct personal experience, the lead people creating Rocket and Diesel are superb about responsiveness, ongoing communication, and enabling people (e.g. me) to help diagnose issues and fix the them. I'm continually thankful for the quality of participation among the people in the ecosystem.

On the technical side, there are definitely some learning curves among Rocket, Diesel, and other tools. A typical example is that different crates have their own implementations of concepts such as a UUID, and the developer must handle conversions, and also ensure that various dependency versions all align, and also can't (yet) easily use the current UUID crate, and also can't (yet) build using stable Rust. All of these aspects will be fixed soon, likely within a month or so as the crates stabilize.

If you try Rust, I highly recommend trying rust-analyzer, which provides near-real-time code advice as a plugin to most major editors.

Re: Rust Is Surprisingly Good as a Server Language

#7
There is an advocate on our team that wants to migrate our web service from Nodejs to Rust.

While I am not a huge fan of Typescript, at least libraries are readily available and generally easy to use. On the other hand, being able to show that we are able to do monitoring, user auditing, ORM, opentracing, gRPC-web with Rust is non trivial.

Now that I think of it, being able to do a "hello world" on any language is pretty simple. But having all the tools around it to build a production level service is a different story.

Re: Rust Is Surprisingly Good as a Server Language

#8
post #5

I started learning Rusit and using it for hobby projects in 2014, but I have to agree: for a full-blown product development it's just not there yet. Static typing your code up to the point where you can assume it's correct if it compiles and managing memory manually without the need for a garbage collector, these two things alone just light up my inner nerd with excitement. But as an engineer who has to deliver a pro…

I think Rust is past the hiring hurdle and you would probably get the opposite effect - I suspect you would get more higher quality applicants just looking for a chance to work with it. Seen a similar story with a team choosing RoR over Clojure years back.

Re: Rust Is Surprisingly Good as a Server Language

#9
post #7

There is an advocate on our team that wants to migrate our web service from Nodejs to Rust. While I am not a huge fan of Typescript, at least libraries are readily available and generally easy to use. On the other hand, being able to show that we are able to do monitoring, user auditing, ORM, opentracing, gRPC-web with Rust is non trivial. Now that I think of it, being able to do a "hello world" on any language is pr…

What is your take on TypeScript, what is it you don't like?

Re: Rust Is Surprisingly Good as a Server Language

#10
post #7

There is an advocate on our team that wants to migrate our web service from Nodejs to Rust. While I am not a huge fan of Typescript, at least libraries are readily available and generally easy to use. On the other hand, being able to show that we are able to do monitoring, user auditing, ORM, opentracing, gRPC-web with Rust is non trivial. Now that I think of it, being able to do a "hello world" on any language is pr…

Some of the things you listed can be moved into a proxy like Envoy, so you don’t have to rewrite those wheels as you change languages.
Post reply on HN