Skip to content

Releases: HenryAWE/asbind20

1.8.0 Released

28 Oct 16:17

Choose a tag to compare

Update

  • script_invoke_result no 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 int such as std::byte.

  • Experimental support for script foreach.

  • script_invoke_result now supports operator-> for pointer type,
    which is useful for accessing members of returned reference types.

  • Expose get_context_result for easily retrieving result from context.

  • Add member function value_or for script_invoke_result.

  • script_invoke_result can be converted to std::optional.

  • script_invoke_result can be converted to std::expected if 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 (or std::expected if C++23 is available).

Documentation

  • Add Chinese README

Full Changelog: 1.7.1...1.8.0

1.7.1 Released

07 Aug 02:53

Choose a tag to compare

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

19 Jul 02:59

Choose a tag to compare

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::single to 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

14 Jun 14:26

Choose a tag to compare

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. Use script_function<void> instead.
  • asbind20::meta::compressed_pair changed to asbind20::compressed_pair
  • asbind20::meta::overloaded changed to asbind20::overloaded

Bug fix

  • Update compatibility with string_view of binding generators.
  • Fix compilation error when using an integer bigger than 8 bytes,
    such as __int128 extension 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

13 May 10:17

Choose a tag to compare

Bug fix

  • Fix missing AS_NAMESPACE_QUALIFIER by @sashi0034 in #17
  • Fully support of compiling with AS_USE_NAMESPACE flag.

Full Changelog: 1.5.1...1.5.2

1.5.1 Released

21 Apr 15:53

Choose a tag to compare

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

31 Mar 05:30

Choose a tag to compare

What’s New

Core Library

  • New tools for binding complex operator overloads
  • Interfaces of binding generator now all take std::string / std::string_view instead of const char* for convenience and consistency
  • Tools for multithreading with AngelScript
  • New tool named overload_cast for 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

08 Mar 11:06

Choose a tag to compare

What's New

  1. Template value class registered by template_value_class. The old template_class has been renamed to template_ref_class.
  2. Policy API update & new policy for automatically notifying GC for newly created object.
  3. 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.
  4. Helper for integrating asIBinaryStream with std::iostream or container for loading/saving byte code.
  5. Helper for registering weak reference support.
  6. Update RAII helpers.
  7. Atomic counter based on asAtomicInc and asAtomicDec.
  8. Support building with Address Sanitizer enabled (tested on Linux Clang 18) for eliminating memory leak.
  9. Tools for storing AngelScript object at host side.

Fix

  1. Generic wrapper now can use NRVO for returning non-copyable / non-moveable types.
  2. 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:

  1. sequence.hpp: Wrap std::vector and std::deque for AngelScript objects.
  2. 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

  1. Add weakref for 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

22 Feb 11:57

Choose a tag to compare

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_ASGLOBAL and asCALL_CDECL_OBJFIRST/LAST)
  • Registering methods with asCALL_THISCALL_OBJFIRST/LAST calling 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_class is deprecated because its name is misleading. Please use template_ref_class instead.
    Templated value class will be supported in future version.

Fix

  • Remove invalid noexcept by @sashi0034 in #8
  • Fix error when script_invoke returning a pointer.

New Contributor

Full Changelog: 1.2.0...1.3.0

1.2.0 Released

11 Feb 16:01

Choose a tag to compare

What's New

  1. Standalone binding generator for enumerations called enum_ (Previously they are mixed with the global)
  2. Generating opConv / opImplConv from static_cast<T>
  3. Emscripten support (which means the generic wrapper is reliable, since Emscripten only supports asCALL_GENERIC)
  4. Registering lambda with support like deducing calling convention / generating generic wrapper.
  5. Member funcdef for an interface
  6. The core library is now header-only
  7. Utilities for marking a specific type as built-in string/array for AngelScript.
  8. Generic wrapper for variable types (declared as ? in the AngelScript)
  9. Miscellaneous updates

Breaking Changes

The breaking changes are mainly happened to advanced APIs. It won't affect most of user code.

  1. Rework generic wrapper generator related APIs to keep in consistency with other APIs (see documentation for generic wrapper for details)
  2. Make some APIs for implementation as private member / in namespace detail. In previous version they are public APIs by mistake.
  3. Auxiliary pointer for asCALL_THISCALL_ASGLOBAL now needs a wrapper auxiliary(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