Hacker News new | ask | show | jobs
by tormeh 2948 days ago
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.

3 comments

I've done a simple hobby project in Rocket and ported to Actix.

I'm not experienced with web services and my project was very limited for learning purposes, here my take away:

I like both and for me Rocket was way more ergonomic for creating routes dealing as if they're simple functions where input and output are dealt automatically with (from request and to response).

Actix advantage is actors and is easy to be fully async, I had some issues dealing with it but most of my troubles were extracting request data and building responses.

When actix-web will support magic as Rocket (once proc-macros becomes stable) then actix-web will have the edge if Rocket don't become async-ready and stable before.

For both it is only question of missing stable rust features and actix-web is already running on stable.

actix-web: - easy - async - stable

Rocket: - stupidly easy - sync - nightly

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.

i think from ergonomics standpoint, actix is very close to rocket. of course rocket has some advantage, but actix compiles on stable and has zero codegen code. as soon as proc macro stabilizes both will be on par.

from performance perspective, actix is faster than rocket on any type of load.