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

Foreign function interface #35

Open
sug0 opened this issue Sep 20, 2022 · 3 comments
Open

Foreign function interface #35

sug0 opened this issue Sep 20, 2022 · 3 comments

Comments

@sug0
Copy link

sug0 commented Sep 20, 2022

Hi,

First of all, this looks great! Congratulations on this awesome project.

I just wanted to ask if there is currently any usable FFI, or one in the plans. I'd love to use tao as an embedded language in my projects. However, I realize this may go against your goals of totality, as FFI functions can perform arbitrary computations.

Cheers,
Tiago

@zesterer
Copy link
Owner

I think the backend would likely need a substantial overhaul before it was ready for this, but it'll definitely need an FFI of some sort eventually.

It'll likely involve some equivalent of Rust's unsafe, but where the safety requirements are more stringent (i.e: no observable side effects, in the case of a pure function hooked up to FFI).

I've not put an enormous amount of thought into it at this stage (my focus is currently on the frontend) but I'm hoping to write a cranelift backend within the next few months, which opens ups the opportunity of implementing an FFI.

@sug0
Copy link
Author

sug0 commented Sep 21, 2022

In the event you pick something like the ML effect, all FFI functions could fallback to this. It would allow arbitrary I/O. AFAIK you can't really prove whether a FFI function will yield a pure computation, unless yeah you explcitly stated this with an unsafe hint of sorts.

Either way, looking forward to the implementation of this feature. Good luck!

@zesterer
Copy link
Owner

Thanks! I'm hoping I'll have some more time over the coming months to dive into the new backend and make this a reality!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants