Hacker News new | ask | show | jobs
by yellowapple 871 days ago
> FLTK and other libraries cannot be used from JavaScript.

What's the obstacle to using it via FFI (which Deno seems to support)?

1 comments

Someone has to first write bindings to the library using said FFI. This is not something most JavaScript dev can do. This has to be written by someone who knows C++ and JavaScript, and be good at both to understand all the details. (How the two interacts, how the lifetime of C++ objects play with the garbage collector, how do the inventloop mixes, ...) Writing such binding is a huge work as they the whole API need to be wrapped. And sometimes concept from the one language don't map easily in the other. (eg. templates)

And then you still have to ship an extra binary in addition to Deno itself.

Right, but that's still a far cry from being entirely unable to use them together. And as for the extra binary, that's hardly an obstacle if you already have to ship Deno itself anyway (and that ain't even considering the possibility of statically-linking it into a custom Deno binary).