The other thing I forgot to mention is Erlang's pure functional foundation. Other than the built-in "ETS", which is like a tabular data store, and the process dictionary, which was a mistake in the design of Erlang, your "data structures" cannot be modified.
You must make full copies of your...
I have already done what you describe in Erlang. The Erlang grammar is ideal for expressing such things.
One challenge, however, is that Erlang does not have what I would describe as "Industrial Strength" debugging capabilities. So I suggest you use a test-driven approach to develop your...