Code Monkey home page Code Monkey logo

Comments (1)

dtolnay avatar dtolnay commented on July 28, 2024

This isn't something I plan to tackle in the near term, but I do have some loose plans for how we will expose customization of the mapping between the languages. Codebases that use the different error approaches from your links, or that use exceptions, will want a Rust Result value to turn into somewhat different code coming out of our C++ code generator. Relatedly, codebases that use a nonstandard string type will want some way to get smooth interop with that on the Rust side.

There is more design work to do, but I'd like for this stuff to not be built as special cases in this project. Instead such customization would be exposed in a sort of plugin mechanism where the codegen behavior is defined by a Rust procedural macro or something like that, and all our native types for which we ship support out of the box would be implemented through that same mechanism.

Then for something like Leaf/Outcome it would be a matter of someone writing the procedural macro that implements the understanding of how to operate on those types, putting it on crates.io, and then we register the dependency in Cargo.toml and use its types in our FFI signatures.

from cxx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.