v0.0.0-beta2
PathogenDavid
released this
11 Feb 14:42
·
7 commits
to main
since this release
It's been a hot minute since a proper published release of Biohazrd! This release primarily focuses on adding some minor nice-to-have features and bug fixes.
Most notably C++ constructors are actually emitted as C# constructors now. (You must target C# 10 for this to work with parameterless constructors.)
New Features
- C++ constructors are now emitted as C# constructors.
- You can now specify a target .NET runtime and C# language versions for generation. (Default is .NET 6 and C# 10.)
- Added basic support for constant declarations. (#5)
- They aren't emitted from initial translation yet, but you can add them yourself. See
ImVersionConstantsTransformation
for example usage.
- They aren't emitted from initial translation yet, but you can add them yourself. See
- Introduced
SimpleTransformation
to make it easier to write simple one-off transformations composed of lambda expressions. - Added new info for macros, you can now get:
- Whether or not a macro has a value (#223)
- Whether Clang considers the macro to be part of a header guard pattern.
- The macro's value as a semi-normalized string (This is meant for debugging and reports, please don't try to parse using this! Use
TranslatedLibraryConstantEvaluator
instead!)
- Added the ability to add extra source code during constant evaluation. (#228)
- This is useful if a macro requires a certain namespace to be in scope, a file to be included, or a certain user-defined type in order to be evaluated.
- Added Linux ARM64 support.
size_t
/ptrdiff_t
and similar types are emitted asnuint
/nint
instead of their underlying type (IE:ulong
/long
.) (#82)
Deprecated functionality
- Clang info dumping has been deprecated. It was broken by recent changes in ClangSharp in all but the most trivial cases. (This was an internal debugging feature that was rarely used. See #227)
CSharpBuiltinTypeTransformation
was merged intoCSharpTypeReductionTransformation
(#107)- This was an artifact of how the original prototype of Biohazrd worked and was more confusing than useful.
Breaking changes
- The
Length
member of constant array helpers is now emitted as a property instead of a constant- (This makes it more natural and easier to use in real-world code.)
Minor Features & Fixes
- Added warning when a type with virtual methods doesn't have a constructor. (You can't currently instantiate these types from C#. See #31)
- Added bare-bones support for generating on macOS x64. (#226)
- macOS is still unsupported as a target platform, see the new platform support documentation for details.
- If you're interested in macOS support please consider sponsoring development.
- Fixed incorrect/misleading verification around unsupported default parameter values.
- Fixed
char
being handled incorrectly wheNResolverTypedefsTransformation
isn't used. (#232) - Added using the global namespace as the root namespace to
OrganizeOutputFilesByNamespaceTransformation
- Fixed some broken and missing
TranslatedDeclaration.ToString
implementations
Upcoming Features
The next release of Biohazrd will feature a new hosted generator API which greatly reduces the amount of boilerplate required of generator authors. (Before 🔜 After)
I'm also hard at work on a new tool called Dr. Mochi (pictured below) for helping you debug your Biohazrd generators.