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

terminology AOT vs JIT #560

Closed
codefromthecrypt opened this issue May 15, 2022 · 5 comments · Fixed by #564
Closed

terminology AOT vs JIT #560

codefromthecrypt opened this issue May 15, 2022 · 5 comments · Fixed by #564

Comments

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented May 15, 2022

I'm raising an issue not because it is vitally important, but because to do something about it is API affecting, and if we want to do it, we should do it now.

Right now, we conflate compiler with JIT, and one could argue how we compile is more like AOT(Ahead of Time) than JIT(Just in Time). This isn't to say others aren't also conflating, but I do think that even if others conflate this, we have a choice whether to or not.

A proposal I have is to rename "jit" to "compiler" resulting in runtimes being interpreter vs compiler. Then, when discussing the default compilation mode, we could say in docs it is AOT applied at Runtime.Compile instead of calling it JIT. In the future, we can introduce a JIT mode, and also we can easily transition to other AOT modes, such as being able to persist the result of Runtime.Compile for future use (See #179 and #421)

Since this has API impact, I'd like to get feedback both from other maintainers cc @mathetake @anuraaga as well end users cc @pims @pkedy @inkeliz @knqyf263 @sam-at-luther @efejjota @danielpacak @birros @wuhuizuo

The TL;DR; is rename JIT -> Compiler, and document it as AOT (Ahead of Time) compilation applied at Runtime.CompileModule until we support alternate modes, which would be indicated in RuntimeConfig or CompileConfig somehow.

My thinking is if there are a few thumbs up and no strong opinions against, renaming should happen. If there are no thumbs up, renaming shouldn't happen :D

@mathetake
Copy link
Member

actually the compiler is AOT as you described so no objection :D

@codefromthecrypt
Copy link
Contributor Author

@anuraaga mentioned something offline which is important when describing things. AOT might trigger fear of android rebuild app experience. When we document this, we should note that wazero won't need to be rebuilt and surely your app won't. worst case is we introduce a way to externalize storage of pre-compiled wasm, and that ends up invalid. Everything would be automatic and an implementation detail.

@codefromthecrypt
Copy link
Contributor Author

I see 7 👍 so will go ahead with this sometime in the near future. thanks for the feedback, folks

codefromthecrypt pushed a commit that referenced this issue May 16, 2022
This notably changes NewRuntimeJIT to NewRuntimeCompiler as well renames
packages from jit to compiler.

This clarifies the implementation is AOT, not JIT, at least when
clarified to where it occurs (Runtime.CompileModule). In doing so, we
reduce any concern that compilation will happen during function
execution. We also free ourselves to create a JIT option without
confusion in the future via CompileConfig or otherwise.

Fixes #560

Signed-off-by: Adrian Cole <adrian@tetrate.io>
mathetake pushed a commit that referenced this issue May 16, 2022
This notably changes NewRuntimeJIT to NewRuntimeCompiler as well renames
packages from jit to compiler.

This clarifies the implementation is AOT, not JIT, at least when
clarified to where it occurs (Runtime.CompileModule). In doing so, we
reduce any concern that compilation will happen during function
execution. We also free ourselves to create a JIT option without
confusion in the future via CompileConfig or otherwise.

Fixes #560

Signed-off-by: Adrian Cole <adrian@tetrate.io>
@codefromthecrypt
Copy link
Contributor Author

incidentally, this probably doesn't break API for many if they are using wazero.NewRuntime() which implicitly chooses which to use.

@codefromthecrypt
Copy link
Contributor Author

fyi this blog has a nice section describing this https://mathetake.github.io/posts/runtime-code-generation-in-go-part-1/

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

Successfully merging a pull request may close this issue.

2 participants