Live data from Hacker News

Deno 1.6 supports compiling TypeScript to a single executable

github.com

1–10 of 284 posts

Re: Deno 1.6 supports compiling TypeScript to a single executable

#4
Just throwing it out there for visibility, ncc will compile a TS entrypoint down to a single file as well, without having to use Deno https://www.npmjs.com/package/@vercel/ncc

Edit: I completely missed that this Deno release packaged the runtime as well, disregard this as an alternative! Guess I’ll eat the downvotes I deserve :P

Re: Deno 1.6 supports compiling TypeScript to a single executable

#6

Just throwing it out there for visibility, ncc will compile a TS entrypoint down to a single file as well, without having to use Deno https://www.npmjs.com/package/@vercel/ncc Edit: I completely missed that this Deno release packaged the runtime as well, disregard this as an alternative! Guess I’ll eat the downvotes I deserve :P

> without having to use Deno

But you need to use ncc? What's the relevant difference?

Re: Deno 1.6 supports compiling TypeScript to a single executable

#7

Just throwing it out there for visibility, ncc will compile a TS entrypoint down to a single file as well, without having to use Deno https://www.npmjs.com/package/@vercel/ncc Edit: I completely missed that this Deno release packaged the runtime as well, disregard this as an alternative! Guess I’ll eat the downvotes I deserve :P

This still requires a node runtime. As far as I understand, the deno usage creates a single executable - batteries included.

Re: Deno 1.6 supports compiling TypeScript to a single executable

#8

Just throwing it out there for visibility, ncc will compile a TS entrypoint down to a single file as well, without having to use Deno https://www.npmjs.com/package/@vercel/ncc Edit: I completely missed that this Deno release packaged the runtime as well, disregard this as an alternative! Guess I’ll eat the downvotes I deserve :P

Not sure ncc is an equivalent. I think nexe or pkg are comparable, they bundle a runtime into the exe whereas ncc just reduces the code down to a single distributable code file in that you still need node installed to run it on the target host.

Re: Deno 1.6 supports compiling TypeScript to a single executable

#9
post #2

This is such a good feature. Go has been great for shipping single purpose binaries (like the CLI for https://fly.io ), but I really enjoy writing TypeScript more than Go.

A lot of languages are doing single static binary deploys now. Rust, Nim, Go. It's a really nice pattern.

Static binaries are so much easier that the gross PHP / Ruby / Python pattern that has to ship directories full of files that (usually) have to be put in the correct place.

It's also easier than shipping a runtime like a JVM.

With a single binary, containers get even slimmer.

Re: Deno 1.6 supports compiling TypeScript to a single executable

#10
post #5

Does this offer a speed increase vs running the the code directly using $ deno test.js ( not sure what the exact command is )

Not really (at least yet, I think). This simply bundles the Deno binary and the script (I think the pre-compiled, as in TypeScript -> JavaScript, then possibly as pre-compiled AST). This is why the output binary size is the original Deno binary + the script size (roughly).

So it's functionally equivalent to running using deno test.js

Post reply on HN