Giter VIP home page Giter VIP logo

c-closures-rs's Introduction

Xaeroxe

Automation Maximalist

Writing code of some sort since 2012

Fields

  • Embedded
  • Desktop
  • Some Web
  • Also willing to broaden my horizons

Languages

  • Rust-lang
  • C++
  • C
  • C#
  • TypeScript/JavaScript
  • SQL
  • Java
  • Lua
  • Python

I support LGBTQ+ rights.

c-closures-rs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

c-closures-rs's Issues

support more than 16 arguments

Due to technical limitations in the C preprocessor this only supports 16 arguments. I suspect 16 is plenty, but I'd someday like to remove this limit. In the short term, the limit can also be raised by providing more macro definitions.

1.0 milestones

I feel it's healthy for a sub 1.0 project to have a defined list of things that need to happen before it can go 1.0. So here's the list for this repository.

  • Figure out a general way to permit multiple arguments to closures that doesn't significantly hamper performance. (Bonus points if it reduces the amount of boxing in this crate)
  • Type check arguments on C/C++ side without significantly hampering performance.
    • Provide some kind of compile time mapping between C/C++ classes/structs and Rust structs, then use this mapping to validate call sites (or to generate a type checked function signature). Not necessary, rust bindgen handles this well enough.

There's a general theme here. We need to start doing C/C++ code generation in addition to Rust code generation. Maybe the template system would be useful here? There's a massive amount of ways to do C/C++ builds, and ideally said code generation system would be able to plug into all of them.

Call return type destructor statically, this may not be possible.

The return type is known at compile time, so the destructor doesn't necessarily need to be stored in the closure structure. It could be compiled in to the return type release function.

Trouble is that this would require C to call Rust not via a function pointer, and for this project that would create a circular dependency. Maybe we'll come up with a way to resolve this at some point?

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.