Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoadDynamicFn ¶
type LoadDynamicFn struct { }
Implements the load_dynamic() built-in.
Most programming languages only support static import - where the module being loaded and the local variables being bound must be determinable at compile-time (i.e., without executing the code).
Dynamic import tends to be fairly contentious. Here's a good discussion on the topic:
https://github.com/tc39/proposal-dynamic-import
(TC39 - the JavaScript committee - is a generally good resource for programming language theory discussion, because there are so many open-source implementations of the core language.)
load_dynamic() provides a dynamic import, with semantics similar to nodejs require(), where it returns a dictionary of symbols that can be introspected on. It does no binding of local variables.
func NewExtension ¶
func NewExtension() LoadDynamicFn
func (LoadDynamicFn) OnStart ¶
func (LoadDynamicFn) OnStart(e *starkit.Environment) error