Remarks

 

 

So how to get flexible / dynamic syntax?

 

What is obvious is that the types of the output must be defined. This is clear. Yet writing/extending parsing functions to produce them tend to be tedious, annoying, difficult and error-prone. Let's imagine I want to add a new kind of simple construct to the language, or alter it's syntax, how could I do this (more or less) easely? Does it work also for the user?

 

The key is perhaps to focus on the types rather than the parsing itself. If we see the types as the center, we can see the parsing as subsidiary functions. Like serializing/deserializing. How these types are read and written using some syntax would be a property of the type. Then, a parser engine would be in charge of applying the various read functions of the various types to obtain "self constructing" data types.

 

 

So how is it defined and how is it parsed?

 

 

 

 

 

 

 

Syntax definition example

 

 

 

 

It's only the start of the story