News for hackers. Stuff that matters.
Re:Why I Hate Frameworks (2005) by dkarl on Tuesday October 19, 2021 @05:34PM (#28924052)
The best frameworks are the ones that cater to users working at a range of abstraction levels. Akka is a good example of a project that aspires to this and largely succeeds at it. If you are working at a particular abstraction level and need to drop down, it's a consistently polished experience. I have never had a shocking moment where I opened a door that users weren't supposed to open and saw something that users weren't supposed to see. Everything is created to be seen, understood, and used. And even in the rare cases where it's not supposed to be used, it's still designed to be seen and understood!
Re:Why I Hate Frameworks (2005) by binwiederhier on Tuesday October 19, 2021 @06:57PM (#28924785)
It's funny to hear someone say so many nice things about Akka.

I work with Akka streams, actors and http every day and and while I agree that Akka is really well documented, incredibly powerful and as you say polished, it is also the bane of my existence. It has made what could have been a simple application a rather painful experience for newcomers and even very senior engineers. The complexity of a framework like Akka is a huge barrier of entry for engineers and hinders development more often than it helps.

This is all obviously very subjective.

Re:Why I Hate Frameworks (2005) by tunesmith on Tuesday October 19, 2021 @07:10PM (#28924877)
I wonder if this is the type of complexity that comes by default with state machines? I have the same feelings with complex react component structures, as well. There is something about state machines where the command flow (that updates the states) feels "hidden", and I thus far haven't found a way to design or document this kind of programming cleanly. Instead I have copious documentation explaining what each combination of states means and how it can be triggered.
Re:Why I Hate Frameworks (2005) by worik on Tuesday October 19, 2021 @08:29PM (#28925431)
Getting OT, but I am a fan of state machines.

They get big, but it is not right to confuse size with complexity. A huge state machine (size measured by the number of states) can be quite simple. Both in the whole, and each state transition can be isolated and considered independently

Re:Why I Hate Frameworks (2005) by FridgeSeal on Tuesday October 19, 2021 @10:17PM (#28926059)
And at least a large state machine has the dignity to make the state + transitions explicit.

I’d much rather deal with a large state machine than something that does the same thing, but implicitly or inconsistently.

Re:Why I Hate Frameworks (2005) by Tanjreeve on Tuesday October 19, 2021 @08:34PM (#28925467)
I'm also very positive on Akka having been deep into Cluster and Streams and Actors over the last few months. The barrier to entry is high because the problems Akka is appropriate for are complicated. Every time I want to complain I imagine managing state in a performant way using "simple" threadlocks or Futures and then magnify that over a distributed application.
Re:Why I Hate Frameworks (2005) by sorokod on Tuesday October 19, 2021 @10:29PM (#28926111)
Can you share a use cases where Akka provides a more performant solution over ""simple" threadlocks or Futures" ?
Re:Why I Hate Frameworks (2005) by Tanjreeve on Wednesday October 20, 2021 @03:09AM (#28927678)
It's not going to be more performant than the constructs it's built off for a Hello World application. But unless you are a deep expert in concurrency and memory management (and have a team who can keep up) if you have a complex problem of concurrency and scale then the Application built in Akka will have high odds of getting to production readiness and stay maintainable while being performant and not getting bogged down in memory issues and shared state performance issues.

That difference in the odds of success increases by an order of magnitude again once you start talking about distributed data.

Re:Why I Hate Frameworks (2005) by sorokod on Wednesday October 20, 2021 @03:31AM (#28927817)
I'd like to form my own opinion on the trade-offs.

Can you share a use case please?

Re:Why I Hate Frameworks (2005) by Tanjreeve on Wednesday October 20, 2021 @04:59AM (#28928400)
The most obvious case for Actors are usually anything where the time to process something isn't predictable and you need to manage state of that process. So the common example is Chatroom session management where some sessions might last 5 seconds and others might last for days. Likewise Games companies have built multiplayer gaming servers using Akka. Telcos and others are common users.

For me personally I'm using Akka to mangage the processing and reprocessing of a lot of entities through some algorithms where the processing time can't be known upfront and the data is unbounded.

In terms of wanting something to tinker with then I guess building a chat application backend is probably the easiest one to demonstrate the complexity of trying to manage that (and there are also some demos in the docs as well)

Re:Why I Hate Frameworks (2005) by sorokod on Wednesday October 20, 2021 @05:29AM (#28928616)
Thank you.

Would be interesting to compare Akka based solution to your problem with a hand rolled alternative.

Re:Why I Hate Frameworks (2005) by Tanjreeve on Wednesday October 20, 2021 @06:39AM (#28929095)
The other decent alternative for some of these problems are often some flavour of messaging queues and event sourcing. E.g for the chat system you could probably shoot messages through a broker and then send a "chat finish" message. The disadvantage of this is if your broker is under heavy load then your chat app will perform linearly worse under increasing load while using the actors and state mean you can have a lot more stuff happening concurrently without the problems of waiting for events to go through a queue hence the latency advantages. Let alone if your servers are ephemeral and changing constantly then that's just another level of complexity to manually roll to keep your session state going that pretty much comes out the box to a production standard in akka persistence and sharding.
Re:Why I Hate Frameworks (2005) by sorokod on Wednesday October 20, 2021 @08:42AM (#28929954)
A chat system is one of the first network programming exercises. You must be trying to satisfy requirements that are beyond basics. Assuming persistent chat rooms are required, do you really need anything beyond some tables in a relational database that model chat rooms/chats?
Re:Why I Hate Frameworks (2005) by Tanjreeve on Wednesday October 20, 2021 @09:34PM (#28939233)
This isn't talking about a hello world level application this is talking about an application managing complex state at scale. Maybe some bytes sent between points representing audio at the same time across several different sessions. I assure you that the problem set slack, people working on Fortnite servers etc is not the same problem set as a network programming illustration even if it's the same start point.
Re:Why I Hate Frameworks (2005) by stolsvik on Wednesday October 20, 2021 @11:24AM (#28931814)
As a possible alternative, you could check out my library: https://github.com/centiservice/mats3
Re:Why I Hate Frameworks (2005) by Tanjreeve on Wednesday October 20, 2021 @09:37PM (#28939262)
I've got to wrap my head round it a bit I'm definitely interested the approach as a lot of data/analytics people probably would be.
Re:Why I Hate Frameworks (2005) by tunesmith on Tuesday October 19, 2021 @11:03PM (#28926300)
If you're talking about Akka Cluster sharding, basically any situation where you have distributed objects that have their own state and behavior. I've had two projects where objects needed to stay in memory so they could receive messages, update their state, and then behave by sending messages to other objects. And it was too many objects to live in one server. The naive solution of data repositories and caching isn't really sufficient for this, and a horizontally scaled Akka Cluster Sharding setup with Persistence was the right solution given the requirements.
Re:Why I Hate Frameworks (2005) by dkarl on Tuesday October 19, 2021 @10:31PM (#28926128)
I guess when I've encountered complexity in Akka, I've felt that it was in proportion to the difficulty of the problem I'm solving. In the future, if/when I get to work with frameworks that solve the same problems while exposing me to less complexity, then Akka will be obsolete in my mind.
Re:Why I Hate Frameworks (2005) by waynesonfire on Tuesday October 19, 2021 @11:54PM (#28926564)
And, well, you're also most likely dealing with scala which isn't helping.
Re:Why I Hate Frameworks (2005) by Aeolun on Tuesday October 19, 2021 @08:29PM (#28925432)
Unlike, to use an example that is close to my heart, Atlassian @atlaskit, that while open-source, was clearly not meant to be used outside any Atlassian app.

So many undocumented hooks everywhere.