Comparing HALCON Script Engine and HDevEngineđź”—
If you worked with HDevEngine before, you may find the following information useful.
Keep in mind that HALCON Script Engine is still a preview release.
HALCON Script Engine (HScriptEngine) is not a drop-in replacement for existing HDevEngine/C++ applications.
To fit the new HSCRIPT document and import statement behavior and to address shortcomings of the old HDevEngine, the API of HALCON Script Engine has been redesigned.
Preview restrictions
The initial preview release has a minimal, lean API with fewer members than the old one. The reduced scope is mainly due to
- consolidating and simplifying features
- more generic API design based on dictionaries
- features that are not yet implemented
Feedback on API and missed features is welcome!
If you have have experience working with HDevEngine, see the following list of notable changes:
- Multiple instances are possible
- Other than HDevEngine, HALCON Script Engine is not a singleton, hence multiple instances can be created and will be independent of each other.
However, keep the dependency on the single HALCON library in mind. Within one process, there is only one library available, and some settings are global (compareset_system). - No automatic loading from procedure path
- Each document containing an entry point has to be loaded via
HScriptEngine::LoadDocumentexplicitly. Dependencies of that document (viaimportstatements) are loaded implicitly in the background. - No distinction between programs and procedures
- Just execute the
mainprocedure of a given HSCRIPT file to run this “program”. - Internal execution engine replaces old interpreter and JIT
-
Compared with the old engine, with or without JIT, startup times are faster.
Compared with the old engine without JIT, execution times are faster.Preview restrictions
Compared with the old engine with JIT, execution times are still somewhat slower.
- Optimizations are planned for future versions.
- However, this tradeoff avoids the problems associated with JIT like
- limited capacity for debugging in case of errors,
- limitatation on which kind of procedures support JIT compilation,
- unintended different behavior between JIT and non-JIT executions.
- The tradeoff will be evaluated over time.