Archicad C++ API
About Archicad add-on development using the C++ API.

Has anyone thought of creating Rust api or using Rust? over the C++ add-on api

Jack D
Booster

I'm just curious since Rust has some level of interoperability with C++ and I kinda like Rust's syntax and how memory works. i don't know... I was just exploring Rust, over the weekend, for my personal project and thought it would be interesting if Archicad could use it. Besides linux is slowly converting it's old code to Rust.

 

performance wise... I'm not sure if there will be any speed gain but Rust does have a large community of devs though. 

1 REPLY 1
gergelypaless
Participant

Hi!

 

I have given some thought about it, but it is really hard to do this, since the API uses inheritance to create UI dialogs etc. You could maybe create unsafe bindings around the API, an you could use that, but if you have to have UI, that code has to be in C++ I am affraid. (C++/Rust inheritance is possible with macro-magic, but is extremly hard to get right I think) And because of that it doesn't really make sense to maintain this FFI and use two languages for an addon.

I must say it would be nice to have a Graphisoft-maintained Rust FFI with UI in mind, so that you can just put the crate name in your Cargo.toml, and you are basically ready to go. I like to dream a lot I know 🙂

 

Another option is to use the JSON API. Which is limited, but for basic addons it is usable. You can also predefine commands I believe which you can call from "outside".