execution_resource_program.bend

bendvy-ecs-core@0.1.0.3 · 15 lines · 2 definitions

1import Base
2import bendvy-ecs-core@0.1.0.3/execution_builder.bend as Build
3import bendvy-ecs-core@0.1.0.3/execution_declaration.bend as D
4import bendvy-ecs-core@0.1.0.3/execution_query_interpreter.bend as Query
5import bendvy-ecs-core@0.1.0.3/execution_resource_interpreter.bend as Resource
6
7# The ordinary framework selects genuine interpreters for the same closed Program.
8# No caller-supplied permission catalog or dynamic invocation inventory enters caps.
9# Actual World admission still checks the retained full owners before invocation.
10def compile(~S:Data,~WC:Type,~C:Type,~R:Type,~Ops:Data -> (Type -> Type) -> Type -> Type,~program:Build.Program(~S,~WC,~C,~R,~Ops)) -> D.Compilation<S,WC,C,R,Ops>:
11  Build.compile_with_interpreters(~S,~WC,~C,~R,~Query.provider_dictionary(~S,~WC,~C,~R),~Resource.read_dictionary(~S,~C,~R),~Resource.write_dictionary(~S,~C,~R),~Ops,~program)
12
13# Trusted kernel variant uses the same closed interpreter selection.
14def compile_framework(~S:Data,~WC:Type,~C:Type,~R:Type,~Ops:Data -> (Type -> Type) -> Type -> Type,~program:Build.FrameworkProgram(~S,~WC,~C,~R,~Ops)) -> D.Compilation<S,WC,C,R,Ops>:
15  Build.compile_framework_with_interpreters(~S,~WC,~C,~R,~Query.provider_dictionary(~S,~WC,~C,~R),~Resource.read_dictionary(~S,~C,~R),~Resource.write_dictionary(~S,~C,~R),~Ops,~program)