News for hackers. Stuff that matters.
Re:Alan Kay on Messaging (1998) by jacquesm on Sunday May 03, 2015 @05:55PM (#9483247)
- messages are asynchronous, function calls are (pretty much by definition) synchronous

- messages do not require a reply (but function calls typically do expect a result)

- messages are a lot more secure in that the credentials of the sender can be inspected by the recipient which can be walled off in a different area of memory or even on a different machine

- message based architectures are easier to scale than function call based architectures

- message based architectures tend to have higher overhead per message than a function call with the same payload and return value

- message based architectures tend to lend themselves to soft real time approaches better than monolithic threaded software using functions as the main means of passing data around

- message based architectures tend to be more reliable

- message based architectures typically allow for things that are next to impossible in a function based environment, such as process migration and load balancing as well as coping with hardware failures

- message based architectures are easier to debug (by far) than large systems built up using nothing but function calls.

- message based systems tend to be a bit slower, especially if they take the message idea all the way to the lowest levels of the language (such as in smalltalk).

Really, the differences are legion. I've built some stuff using message passing that I would simply have had absolutely no way of getting production ready if not for using a message based approach, it allows you to limit the scope to the processing of a single message at all time rather than to have to model the entire call stack in your head to keep track of what you're doing and why. As an abstraction model it is extremely powerful and for that reason alone I'd happily advise anybody that has not yet played with an environment like that to give it a whirl.

It's not a passe-partout but it certainly is a powerful tool in the toolbox.

Re:Alan Kay on Messaging (1998) by Jare on Sunday May 03, 2015 @07:50PM (#9483567)
> message based architectures are easier to debug (by far)

This is the opposite of my experience, mainly because of the lack of proper call stacks, it is very hard to inspect the reason the values in a message are what they are. Can you elaborate?

Re:Alan Kay on Messaging (1998) by jacquesm on Monday May 04, 2015 @02:40AM (#9484647)
That's interesting. I guess this boils down to how far from the point of origin a bug originates.

In a message based system that should be at most one step away from where you find the bad value. If it is more than one step away that's more of an architectural issue, it probably means that you are sending your messages first to some kind of hub which then passes it on to the actual recipient so you lose the point of origin information.

A message that gets passed on untransformed from a module that does not realize the data is corrupted is a missed chance for an integrity check and a subsequent crash.

Smalltalk does a half decent job at integrating the 'debugger' with the runtime environment (they're so tightly integrated it's hard to tell where one starts and the other one ends) and allows you to see fairly detailed traces of what happened to which parameter along the way, it's as detailed as any call stack dump.

Erlang has a 'let it crash' policy (see Joe Armstrong's excellent paper) which tries to enforce the point of origin and the subsequent crash happen as close to each other as possible (and provides a whole range of mechanisms to deal with the fall-out).

A 30 level call-stack like say Java would produce simply doesn't happen in those environments. Though if you programmed in a 'Java' style in say 'erlang' then you could generate one and it would make your life much harder.

Re:Alan Kay on Messaging (1998) by Jare on Monday May 04, 2015 @05:39PM (#9489397)
No hehe, my experience is mostly C++ PC and console games, so a) let it crash is not viable, and b) performance precludes performing extensive validation (a debuggable but unresponsive game is not viable).

In games, messaging troubles are usually related to systems like character behaviour and AI that deal with multiple complex entities responding to the world state and interacting with each other. It's rarely a case of corrupt data and null pointers (those are easier): physically valid yet logically incorrect or unexpected data.

Re:Alan Kay on Messaging (1998) by jacquesm on Tuesday May 05, 2015 @03:29AM (#9491295)
I think you're missing out on something, have a read and see if maybe 'let it crash' is more than you think it is:

http://web.archive.org/web/20090430014122/http://nplus1.org/...

https://mazenharake.wordpress.com/2009/09/14/let-it-crash-th...