Live data from Hacker News

Actix – Actor Framework for Rust

github.com

71–80 of 129 posts

Re: Actix – Actor Framework for Rust

#71
post #2

Whats the state of Rust if I wanted to get into it for backend development? I've looked briefly into Rocket and liked it but didn't delve too deep, I understand Actix is one of the most mature?

I'm looking at warp[0] and like the concept behind it very much... a bit higher level than hyper, but using a concept of composable filters without being too opinionated. Haven't done much kicking of the tires yet though

[0] https://github.com/seanmonstar/warp

Re: Actix – Actor Framework for Rust

#72
post #63

Earlier quoted context omitted.

This is from memory, I would welcome any corrections. Actix was written with a lot of unsafe code [0], which some people considered unnecessary and potentially dangerous in a web framework. In some cases the unsafe code may have been performing better than equivalent safe code. In other cases, it was possible to rewrite with safe code without losing performance. People submitted patches to replace unsafe code with sa…

For non-rusties: unsafe means turning off Rust's advanced safety features, reducing its safety level to that of C or C++. Which is to say, it's as safe as almost all software you're using right now. Of course, one usually turns off the safety features because one is trying to do something tricky to squeeze out performance or achieve some low level feat, so it's also an indicator that something is dangerous is going o…

> For non-rusties: unsafe means turning off Rust's advanced safety features, reducing its safety level to that of C or C++.

Actually, it's a bit more subtle: unsafe allows using some things which are not protected by "Rust's advanced safety features", like dereferencing raw pointers, and using these things can "reduce its safety level to that of C or C++" (for that module). However, if these things are not used, the safety is not reduced; you can take a block of Rust code which has no "unsafe", put it in an "unsafe" block, and it will be identically safe as before.

Re: Actix – Actor Framework for Rust

#73
post #14

Earlier quoted context omitted.

You can run every actor in a separate thread or even in a separate machine, making the whole system highly scalable. Whether you'll consider that a new paradigm or not, is question of definitions.

Isn't that basically the same as remote method invocation in OO systems?

Remote method invocation is inherently a bad idea, because real world remote systems have significant latencies. Ordinary function call is few processor cycles. Network function call is few billions of processor cycles. While abstraction is a good thing in general, that kind of abstraction is not a good thing.

That's the reason why remote calls today are using explicit syntax, API and so on.

But with actors it's expected that sending a message to actor is something that takes some time. So you have a clear separation between ordinary function calls and actor messages.

Of course it's still a lot of difference between sending message to a thread or sending message to another machine. So take that with a grain of salt. But at least you can utilize multicore CPUs.

Re: Actix – Actor Framework for Rust

#74
post #67

Earlier quoted context omitted.

Not nearly impossible. Was put in the jdk like 20 years ago. RMI: https://en.m.wikipedia.org/wiki/Java_remote_method_invocatio...

There have been dozens or hundreds of things called "remote method" or "remote procedure" or "remote function" invocation. However, not a single one of them has overcome the fundamental problem that you can not have something that is semantically identical to the function call presented by programming languages, because programming language functions simply do not have the concept that you are accessing it over a net…

Much like you can implement TCP (or something like it) atop UDP but you can’t really do the reverse.

Re: Actix – Actor Framework for Rust

#75
post #18
post #6

What is the difference between the actor model and object oriented programming? It seems to me like they are basically the same paradigm but with all the names changed, and some additional restrictions like all messages being async and objects only being able to process one message at a time. Why is it necessary to create a whole new paradigm just to enforce such a style?

Your question is interesting from the perspective that the actor model could be seen as the precursor to modern object oriented programming. Both the actor model as defined by Carl Hewitt and the early object computational models as they are defined by Alan Kay (Smalltalk) originated during the same period and are based on similar philosophies of computation. However, on the object oriented model track, due to practi…

I think this is a great summary, and also highlights much of what Joe Armstrong talked about when comparing Erlang to other OO languages, and his earlier decisions to design Erlang to work in the same way whether in a single-node or multi-node environment.

Re: Actix – Actor Framework for Rust

#76

Earlier quoted context omitted.

Although I'm not sure what you really mean by "remote method invocation", the idea of remote method invocation in OO systems should be impossible or incredibly difficult considering the semantics of a method call. Method calls are synchronous and they are not allowed to fail under any circumstance. But in the context of distributed systems you have to choose between at most once or at least once delivery which are se…

Not nearly impossible. Was put in the jdk like 20 years ago. RMI: https://en.m.wikipedia.org/wiki/Java_remote_method_invocatio...

also NeXT's Portable Distributed Objects which continued into the OS X and D'OLE had some of this

Re: Actix – Actor Framework for Rust

#78
post #48

Earlier quoted context omitted.

Actor model is good for parallelisation. Each Actor and its message queue can be processed separately from everything else. There should be no side effects except new messages sent or new actors spawned. So a pool of worker actors can absolutely work in parallel. In fact now I'm curious if Actix supports that

Typically parallelism is particularly interesting for performance, and the (usually?) shared-nothing architecture of the actor model is not conducive to high performance computing.

[deleted]

Re: Actix – Actor Framework for Rust

#79
Out of curiosity - actix seems to be very performant compared to actor frameworks implemented in other languages - would it be a good fit to implement a database using it? For example mapping worker pool and workers to actors?

Re: Actix – Actor Framework for Rust

#80
post #27

This framework's core developer has left, probably new community took it over. Hopefully it will continue to be supported and developed. Rust still has a way to go for being a mature eco-system for doing any serious web programming work. Given the focus of Rust on systems programming, I will still be careful to consider it for anything web related. Hopefully situations like abandoning a project suddenly will not happ…

You seem to have a superficial level understanding about the Rust ecosystem for web development and for the actix ecosystem. Yet, this hasn't stopped others from trusting your opinion or agreeing with your comment, unfortunately. This post is for the original actor architecture. The next architecture, which should have never been called actix, was based on a completely different architecture. This second version prev…

Hi @Dowwie, I'm one of those "others" you mentioned that's trying to fill Nikolay's very large shoes!

Yuki (John Titor on GitHub), Rob and I are well on our way removing concerning `unsafe`s wherever we can. Sadly, there are some breaking changes but that's not stopping us and we're now headed to a 3.x release. No timeline on that just yet.

The community has bounced back quite a bit ever since the transition and I'm hopeful that actix-web will continue to be the leader-ish of Rust web development!

Just the other day we even had the first example mix some async_std into the mix (obviously, yes, some runtime weirdness with this)! https://github.com/actix/examples/tree/master/multipart-asyn...

Happy to answer any questions y'all might have!

Post reply on HN