6 ms·
It's standalone in a sense you end up with a single executable, but deno is embedded with your code. A `hello world` example is more than 50MB stripped. The co
by skywal_l 5y ago
It's standalone in a sense you end up with a single executable, but deno is embedded with your code. A `hello world` example is more than 50MB stripped.
The command to do that is called `compile` but its a bit of misnomer, it does not compile a free standing executable with your code but basically creates an executable wrapper around `./deno yourcode.ts`.
- kbenson 5y agoThat's not really different than how most scripting languages provide compile or application delivery features (whether built in or through a module). You're right that it isn't actually "compiling" as most people would expect that to mean in a programming context, but given that packaging into a single executable is generally what they're actually looking for, that's usually an acceptable distinction. What I wonder is how big hello world is for a statically linked packaged dene application, and if it's easy to produce those (assuming 50MB is for linked binary). That's probably more useful in a lot of cases if it's not wildly larger.
- skywal_l 5y ago/tmp$ mkdir test /tmp$ cd test /tmp/test$ curl -sOL https://github.com/denoland/deno/releases/download/v1.13.1/deno-x86_64-unknown-linux-gnu.zip /tmp/test$ unzip deno-x86_64-unknown-linux-gnu.zip Archive: deno-x86_64-unknown-linux-gnu.zip inflating: deno /tmp/test$ cat > test.ts console.log('Hello, World!'); /tmp/test$ ./deno compile test.ts Check file:///tmp/test/test.ts Bundle file:///tmp/test/test.ts Compile file:///tmp/test/test.ts Emit test /tmp/test$ ls -lh total 198M -rwxr-xr-x 1 user user 83M août 16 23:52 deno -rw-rw-r-- 1 user user 32M août 23 19:12 deno-x86_64-unknown-linux-gnu.zip -rwxrwxrwx 1 user user 83M août 23 19:13 test -rw-rw-r-- 1 user user 30 août 23 19:13 test.ts /tmp/test$ ./test Hello, World!
- kbenson 5y agoSo, it's still linked against glibc and libgcc from what I can see almost all the following are from glibc): $ ldd deno linux-vdso.so.1 (0x00007fff3fbeb000) libdl.so.2 => /lib64/libdl.so.2 (0x00007efd30939000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007efd30721000) librt.so.1 => /lib64/librt.so.1 (0x00007efd30519000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007efd302f9000) libm.so.6 => /lib64/libm.so.6 (0x00007efd2ff77000) libc.so.6 => /lib64/libc.so.6 (0x00007efd2fbb2000) /lib64/ld-linux-x86-64.so.2 (0x00007efd34593000) But honestly, that's pretty minimal. Just over 80 MB for the base to not have much in the way of dependencies seems pretty good. And given that library extensions are supposed to mostly be done in Rust (if that hasn't changed), those are statically linked by default as well, so that will hopefully cut down on accidentally introducing dependencies from the system it's built on also.