In a recent question about a DSL I tried to mix DSL expressions with expressions of the embedding language which happens to be procedural (in that case Python). After some experimenting I am at the point of abandoning the continuation of strict procedural syntax in favour of a lispy style, i.e. instead of my original idea of
@MY_DSL_FOO_FUNCTION(params,@ANOTHER_DSL_FUNCTION(...),expression_in_python,more_expressions_in_python)
I now tend towards
{MY_DSL_FOO_FUNCTION params,{ANOTHER_DSL_FUNCTION ...},expression_in_python,more_expressions_in_python}
Any opinions (preferrably based on experience) on this syntax decision?
If you modify that syntax a tiny bit more to use ()’a and ,’s properly, you don’t need a “DSL”.
You’ve got plain-old-Python. Life is good.
All you need to do is add ,’s. Since you seem to have two things — functions and expressions, perhaps you mean this.
That would be perhaps more Pythonic.
But maybe your goal is some kind of late binding where the tuple is evaluated later in some other context or something.
In this way, the functions with parameters are use to build other functions that can be evaluated later. Yes. This does involve more syntax. However. It also avoids creating yet another language.