This feature allows one to support multiple deployment scenarios
without having to divide and/or organize modules beforehand according
to all possible deployment configurations (as doing so may be
difficult in the face of having exponentially many different
combinations of configuration options).
Previously, when a CAL module was loaded from its serialized format,
all Java entities corresponding to CAL foreign types and functions
appearing in that module were resolved and loaded immediately. If a
Java entity could not be resolved, a compiler error was logged.
With this new feature, such references to classes, methods, fields and
constructors are not resolved and loaded until they are needed - this
new default is called the lazy mode. The lazy mode makes it possible
to write and deploy CAL modules where some of the foreign dependencies
are not available at runtime. For example, a module may contain
support for external drivers X and Y (with foreign types and functions
referring to Java classes in both X and Y), but may be deployed with
only driver X. As long as the associated foreign types and foreign
functions for driver Y are not accessed at runtime, and no attempts
are made to compile modules or run additional expressions which depend
on these types and functions, no errors will be reported.
By setting the system property
"org.openquark.cal.machine.lecc.strict_foreign_entity_loading", it
will be possible for these entities to be loaded eagerly at module
loading time, as with the original behaviour - this is called the
strict mode. Strict mode is mainly meant for debugging and for
development time, when it is useful to catch resolution failures
early.
We hope you'll like this new feature of Open Quark!
Cheers,
Joseph