unicesi / amelia

:airplane: DSL for deploying distributed systems, with custom commands to compile and execute FraSCAti applications
GNU Lesser General Public License v3.0
2 stars 3 forks source link

Add support for conditional executions #30

Closed jachinte closed 8 years ago

jachinte commented 8 years ago

Parameters allow to configure different executions for different values. However, this has implications on the hosts and commands that are used. Adding conditional expressions to the language would avoid duplicating subsystems.

Example: (1)

if boolean_expression do {
    on host {
        ...
    }
}

or (2)

boolean_expression : on host {
    // the same syntax can be used for rules
    boolean_expression : rule : dependencies;
        // commands
}

When rule depends on a conditional rule, then the dependency is conditional.

jachinte commented 8 years ago

Another possibilities, more concise and understandable: (3)

on host if boolean_expression {
    rule if boolean_expression: dependencies;
        // commands
}

(4)

on host? boolean_expression {
    rule? boolean_expression: dependencies;
        // commands
}
jachinte commented 8 years ago

Final decision: option (4)