Giter Club home page Giter Club logo

cthulhu's Introduction

Cthulhu

Generate FFI-compatible extern fn from harmless fns using the power of proc macros. If you are wondering which ABI this is, remember: You can't spell Cthulhu without C!

Usage

It's a mystery.

Roadmap

v0.1 series

Let's get this show on the road.

  • Introduce marshalers and their ToForeign and FromForeign traits
  • Add procedural macros for invoking marshalers
  • Generate safe runtime checking of unsafe boundaries
  • Generate "exception handling" callbacks
  • Handle all basic scalar primitives (including the bool special case)
  • Introduce ReturnType trait for reflecting return values for complex types
  • Encapsulate all information needed to generate functions into a single Function type
  • Provide a micro-framework for demonstrating Cthulhu error handling

v0.2 series

Let's get more show out of this road.

  • Implement a good resource cleanup story
  • Implement a good Vec<T> story
  • Implement a good ref/owned/ohno story
  • Get strings in all their forms working safely and ergonomically
  • Allow generating extern functions by invokeing on impl and mod levels
    • Auto-prefixing of functions with a "C namespace" of the user's choice
  • Experiment with other syntaxes for declaring marshalers on longer type signatures
  • Improve error handling and reporting (some spans are still garbage or wrong)
  • Supply default marshalers for:
    • Path types per operating system
    • UTF-16 owned/borrowed strings
    • UTF-8 owned/borrowed strings
    • Arc<T>
  • Make invoke syntax consistent with marshal
  • Add debug logging to inform the user when a value has been consumed and should not be reused
  • Clean up the tests and make them pass
  • Support types whose representation in C would be multiple parameters or a struct

v1.0 series

Let's get this stable.

  • Ability to generate APIs for Kotlin, Swift and C#
  • Fuzzed so hard that the code is no longer fazed by aggressive abuse and invalid files

Background and philosophy

We enforce the usage of stdint.h types on the C side to simplify the implementation on the Rust side.

Interesting reads:

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

cthulhu's People

Contributors

bbqsrc avatar killercup avatar

Watchers

 avatar

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.