Compiling to a binary
When Deno was initially launched, Dahl stated that one of its objectives was to be able to ship Deno code as a single binary, something similar to what golang does, from day one. This is very similar from the work that nexe (https://github.com/nexe/nexe) or pkg (https://github.com/vercel/pkg) do for Node.
This is different from the bundle feature, where a JavaScript file is generated. What happens when you compile Deno code to a binary is that all the runtime and code is included in that binary, making it self-sustainable. Once you've compiled it, you can just send this binary anywhere, and you'll be able to execute it.
Important note
At the time of writing, this is still an unstable feature with many limitations, as mentioned in its release notes at https://deno.land/posts/v1.7#improvements-to-codedeno-compilecode.
This process is very simple. Let's see how we can do this.
We just need to use the compile
command. For this example...