DSL advantages (cont.)
Reliability
- Automatically generate code that’s easy to forget or get wrong
- Example: synchronization operations to serialize accesses to distributed data structure
Verifiability
- Of input code (DSL specification)
- More abstract form of semantic checking
- e.g. DSL supports types natural to behavior being specified => type-checking verifies some semantic constraints
- e.g. “ensure no unencrypted objects are written to disk”
- Of output code (coordinated use of base mechanisms)
- DSL compiler writer satisfied DSL compiler is correct => appliance designer inherits verification effort
Safety (prevent runtime errors)
- Whole classes of general programming errors not possible
- DSLs hide details: runtime memory management, IPC, ...
- Compiler automatically adds code: synchronization, ...