You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modeled after deno compile, it would be cool to be able to "compile" an Ink project into a single executable. Deno achieves this by producing binary of the form:
original deno binary + bundled JavaScript string + magic number (0xD3N0) + uint64 pointer to start of JS
We can do something very similar. To do this, we first need to write an Ink bundler that can compile Ink projects into a single Ink source file, or a "bundle" file.
There's no great reason why this feature has to be a part of the Ink project per se, as opposed to a separate project that does both the compile and bundle tasks.
Ink bundler
ink -compile
The text was updated successfully, but these errors were encountered:
It's been a little over a year since, and there's now a precedence for this feature in another project of mine! It's called oak pack (named "pack" instead of "compile" to avoid confusion with the "build" command that does bundling and compilation to JavaScript).
oak pack works almost exactly as I've described it above, by appending a bundle file and signature bytes to the end of an executable. The bundler works through AST transformations in a way similar to the September project's compilation pipeline, so it would make sense to leverage the September toolchain for an "ink compile" feature as well. i.e. instead of september translate, a september pack or something.
Since Ink and Oak's module semantics are very nearly identical, I think an ink compile implementation can be almost a straight port of oak pack and associated dependencies. I don't write much Ink these days, but if I find a free few days I may hack on September again to add this.
Modeled after deno compile, it would be cool to be able to "compile" an Ink project into a single executable. Deno achieves this by producing binary of the form:
We can do something very similar. To do this, we first need to write an Ink bundler that can compile Ink projects into a single Ink source file, or a "bundle" file.
There's no great reason why this feature has to be a part of the Ink project per se, as opposed to a separate project that does both the compile and bundle tasks.
The text was updated successfully, but these errors were encountered: