Skip to content

Conversation

@PhilMiller
Copy link
Member

No description provided.

@PhilMiller PhilMiller requested a review from hellkite500 August 20, 2025 17:10
:::{tab-item} c
:sync: c
```c
int get_extension(void *self, char const *name, void **extension_object);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per Austin, I need to specify that this is a pointer-to-pointer to a single output object, and not some sort of array.

Copy link
Member Author

@PhilMiller PhilMiller Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type erased pointer, callers can reify them through {static,dynamic,reinterpret}_cast in C++, casating syntax in C, Rust std::transmute, or Fortran type(c_ptr). Python doesn't actually need anything special, since it's dynamically typed and dispatched anyway, but functions to get specific extensions could carry type hints to specify return of a particular extension object type.

@PhilMiller
Copy link
Member Author

PhilMiller commented Nov 3, 2025

Austin suggested an object-free extension, tentatively named bmi:introspection, that indicates availability of variable sets bmi:introspection:all_sets and/or bmi:introspection:all_variables. Those sets would be usable for a model-description utility to just enumerate everything, maybe querying data types, units, etc, to output for user review, documentation, compatibility checking, etc.

@PhilMiller PhilMiller added the BMIv3 Prospective elements of a future major version 3 of the BMI specification. label Nov 4, 2025
@PhilMiller PhilMiller force-pushed the PhilMiller/bmi-3-extensions branch from befc229 to 1f2c28f Compare November 4, 2025 01:51
@PhilMiller PhilMiller force-pushed the PhilMiller/bmi-3-extensions branch from 19f4c4f to 27576b5 Compare November 4, 2025 15:05
@PhilMiller PhilMiller force-pushed the PhilMiller/bmi-3-extensions branch from e99205b to 86fb07f Compare November 4, 2025 15:07

## Shared Conventions and Protocols

Extensions may describe added constraints or enrished semantics for
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Extensions may describe added constraints or enrished semantics for
Extensions may describe added constraints or enriched semantics for

extension's name.

The extension must specify the type signature of each extension object
it defines, with all of its members. For interoperability, develoeprs
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it defines, with all of its members. For interoperability, develoeprs
it defines, with all of its members. For interoperability, developers


# BMI Extensions

An extension of BMI is identified by a unique name string. It could
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe reserved names and namespacing conventions below

Models implementing BMI are not required to support these extensions,
nor any others.


Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe versioning practices or conventions in some fashion

The extension must specify the type signature of each extension object
it defines, with all of its members. For interoperability, develoeprs
are encouraged to use types and calling conventions that follow the
practices of core BMI. However, this standard also anticipates that
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indexed/numbered variables could help alleviate string ABI interoperability in implementing extensions in various languages.

@PhilMiller
Copy link
Member Author

Possible variation on the introspection idea: an extension that asks for a static version of everything that might be available, independent of any specific config file. In that case, the init_config file argument could be a placeholder value, rather than actually setting up the model instance to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BMIv3 Prospective elements of a future major version 3 of the BMI specification.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants