intertwingly

It’s just data

Pattern Matching


Simon Johnston: The difference I see is that stackless is an enabling feature of the VM, that we will still need the language-level primitives for message send/receieve I see in Erlang and then library support for managing local and remote distribution.

The “secret sauce” is pattern matching.  Things like “if these conditions are met, this code fires, with the following variables set”.  With Erlang, this metaphor is everywhere.  Function calls are an exercise in pattern matching.  Database queries are an exercise in pattern matching.  Message passing is... oh, you get the idea.

You see things like this in Django’s url.py.  As indicated by that link, regular expressions are used for this purpose in Django.  Powerful, albeit a bit user unfriendly.  Furthermore, I will state that Python’s choice to relegate regular expressions to being a library function is a the reason why a good amount of my personal scripts were previously written in Perl, and now mostly are in Ruby.  The other reason is XPath.

But meanwhile, if you are interested in message passing along these lines in Python, I’d suggest PyLinda.