ponyc icon indicating copy to clipboard operation
ponyc copied to clipboard

RFC: Export functions for calling class methods from C

Open SeanTAllen opened this issue 9 years ago • 4 comments

This RFC proposes the addition of an export keyword to specify that functions for a class should be generated even if they are not used directly in the Pony program that is being compiled. Additionally, wrapper functions for these functions that conform to the C ABI will be generated, along with a .h file with the appropriate function signatures so that the functions can be easily used from a C program. The .h file will only be generated if the program is compiled with the --export compiler flag.

Note that in addition to code, this RFC has test and documentation requirements that have to be done in order to merge. Full RFC details are at:

https://github.com/ponylang/rfcs/blob/master/text/0018-export.md

SeanTAllen avatar Oct 20 '16 02:10 SeanTAllen

I believe that @aturley will be tackling this.

SeanTAllen avatar Oct 20 '16 03:10 SeanTAllen

@aturley when you start on this, please update to "in progress"

SeanTAllen avatar Oct 20 '16 03:10 SeanTAllen

Yeah. I already have most of it implemented, but I'll move it to in progress when I start the process of whipping it into shape (tests, documentation, etc).

aturley avatar Oct 20 '16 13:10 aturley

@aturley do you still have the code for this around anywhere?

SeanTAllen avatar Sep 05 '20 12:09 SeanTAllen