tinygo-site icon indicating copy to clipboard operation
tinygo-site copied to clipboard

add tinygo tool pipeline illustration

Open soypat opened this issue 1 year ago • 3 comments

I created this a while ago for a talk. I think it may be of interest for someone who has no idea what tinygo does behind the scenes, no? tinygoPipeline

soypat avatar Sep 15 '22 00:09 soypat

I think that looks very cool! @aykevl needs to confirm accuracy, but looks correct to me?

We would also be well served by similar diagram showing the WASM/WASI compilation differences...

deadprogram avatar Sep 15 '22 08:09 deadprogram

This looks cool! Some remarks:

  • CGo is at the correct place, but note that it is done by TinyGo, not by the Go libs. This isn't clear from the diagram. (Not sure whether this is something that needs to be fixed).
  • go-llvm is just a shim around LLVM, it doesn't really do anything itself. The more relevant package would be the compiler package (./compiler in the TinyGo source tree) - but then all of this is part of the compiler so saying "compiler" is not very descriptive.
  • "Machine code" used to be correct there, but we're now emitting LLVM bitcode in many cases which is then optimized further in the linker (ThinLTO). Not sure how to express that though. For some architectures (wasm in particular), we're not using ThinLTO yet.

In any case, this looks correct enough as it is!

aykevl avatar Sep 15 '22 10:09 aykevl

Oh snap, alright, I'll find some time to fix it!

soypat avatar Sep 15 '22 14:09 soypat