https://github.com/defold/example-languages
Example of writing an extension using different languages
https://github.com/defold/example-languages
Last synced: 4 months ago
JSON representation
Example of writing an extension using different languages
- Host: GitHub
- URL: https://github.com/defold/example-languages
- Owner: defold
- License: mit
- Created: 2023-07-04T17:03:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-16T15:03:44.000Z (12 months ago)
- Last Synced: 2025-09-15T18:55:43.380Z (4 months ago)
- Language: C#
- Homepage:
- Size: 57.6 KB
- Stars: 17
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
This example project shows how to write [native extensions](https://defold.com/manuals/extensions/) using C++, C# and Zig.
* C++
* Stable
* [Zig](https://ziglang.org)
* Experimental support
* The current state of the Zig toolchain is not stable, and may be updated at any time.
* Used an experimental [C API for Defold](https://github.com/defold/defold/blob/dev/engine/extension/src/dmsdk/extension/extension.h)
* C#
* Experimental support
* Based on DotNet 9 with AOT compilation
* Generated from an experimental [C API for Defold](https://github.com/defold/defold/blob/dev/engine/extension/src/dmsdk/extension/extension.h)
## Testing locally
The project is also designed to test performance of the different languages.
To build with certain setup, you can use a command line such as:
LOOPCOUNT=1000000 VARIANT=debug SERVER=http://localhost:9000 ./scripts/build_feature.sh arm64-android cpp
* The `LOOPCOUNT` is used to control how many loops the performance tests should run.
* The `cpp` controls which language to add. Lua is always part of the tests.
* Possible values are `cpp`, `csharp`, `zig` and `all`
See the [](./scripts/build_feature.sh) and [](./scripts/common.sh) for a full list of environment variables (BOB, SERVER etc)