Skip to content

thomasjwebb/example-haxe-externs-for-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust lib with Haxe and C++ Bindings Example

Showing how to implement a lib once in rust, with bindings for C and C++ and externs for the C bindings in haxe. As I will do for a lib I'm making, but making this minimal demonstration to hopefully help others. Also fun to make because haxe and rust are my two favorite programming languages.

Largely inspired by this example. Note that this example isn't using Ammer but should be modified to do so because that works more awesomely and comes with bindings for other languages such as python for free!

Note that this example stuffs all source code in one src directory but I would recommend having rust source in one place, c and c++ together in another and haxe in another. At the very least, in separate dirs but could also be separate repos.

Note that this only shows calling rust from haxe but not the other way around.

This includes C++ wrappers for the C as an example too, but this is not used by hxcpp. haxe/hxcpp simply uses the c bindings that rust generates (with a little help from a header file).

About

An example of haxe extern for a C binding for a rust lib

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published