-
Notifications
You must be signed in to change notification settings - Fork 10
Update FFI to be more portable and direct. #25
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
Conversation
|
I'm not sure what core's policy is on module private FFI implementations. Do we consider this a breaking change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we have a clear policy on whether or not changing FFI counts as a breaking change. I think this is fine though.
|
@thomashoneyman / @garyb Thoughts on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 I'd be happy with this even if we were just doing it to make the interface better.
Seems I wasn't watching the library, so just got the notification with the ping.
|
@natefaubion Mind adding a changelog entry? |
|
This is internal so I don’t consider it breaking. |
|
I've updated the changelog. |
|
Can this get a release? |
Description of the change
This updates the timing FFI to not bind to
hrtimedirectly, which is an odd API in general, instead taking the closure directly and returning the expected nanoseconds.My primary motivation for doing this is that the existing framework does not work well with
purescript-backend-optimizer, which aggressively eliminates unused code. The current pattern after inlining results in an unused call tof, which means nothing ever gets executed. By using an opaque FFI call, the demand on the closure is kept, and everything works as expected. Normally I wouldn't suggest doing this arbitrarily for this tool, but I think this is a better binding anyway, and is likely easier for other backends to implement since it doesn't rely on the specifics of a Node API.Checklist: