-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Models should be able to add status messages #996
Comments
I've had a thought: Instead of creating a new API to allow models to print status message, can we instead redirect their stdout/stderr? I suspect this would be impractical right now (although I haven't really looked into it), but could it become practical once we switch the model system to WebAssembly (#71)? I think it makes sense to have WASI-based models, and maybe WASI makes it possible to control where their stdout/stderr goes. |
This issue is no longer applicable. The affected code has been removed. See A New Direction for context. |
We've recently gained the capability to show status messages in the UI. This lets the user know when a model has reloaded, or if there was an error trying to do so. So far, this is only used by Fornjot code.
There should be an API that allows models to print status message that are then shown in the UI. Models can already use
println!
and related Rust APIs to print to stdout/stderr, but there is currently no way for them to show information in the UI (beyond the shapes they create).Being able to do that could help with debugging, but also allow models to display auxiliary output. For example, a model could do some limited model-specific simulation, and then output a warning if a wall ended up to thin. This is just an example. The purpose here is to give model authors the freedom to go beyond conventional use cases.
I haven't worked on the new host/model API yet, so I can't give much guidance on how to implement this, beyond the following:
fj
'smodels
module, presumably theHost
orContext
trait. I'm currently confused on why those are not the same trait.fj
'sabi
module, to make the new API work over the FFI boundary.fj-host
. It needs to somehow get hooked up the theStatusReport
instance thatfj-host
already gets access to.If anyone wants to pick this up and has questions, feel free to ask! I'll do my best to help.
The text was updated successfully, but these errors were encountered: