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

Is ocaml-ctypes or gen_js_api for Melange possible? #565

Open
jchavarri opened this issue May 9, 2023 · 1 comment
Open

Is ocaml-ctypes or gen_js_api for Melange possible? #565

jchavarri opened this issue May 9, 2023 · 1 comment

Comments

@jchavarri
Copy link
Member

I wonder if something like yallop/ocaml-ctypes or LexiFi/gen_js_api would be possible for Melange. "Externalizing" the bindings creation outside the compiler would remove complexity from Melange itself. And from user perspective, it would bring some benefits, like no more need to use [@bs] attributes when defining callbacks in bindings.

Would it be possible? If yes, what kind of primitives should Melange expose for it to happen? Also, what kind of trade-offs would exist? One thing that comes to mind is the zero-cost JS object creation functions exposed by bs.abstract that libraries like reason-react take advantage from. Another disadvantage is the fragmentation caused on bindings.

@anmonteiro
Copy link
Member

Even better would be to get https://github.com/ocsigen/ts2ocaml running.

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