|
|
|
|
|
by sklogic
3961 days ago
|
|
> I actually find compilers for transformation of DSL AST to target languages much more costly then designing the DSL syntax. Mind explaining why? What can be costly and complex in a chain of trivial transforms, each being very simple, flat and comprehensible? |
|
So an example of the problem I deal with is a database migration. Let's say we have an entity with a value
entity SqlTable { List<TableColumn> nestedTuple; }
value TableColumn { int i; }
and if I change column type in value object to long I want my compilers to prepare a DB migration with the appropriate SQL statements for the specific DB I use. Of course, there is nothing too complex about it, but it's not trivial either (in this case you have to prepare a second field, unnest the whole hierarchy to get to the nested field, copy it to new type and compact the hierarchy back again).
I find it costly since there are gazillion of such features. And when they start interacting with each other things gets messy.