csdms / bmi

The Basic Model Interface is a standardized set of functions allowing coupling of models to models and models to data
https://bmi.csdms.io
MIT License
49 stars 17 forks source link

Programmatically generate language specifications #71

Open mdpiper opened 4 years ago

mdpiper commented 4 years ago

The language specification files for C, C++, Fortran, and Python should be programmatically generated from the same source (such as the BMI SIDL file). They are currently created manually.

mdpiper commented 4 years ago

Also do this for any other language we add (Julia, R, MATLAB/Octave).

mdpiper commented 4 years ago

If we start from the SIDL file, we'd have to write a parser for it. Instead, as @mcflugen suggests, describe the BMI in a YAML file and generate the language specs (as well as the SIDL file!) from it; e.g.,

name: get_component_name
args:
  - name: name
    type: str
    intent: out

name: get_value
args:
  - name: var
    intent: in
    type: str
  - name: buffer
    type: array[float]
    intent: in
mdpiper commented 4 years ago

This would also obviate a problem like https://github.com/csdms/bmi-python/issues/6.

mdpiper commented 3 years ago

TOML is now the flavor of the day. Sorry, YAML.

mdpiper commented 2 years ago

This issue is a task in the CSDMS 4 proposal. Moving to the BMI 3.0 milestone.