Enhance compile to optimize; build minimal deno executable #16337
Unanswered
guest271314
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say I have an algorithm that I have written in several programming langauges.
With the C and C++ versions I can use
gcc
,g++
,clang
to compile an executable correspoding to the includes and actual code used.Node.js itself has no such capability https://github.com/nodejs/single-executable/blob/main/blog/2022-08-05-an-overview-of-the-current-state.md and interestingly
deno compile
is not listed in existing solutions https://github.com/nodejs/single-executable/blob/main/docs/existing-solutions.md.I have written Deno and Node.js specific versions of the algorithm, shared here #16206, using
deno
the complete code isIt would be helpful if there was a way to identify only the source code necessary to
On *nix with
I still get a 96.4MB executable.
To me it makes sense for
compile
to be able to read a prospective--optimize-compile
flag to first analyze the code to be compiled, then import only the modules needed to compile the single executable, so that the resulting standalone executable is not carrying around code that will never be used.--
Further, it would be useful to start with the JavaScript source code analyzation, then build the
deno
executable from that source code to do that one standalone task thatcompile
outputs as an executable (QuickJS hasqjsc
); to avoid carrying around upwards of 80-90MB of source code baked into the standard executable that will never be used in this case.The simpler of the two is how to analyze the JavaScript code I am using to identify the files I can delete from fork of deno, to build
deno
executable with only the source necessary to execute the above code (possibly withcompile
- so that whencompile
is executed only the minimaldeno
executed is compiled therein)?Beta Was this translation helpful? Give feedback.
All reactions