Documentation
¶
Index ¶
- type FFIFunc
- type MaybeModule
- func (m *MaybeModule) Handle(call *checker.FunctionCall, args []*runtime.Object) *runtime.Object
- func (m *MaybeModule) HandleStatic(structName string, call *checker.FunctionCall, args []*runtime.Object) *runtime.Object
- func (m *MaybeModule) Path() string
- func (m *MaybeModule) Program() *checker.Program
- type ModuleHandler
- type ModuleRegistry
- type ResultModule
- func (m *ResultModule) Handle(call *checker.FunctionCall, args []*runtime.Object) *runtime.Object
- func (m *ResultModule) HandleStatic(structName string, call *checker.FunctionCall, args []*runtime.Object) *runtime.Object
- func (m *ResultModule) Path() string
- func (m *ResultModule) Program() *checker.Program
- type RuntimeFFIRegistry
- func (r *RuntimeFFIRegistry) Call(binding string, args []*runtime.Object, returnType checker.Type) (result *runtime.Object, err error)
- func (r *RuntimeFFIRegistry) Get(binding string) (FFIFunc, bool)
- func (r *RuntimeFFIRegistry) Register(binding string, goFunc FFIFunc) error
- func (r *RuntimeFFIRegistry) RegisterBuiltinFFIFunctions() error
- func (r *RuntimeFFIRegistry) RegisterGeneratedFFIFunctions() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FFIFunc ¶
FFIFunc represents the uniform signature for all FFI functions Now includes VM access for calling instance methods and other VM operations Returns *runtime.Object - functions handle their own Result/Maybe creation
type MaybeModule ¶
type MaybeModule struct{}
MaybeModule handles ard/maybe module functions
func (*MaybeModule) Handle ¶
func (m *MaybeModule) Handle(call *checker.FunctionCall, args []*runtime.Object) *runtime.Object
func (*MaybeModule) HandleStatic ¶
func (m *MaybeModule) HandleStatic(structName string, call *checker.FunctionCall, args []*runtime.Object) *runtime.Object
func (*MaybeModule) Path ¶
func (m *MaybeModule) Path() string
func (*MaybeModule) Program ¶
func (m *MaybeModule) Program() *checker.Program
type ModuleHandler ¶
type ModuleHandler interface {
Handle(call *checker.FunctionCall, args []*runtime.Object) *runtime.Object
HandleStatic(structName string, call *checker.FunctionCall, args []*runtime.Object) *runtime.Object
Path() string
// contains filtered or unexported methods
}
Any built-in module should satisfy this interface
type ModuleRegistry ¶
type ModuleRegistry struct {
// contains filtered or unexported fields
}
func NewModuleRegistry ¶
func NewModuleRegistry() *ModuleRegistry
func (*ModuleRegistry) HandleStatic ¶
func (r *ModuleRegistry) HandleStatic(moduleName string, structName string, vm *VM, call *checker.FunctionCall) *runtime.Object
func (*ModuleRegistry) HasModule ¶
func (r *ModuleRegistry) HasModule(moduleName string) bool
func (*ModuleRegistry) Register ¶
func (r *ModuleRegistry) Register(handler ModuleHandler)
type ResultModule ¶
type ResultModule struct{}
ResultModule handles Result and ard/result module functions
func (*ResultModule) Handle ¶
func (m *ResultModule) Handle(call *checker.FunctionCall, args []*runtime.Object) *runtime.Object
func (*ResultModule) HandleStatic ¶
func (m *ResultModule) HandleStatic(structName string, call *checker.FunctionCall, args []*runtime.Object) *runtime.Object
func (*ResultModule) Path ¶
func (m *ResultModule) Path() string
func (*ResultModule) Program ¶
func (m *ResultModule) Program() *checker.Program
type RuntimeFFIRegistry ¶
type RuntimeFFIRegistry struct {
// contains filtered or unexported fields
}
RuntimeFFIRegistry manages FFI functions available at runtime
func NewRuntimeFFIRegistry ¶
func NewRuntimeFFIRegistry() *RuntimeFFIRegistry
NewRuntimeFFIRegistry creates a new runtime FFI registry
func (*RuntimeFFIRegistry) Call ¶
func (r *RuntimeFFIRegistry) Call(binding string, args []*runtime.Object, returnType checker.Type) (result *runtime.Object, err error)
Call executes an FFI function with the given arguments
func (*RuntimeFFIRegistry) Get ¶
func (r *RuntimeFFIRegistry) Get(binding string) (FFIFunc, bool)
Get retrieves an FFI function by binding name
func (*RuntimeFFIRegistry) Register ¶
func (r *RuntimeFFIRegistry) Register(binding string, goFunc FFIFunc) error
Register registers a Go function for FFI usage
func (*RuntimeFFIRegistry) RegisterBuiltinFFIFunctions ¶
func (r *RuntimeFFIRegistry) RegisterBuiltinFFIFunctions() error
RegisterBuiltinFFIFunctions registers the standard FFI functions
func (*RuntimeFFIRegistry) RegisterGeneratedFFIFunctions ¶
func (r *RuntimeFFIRegistry) RegisterGeneratedFFIFunctions() error
RegisterGeneratedFFIFunctions registers all discovered FFI functions