graydon/rust — Issue #1281: Clarify story on native functions
Author: nikomatsakis
Created: 2011-12-09 23:37:32+00:00
State: open

Right now, native functions have a distinct type from normal functions but there is no way to type it! The reason that the type is distinct used to be because the ABI for native functions was different. This caused a lot of bugs (#1059, #1058, #1174, #1179) so I implemented wrappers. I like the wrappers, it makes for very clean trans code. However, I also think it would be great to be able to pass around native C function pointers.

Basically I think we ought to decide between one of two options:

- keep the wrappers, merge native function types with normal functions
- ditch the wrappers, make it so that native functions are limited

If do the latter, we'd have to fix the problems listed in the prior bugs. In some cases, like bind, we can just make it illegal. Cross-crate calls though probably ought to work (or maybe not?).