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

Add guidance on when to use AOT compilation #633

Open
lread opened this issue Jan 11, 2023 · 0 comments
Open

Add guidance on when to use AOT compilation #633

lread opened this issue Jan 11, 2023 · 0 comments

Comments

@lread
Copy link
Contributor

lread commented Jan 11, 2023

There is a good reference on AOT compilation, but I don't see strong guidance on when to use it, or more specifically when to not use it.

My understanding is that it is relatively safe to employ AOT compilation for an app.

But sometimes a library author will naively use AOT compilation when creating their release jar without realizing the problems this can cause for users of their library. These problems include (additions and corrections most welcome):

  • aot compilation will create class files for library dependencies, this effectively brings in these dependencies (or portions of dependencies) at jar creation time, rather than runtime. A user might bring in different versions of those dependencies. Having multiple instances of a dependency on the classpath at runtime leads to confusion.
  • a class file will not include metadata such as original clojure filename and line number.
  • different versions of Clojure can generate different bytecode

I suppose a note on how/when to safely employ AOT compilation for a lib might also be helpful.

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