Skip to content

Instantly share code, notes, and snippets.

@hiredman
Created August 23, 2016 09:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiredman/c5710ad9247c6da12a99ff6c26dd442e to your computer and use it in GitHub Desktop.
Save hiredman/c5710ad9247c6da12a99ff6c26dd442e to your computer and use it in GitHub Desktop.

The Problems With Clojure AOT Compilation.

  1. The name is not clear.
    • The name is short hand for something, but it can easily be bandied about and ends up being used without understanding what it signifies.
    • The compilation model
      • reader
      • compiler
        • not interpreted
      • the jvm executes bytecode
      • AOT compilation saves the output of the compiler so it can be executed later instead of immediately.
    • AOT performance advantages
      • start up time
  2. The ABI is not stable.
    • ABI is Application Binary Interface
    • Can mean a lot of things, and I am sort of abusing it using it here.
    • In this case I mean how Clojure functions are linked to each other, how they are invoked and how they are looked up.
      • similar to discussions of calling conventions if you are familiar with that.
    • Changes to how functions are linked is kind of hot topic right now
      • lazy loading
      • performance
        • differences between Clojure class size and Java
    • Unstable abi means code compiled with Clojure version X is incompatible with code compiled with Clojure version Y
      • Most clojure code will work with many different versions of Clojure.
      • Once you AOT compile a library though, consumers can only reliable use the library with the same version of Clojure it was initially compiled with.
  3. Clojure’s compiler is transitive.
    • Some interest solutions to this
    • Lein hacks and work arounds
  4. Pithy summary
  5. What are alternatives to AOT compilation?
  6. What does responsible use of AOT look like?
  • Maintaince burden of AOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment