@tqchen and I have been working on the new TVM object system over the pass few months in an effort to improve both the Python bindings, uniformity of TVM data model, and support for other language frontends.
You can check out my in progress attempt at using zero-cost bindings to TVM in Rust (https://github.com/jroesch/tvm/tree/rust-fe).
The new object system has nearly perfect C ABI compatibility, i.e it is possible for multiple languages to allocate, pass to other languages, modify, and deallocate. One large wrinkle blocking not only exposing the runtime data structures but the ASTs are the use of STL types which can not be easily interoperated with. For more obscure use cases this is OK, but the last primitive type left in TVM is std::string.
I propose that we remove the use of std::string from the IR, and instead use tvm::runtime::String. This container provides for free interoperability with any language which implements the object system, enabling other frontends (i.e., Rust) to directly allocate ASTs and return them to C++.
In my above branch I have already tried one possibility of converting the uses of it in Var, and GlobalVar.
The change should be relatively painless due to tvm::String constructors and conversions for interoperating with C++'s string. One challenge is modifying TVM serialization to correctly support serializing and deserializing in a backwards compatible way.
Look forward to hearing everyone’s thoughts.