You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
The API has to be defined somewhere in fj's models module, presumably the Host or Context trait. I'm currently confused on why those are not the same trait.
Presumably, the next step it then to add whatever is required to fj's abi module, to make the new API work over the FFI boundary.
Finally, the new API needs to then be supported in fj-host. It needs to somehow get hooked up the the StatusReport instance that fj-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:
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.
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: