Skip to content

Add guidance on when to use AOT compilation #633

Description

@lread

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions