Live data from Hacker News

Actix: a small, pragmatic, and fast Rust web framework

actix.rs

51–60 of 125 posts

Re: Actix: a small, pragmatic, and fast Rust web framework

#51

I recently ported a very small micro service from Rocket to Actix and found the migration to be painless. In fact, it's use of types and inferencing along with integration with Serde made it very easy. It also worked on stable-rust and can work with connection pooling against postgres. This makes it a winner in my mind. I'm excited to use it again in my next service.

What motivated you to move away from Rocket (just curious, I've only used Iron)?

Re: Actix: a small, pragmatic, and fast Rust web framework

#52
post #28

I tried using actix for a recent project. I just could not get it to do what I wanted to. It always felt like a fight. I switched to rocket and everything is so much easier. Everyone is saying great things about it, but I just want to point out that it's not for everyone.

Don't know anything about Actix, but can confirm that Rocket is excellent. The actor abstraction is very interesting, though. Anyone have any insight into how Actix and Rocket compare? I'm interested mostly in ergonomics and safety.

I also recently just finished porting a side project of my own from Rocket to Actix. I'm absolutely loving Actix so far!

Other than Rocket being nightly, the other reason I switched to Actix was because Rocket doesn't have the ability to respond to requests directly within the middleware layer, you can only modify the response but not return early. This is pretty important with regards to CORS and trying to catch all OPTIONS requests. There are a few solutions of course, but all of them felt hacky or verbose.

I have no complaints with Actix yet.

Re: Actix: a small, pragmatic, and fast Rust web framework

#53

I recently ported a very small micro service from Rocket to Actix and found the migration to be painless. In fact, it's use of types and inferencing along with integration with Serde made it very easy. It also worked on stable-rust and can work with connection pooling against postgres. This makes it a winner in my mind. I'm excited to use it again in my next service.

What motivated you to move away from Rocket (just curious, I've only used Iron)?

Honestly, it was not being able to target stable that prompted the switch. Then after using actix I was impressed.

Re: Actix: a small, pragmatic, and fast Rust web framework

#54
post #45
post #5

What a great looking site. I've been really exciting about actix for a while now. We just started some internal experiments with it here and I'm looking forward to more.

Agreed. Good site. This is an aside, and I sincerely apologize for that, but I am compelled... I'm reading the greeting/hello-world example on this nice site and I notice unwrap_or(). That is a poor name: can it panic, as suggested by the "unwrap" part (I have just enough Rust to know that,) or can it not, as suggested by the "or" part? The name is inherently ambiguous! It's as if the .unwrap() that is festooned thro…

The "unwrap" is referring to getting a plain T out of a Foo container: all of those "unwrap" functions return a plain T.

One way to look at them is "unwrap", "or" and "or_else" are building blocks that have a common meaning across the different examples:

- unwrap: returns a plain T

- or: the left-hand side, unless it is a "failure", then use the argument value

- or_else: the left-hand side, unless it is a "failure", then use the argument function to create the value

Re: Actix: a small, pragmatic, and fast Rust web framework

#55
Why do so many Rust projects lead with telling you their number one feature is type safety? It’s Rust we get it, stop telling us about your type safety!

Also, what problem is this solving that countless other near identical web frameworks don’t already solve?

Re: Actix: a small, pragmatic, and fast Rust web framework

#56

Browsing thru Actix guide ( https://actix.rs/actix/guide/ ), I didn't find any explanation regarding what will happen when actor(s) crashes or how crashes[1] are being handled? http://wiki.c2.com/?LetItCrash

I feel like Let It Crash and Fail Fast make a lot of sense in a dynamically typed language where, if you were to go ahead and code defensively and try to make assumptions about where your program could possible fail, you'll end up with a bunch of redundant error code and will probably have written error handling for places where the program might not have ever crashed. Rust's Result type makes sections where an error can occur pretty explicit, so I'm not sure it makes sense to follow the same methodology. I'm interested to hear what other people think.

Re: Actix: a small, pragmatic, and fast Rust web framework

#57
> fn greet(req: HttpRequest) -> impl Responder

Nice to see front page example using 'impl', the recent most improvement in ergonomics. Before 1.26 things would be different. This makes me more appreciative of the efforts from Rust team/community to improve the ease of use.

Re: Actix: a small, pragmatic, and fast Rust web framework

#58
post #55

Why do so many Rust projects lead with telling you their number one feature is type safety? It’s Rust we get it, stop telling us about your type safety! Also, what problem is this solving that countless other near identical web frameworks don’t already solve?

Even with an opinionated type system, it's possible to slack off a bit. There are different degrees of strictness/specificity when composing types.

Re: Actix: a small, pragmatic, and fast Rust web framework

#59
I evaluated a few different Rust web frameworks, where performance was the deciding factor. A minimum viable echo server was put through its paces with `h2load` on a relatively recent MacBook Pro. `actix-web` was literally 100x faster than the next fastest competing framework.

The benchmark result really confused me. But you'll find that the `actix` actors are extraordinarily lightweight and highly optimized around the equally lightweight and highly optimized Futures. The design is hard to beat, from a performance standpoint.

Re: Actix: a small, pragmatic, and fast Rust web framework

#60
post #16

Earlier quoted context omitted.

we use actix. but that is all i can share :)

Have you spoken with the Rust core team about Microsoft's use of actix? They love getting feedback from commercial users, and I believe they are willing to sign NDAs when necessary (there's certainly plenty of commercial users they seem to be unable to tell me about, and I ask often :P ). I'm happy to put you in touch with them if you'd like; see my email in my HN profile (and this invitation goes for anyone else out…

He's the author of actix
Post reply on HN