Hacker News new | ask | show | jobs
by tlarkworthy 3440 days ago
I am sick of having to rewrite difficult data structures. I though if haxe could compile libraries I might never have to. But maybe just doing everything in rust might be a better approach?
1 comments

It would be nice if you could "auto-export" from Rust. The pieces of the puzzle are something to generate a C API from a module's public API -- without `extern` declarations -- and then something to turn that API into Ruby, Python, Swift, Node, Java, Go, &c.

Clang modules are the beginning of something for the latter task. SWIG also has a lot of ideas that are usable -- and SWIG can handle the API description having classes and methods, since it handles C++. Though I would hesitate to make C++ headers the lingua-franca of code.