-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
can deno compile into bytecode? #8820
Comments
I'm curious. How do you know all the source codes at the end of the executable |
Can be seen in any hex editor or even objdump. |
u are right |
It is a complicated process, as we would have to generate a custom snapshot, which is also architecture specific. It is being considered, but I wouldn't expect it any time soon. |
I was doing a comparison between Deno compile and go build products, and found that the .exe file generated by Deno is 31.4mb, and go is 2.02mb, tests article. |
That is an unfair comparison because go compiles to machine code plus some runtime and gc stuff, javascript cannot be compiled to machine code, therefore deno has to ship v8 and its runtime in each executable. |
Deno compiled executables will get smaller in the future though. We estimate 15-20 MB for a hello world. |
supporting both framework(or runtime)-dependent deployment mode and standalone deployment mode would be nice, just like |
It would be nice to have something like how NW.js has. The main thing that I had always liked about it over Electron, only downside is that it is much bigger for final product size then even electron. Looking at 300+ MB for deployment with NW.js and about 90MBs for electron deployment. Had to make sure making some pretty big apps to justify that harddrive size consumption. RAM usage was about the same. |
Related to #3335 |
Related to #9243 about Deno's size |
There are no plans to compile to raw instructions in We will continue to work on reducing |
Out of curiosity, Bun 1.1.30 has shipped compilation to bytecode which allegedly improves start time by 2x. Improvements of such magnitude would be a huge deal for certain projects, even at the cost of bigger binaries. FWIW Electron Vite also allows for bytecode compilation, for V8-based runtimes. |
What about compiling to code caches? Cached code can be executed without the corresponding source code if all functions are eagerly compiled and the checksum is zeroed out. |
I'm looking forward to waiting for the Binary AST proposal. |
I was also thinking of the same thing! I do hope that deno could also add bytecode support |
FYI this should be available in Deno v2.1.0 - PR to follow #26528 |
i just found that
deno compile
just embeds all the source codes at the end of the executable, and it is very easy to extract them. so, can deno compile the source codes into bytecodes(or any future plans) so it can protect the code.The text was updated successfully, but these errors were encountered: