Skip to content

v0.30: Custom public APIs

Compare
Choose a tag to compare
@github-actions github-actions released this 25 Nov 19:01
· 91 commits to main since this release
8a169d4

Public API with auto-complete

It is now possible to craft a custom API for Sandbox programs, documented here. The public API is optional and overrides the old method when present.

Screenshot from 2024-11-25 19-03-28

The public API generates detailed auto-completion in GDScript.

Binary translations loadable at run-time

It is now also possible to load shared objects that contains binary translations for programs on Windows, macOS and Linux. Documented here. Binary translations are freestanding C99 and should be very easy to compile using any local compiler. Adding -DCALLBACK_INIT will make the dll self-register when loaded:

x86_64-w64-mingw32-gcc-win32 -shared -O2 -DCALLBACK_INIT bintr_test.cpp -o bintr_test.dll

An example of compiling a binary translation for Windows from a Linux terminal. The .dll can be loaded using Sandbox.load_binary_translation("res://bintr_test.dll") during initialization. Loading DLLs after init is disabled as a security measure.

This feature is especially useful during development as baking binary translations into Godot or an extension is time-consuming. Compiling a shared object can be done automatically, even from the Godot editor, but the project must be reloaded in order to load it during init. It can technically also be used as part of shipping (performant) updates to desktop systems.

Other changes

  • Setting max instruction limit to 0 will now disable execution timeout and enable faster intepretation, resulting in up to ~15% performance gain.
  • Improve error messages when failing to cast or unbox Variants
  • Add Array::at_or(), ArrayProxy::get_or() and DictAccessor::value_or() to the public API
  • Add Sandbox::reset() which quickly resets the loaded program
  • Fix missing language icons in the editor
  • The performance of freeing heap allocations has been improved slightly

PRs merged

  • Add support for loading binary translation DLLs on Windows by @fwsGonzo in #221
  • Separate languages into separate docker and project folders by @fwsGonzo in #222
  • Allow programs to expose custom API by @fwsGonzo in #224
  • Parse public API and generate method information by @fwsGonzo in #225

Full Changelog: v0.29...v0.30