Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ADTs #10

Merged
merged 9 commits into from
Mar 18, 2018
Merged

Support ADTs #10

merged 9 commits into from
Mar 18, 2018

Commits on Mar 14, 2018

  1. Support ADTs

    Extend contexts to prepare for deriving via TH Rust structs/unions and enums
    to match ADTs. All old examples still work.
    harpocrates committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    8f6ff9f View commit details
    Browse the repository at this point in the history
  2. Factor out some of the TH stuff

    It will need to be reused for deriving Rust types.
    harpocrates committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    e5fd7d8 View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2018

  1. Generate all Rust struct/union/enum's

    The Rust codegen that remains is the `impl`s.
    harpocrates committed Mar 15, 2018
    Configuration menu
    Copy the full SHA
    6e14669 View commit details
    Browse the repository at this point in the history
  2. Generate (mostly) conversion impl's

    Added support for generating the right pairs of `From<...> for ...`
    impl's for the ADT case. There are still a handful of small TODOs
    before this is testable though.
    harpocrates committed Mar 15, 2018
    Configuration menu
    Copy the full SHA
    9931d58 View commit details
    Browse the repository at this point in the history
  3. All Rust items are correctly generated

    I've manually verified that the generated code compiles.
    harpocrates committed Mar 15, 2018
    Configuration menu
    Copy the full SHA
    122f96e View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2018

  1. Basic ADT support!

    The one major hiccup: Haskell's FFI supports a very limited number of types.
    Consequently, I'm shoving any other type into a pointer (alloca/with) and
    passing the pointer instead. For complex return values, that means passing
    in a pointer and assigning to that pointer.
    harpocrates committed Mar 16, 2018
    Configuration menu
    Copy the full SHA
    64b5007 View commit details
    Browse the repository at this point in the history
  2. More comments around Contexts

    Added a context for unboxed types too.
    harpocrates committed Mar 16, 2018
    Configuration menu
    Copy the full SHA
    ca32893 View commit details
    Browse the repository at this point in the history

Commits on Mar 17, 2018

  1. All ADTs work

    Replaced uses of 'Into' with a custom 'MarshalInto'. Obviously
    this isn't great, but it does mean I can make the struct impl's I
    want (without conflicting with some more general impl).
    harpocrates committed Mar 17, 2018
    Configuration menu
    Copy the full SHA
    dd4db6c View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2018

  1. Example + cleanup

    harpocrates committed Mar 18, 2018
    Configuration menu
    Copy the full SHA
    484472c View commit details
    Browse the repository at this point in the history