GregoryConrad / rearch-rs

Re-imagined approach to application design and architecture
https://crates.io/crates/rearch
MIT License
84 stars 4 forks source link

Dynamic (Runtime) Capsules #9

Closed GregoryConrad closed 11 months ago

GregoryConrad commented 11 months ago

This allows for capsules to be created at runtime instead of requiring them to be known at compile time. This addition will allow for all traditional IC applications (think a spreadsheet with a varying number of in-use cells) to be built with ReArch, top to bottom.

Since I may forget: this is already possible in the Dart implementation since we aren't using function types as keys there; we are using the function's hash + eq directly. Thus, you could do Map<SomeKey, Capsule<SomeType>> dynamicCapsules(CapsuleHandle use) {...} already over there and have it work just fine.

Projected changes:

Users can then make a struct for each type of dynamic capsule they have and impl Capsule for those structs.