borismarin / som-codegen

dLEMS - a distilled version of the Low Entropy Model Specification language used to generate code for numerical integrators.
1 stars 0 forks source link

The SOM data structure - Associative arrays #1

Open borismarin opened 11 years ago

borismarin commented 11 years ago

Being unordered collections, associative arrays can potentially introduce problems for code generation. Currently, we are being careful when parsing the JSON files, using OrderedDict in python or LinkedHashMap in Java. An alternative approach would be using arrays: 'paramenter_names': [pname_i] 'parameter_values': [p_i] which would possibly be more convenient for codegen via templates.

borismarin commented 10 years ago

YAML solves this with ordered mappings:

#yaml ordered mapping
# dXdt for harm osc
- x : "y"
- y : "-x"