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

catch missing foreign functions earlier #5

Open
luite opened this issue Feb 25, 2014 · 1 comment
Open

catch missing foreign functions earlier #5

luite opened this issue Feb 25, 2014 · 1 comment

Comments

@luite
Copy link
Member

luite commented Feb 25, 2014

currently when some package has ccall imports that are not implemented in shims, GHCJS does not complain about any missing imports, but you get a runtime exception about undefined symbols, this is not a great user experience (especially since there are so many packages out there, and it's often unclear which packages use foreign code)

Proposal:

  • Keep track of all ccall imports per module, save a list in the .js_o file
  • When linking shims, build a list of supplied symbols for each .js file (keep these in a cache)
  • Print a warning about all missing symbols
  • Add flag to avoid printing these warnings

Limitations:

  • Works only per module, not per package (I don't think this is a problem, although it makes it harder to check that everything in a package is shimmed)
  • Either limited to some particular styles of declarations (since accurately detecting top-level symbols provided would require running the code), or requires some extra annotation syntax to indicated what symbols are supplied
@luite
Copy link
Member Author

luite commented Feb 26, 2014

Doing this per module is problematic: Due to inlining, foreign imports non-imported modules might show up in the generated code. Probably better to track this per package.

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

1 participant