package lyra:api; interface ecs { record entity-id { id: u64, } record entity { id: entity-id, generation: u64, } record wasm-type-id { inner: tuple, } record component-info { size: u64, alignment: u64, type-id: wasm-type-id, // a u128 } resource ecs-dynamic-view { constructor(wrld: borrow, component-infos: list); next: func() -> option>; } resource ecs-world { constructor(); // expects components to be tightly packed in the same order of component-infos spawn: func(components: list, component-infos: list) -> entity; view: func(component-infos: list) -> ecs-dynamic-view; } }