Releases: HenryAWE/asbind20
1.8.0 Released
Update
-
script_invoke_resultno longer stores the result inside it,
now it will get the result when user needs it (lazy evaluation).According to benchmarks, this has the same performance as the handwritten code retrieving values from AS interfaces directly.
It is even slightly faster than the plain handwritten code in some situation.
Compared to handwritten implementation, the implementation from previous version is slower about 1% ~ 3%,
and even worse when returning a value type with expensive copy construction, such as a string with extremely huge content. -
Experimental support for enum with custom underlying type in AngelScript 2.39 WIP.
-
Utility for quickly implementing conversion rules for enums with underlying type other than
intsuch asstd::byte. -
Experimental support for script
foreach. -
script_invoke_resultnow supportsoperator->for pointer type,
which is useful for accessing members of returned reference types. -
Expose
get_context_resultfor easily retrieving result from context. -
Add member function
value_orforscript_invoke_result. -
script_invoke_resultcan be converted tostd::optional. -
script_invoke_resultcan be converted tostd::expectedif C++23 is available. -
Backport to support Clang 15 toolchain.
-
More utilities.
-
Intermediate interfaces for creating generic wrappers have all moved into the internal namespace,
in order to not confuse the users.
Bug fix
- Fix error caused by generated default/copy constructor when registering a C array (
type[size]) as value type.
Breaking Change
-
Due to the new lazy evaluation implementation of
script_invoke_result,
it now can only be returned by script invocation tool.
User cannot calls its constructor by value directly,
e.g., returning a placeholder value when script failed.Please consider converting the code style described above to use
std::optional(orstd::expectedif C++23 is available).
Documentation
- Add Chinese README
Full Changelog: 1.7.1...1.8.0
1.7.1 Released
Update
- Update compatibility with AngelScript 2.38.0.
- Mark more pointers in parameter list by
const. - Add CMake flag for controlling the warning-as-error compiler flag during development and test.
- Add test for clang-cl (Clang with MSVC-like interfaces) support.
- Add nightly test for checking compatibility of asbind20 with the latest WIP version of AngelScript.
- Add benchmarks for finding performance issues during development.
Bug fix
- Add some missing utility interfaces for RAII helpers.
Documentation
- Update and clarify.
- Fix typo.
Full Changelog: 1.7.0...1.7.1
1.7.0 Released
Update
- Fully support of x86 (32bit) Windows platform, including special treatment for
__stdcall. - Binding generator for reference type no longer requires the registered type to be complete type.
- Policy for converting script initialization list for constructors accepting
std::from_range(_t)when C++23 is enabled.
Breaking Change
- Redesign interfaces of
container::singleto reduce some surprising behaviors.
For example, the destructor won't clean the data, you need to call another function for releasing the data.
Bug fix
- Fix mismatched declaration in array extension that may cause crash on x86 platform.
- Fix CMake error when configuring with Clang 19 toolchain.
Documentation
- Add information about using asbind20 in XMake projects.
Removed
- GCC 12 support is dropped due to too many workarounds. Please use GCC 13 or newer.
Full Changelog: 1.6.0...1.7.0
1.6.0 Released
Update
- Helper for registering modulo operator.
- Composite property support.
- Composite methods support including generic wrapper with or without variable types.
- Official arm64 support. Previously, it works theoretically but not actually tested.
- New tools for managing script function without increasing its reference count.
It's useful when the programmer has deep understanding about the lifetime and want to write zero overhead code. - Adjust file structure for maintenance.
- Slightly optimize memory usage of
small_vector.
Breaking Change
- Removed
script_function_base. Usescript_function<void>instead. asbind20::meta::compressed_pairchanged toasbind20::compressed_pairasbind20::meta::overloadedchanged toasbind20::overloaded
Bug fix
- Update compatibility with
string_viewof binding generators. - Fix compilation error when using an integer bigger than 8 bytes,
such as__int128extension provided by Clang and GCC.
Documentation
- Fix typo and wrong link.
- Fix highlight script for AngelScript.
- Add entrance for extension library for future update. (Currently, the documents of extensions are still incomplete)
Deprecated
- Support of GCC 12 will be dropped in the next release, because it requires too many workarounds. Please use GCC 13 or newer.
Full Changelog: 1.5.2...1.6.0
1.5.2 Released
Bug fix
- Fix missing
AS_NAMESPACE_QUALIFIERby @sashi0034 in #17 - Fully support of compiling with
AS_USE_NAMESPACEflag.
Full Changelog: 1.5.1...1.5.2
1.5.1 Released
Fix several bugs in 1.5.0, which are mainly caused by exceptions thrown in constructors.
Full Changelog: 1.5.0...1.5.1
1.5.0 Released
Whatβs New
Core Library
- New tools for binding complex operator overloads
- Interfaces of binding generator now all take
std::string/std::string_viewinstead ofconst char*for convenience and consistency - Tools for multithreading with AngelScript
- New tool named
overload_castfor choosing desired overloaded functions
Extension Library
First stable version of extension library released!
The extension library contains some tools that are less flexible than those in the core library. It also contains demonstration for how to register some common types like array or string by asbind20.
The extension library was developed for personal project at first (actually, the whole asbind20 was a submodule of personal project long time ago), but most of them are general purpose and can be used in other projects.
Please check the comment in source code of extension for their documentation.
Full documentation for extension library is coming soon.
Documentation
Rewrite and migrate to Read the Docs.
Bug fix
-
Generic wrapper may crash when returning some kinds of value type by value
-
Fix several bugs in
small_vector
NOTE FOR GCC USERS
- GCC 12 may fail to compile the code using new tools for registering operator overloads
- GCC 12 ~ 14 (at least) have bug that may caused link error by using binding generator of asbind20 to bind a template class within a template function.
Please check the Known Issues page for workarounds.
Full Changelog: 1.4.0...1.5.0
1.4.0 Released
What's New
- Template value class registered by
template_value_class. The oldtemplate_classhas been renamed totemplate_ref_class. - Policy API update & new policy for automatically notifying GC for newly created object.
- Store self type info in the auxiliary object by
auxiliary(this_type). This can be helpful for notifying GC in factory function of non-template reference class. - Helper for integrating
asIBinaryStreamwithstd::iostreamor container for loading/saving byte code. - Helper for registering weak reference support.
- Update RAII helpers.
- Atomic counter based on
asAtomicIncandasAtomicDec. - Support building with Address Sanitizer enabled (tested on Linux Clang 18) for eliminating memory leak.
- Tools for storing AngelScript object at host side.
Fix
- Generic wrapper now can use NRVO for returning non-copyable / non-moveable types.
- Missing support for auxiliary object for list factory function.
New Experimental Module
An experimental module called container has been added to the library. You can find it under the container/ directory.
Currently this module contains two files:
sequence.hpp: Wrapstd::vectorandstd::dequefor AngelScript objects.small_vector.hpp: Vector with small size optimization for AngelScript objects.
The wrapper for STL containers use a custom allocator to emulate an intrusive container, managing lifetime of stored script objects. However, this may relies on some complicated STL features and may not be portable due to implementation differences. It already cause many problems during the development of 1.4.0. Its development might be abandoned in next release. But I think it is still worthy sharing it in this release.
The small_vector is more stable than the STL wrapper. Currently, it only contains APIs for simple insertion and deletion. New interfaces such as sorting or complex operations will be added in future version.
asbind20::ext
- Add
weakreffor demonstrating template value class.
Clarification about the extension module:
The asbind20::ext are mixed of three kinds of code:
- Demonstration
- Tools for testing asbind20
- Some tools for specific program (like my personal project) such as asbind20's own implementation of script array / script string /
optional<T>for script.
In next release, I will move the tools for testing into code of unit test and make the interface of asbind20::ext stable. Because those code may be helpful for someone.
Full Changelog: 1.3.0...1.4.0
1.3.0 Released
What's new
- Policy options for list constructor/factory to reuse constructors of common C++ paradigm for initializing from a range.
- Factory function with an auxiliary pointer (
asCALL_THISCALL_ASGLOBALandasCALL_CDECL_OBJFIRST/LAST) - Registering methods with
asCALL_THISCALL_OBJFIRST/LASTcalling convention. - Generic wrapper for newly supported calling conventions.
- Tools for generating string representation of enum value at compile-time. *
- More utilities in
<asbind20/utility.hpp>.
*: Relying on compiler extension, please check the documentation for more information
Deprecated
The deprecated APIs will be removed in the next release (1.4).
template_classis deprecated because its name is misleading. Please usetemplate_ref_classinstead.
Templated value class will be supported in future version.
Fix
- Remove invalid noexcept by @sashi0034 in #8
- Fix error when
script_invokereturning a pointer.
New Contributor
- @sashi0034 made their first contribution in #8
Full Changelog: 1.2.0...1.3.0
1.2.0 Released
What's New
- Standalone binding generator for enumerations called
enum_(Previously they are mixed with theglobal) - Generating
opConv/opImplConvfromstatic_cast<T> - Emscripten support (which means the generic wrapper is reliable, since Emscripten only supports
asCALL_GENERIC) - Registering lambda with support like deducing calling convention / generating generic wrapper.
- Member
funcdeffor an interface - The core library is now header-only
- Utilities for marking a specific type as built-in string/array for AngelScript.
- Generic wrapper for variable types (declared as
?in the AngelScript) - Miscellaneous updates
Breaking Changes
The breaking changes are mainly happened to advanced APIs. It won't affect most of user code.
- Rework generic wrapper generator related APIs to keep in consistency with other APIs (see documentation for generic wrapper for details)
- Make some APIs for implementation as private member / in
namespace detail. In previous version they are public APIs by mistake. - Auxiliary pointer for
asCALL_THISCALL_ASGLOBALnow needs a wrapperauxiliary(your_instance)to pass to the binding generator
Fix
Fix generic wrapper for converting address of primitive type.
Note for clangd users
Clangd may crash when completing code for binding class methods. If you encounter this, you can restart the clangd after complete this part of code. Clangd still works fine with a completed code, i.e. provides go to definition, etc.
Full Changelog: 1.1.0...1.2.0