News for hackers. Stuff that matters.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by svnpenn on Wednesday December 09, 2020 @11:53PM (#25369888)
Yeah, and the executable is 47 MB. You can do the same thing with Go:

    package main
    import "os"
    func main() {
       for _, s := range os.Args[1:] {
          o, _ := os.Open(s)
          os.Stdout.ReadFrom(o)
       }
    }
and the executable is 1 MB.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by PaulBGD_ on Wednesday December 09, 2020 @11:58PM (#25369917)
This would be more comparable to packaging a Java program into an executable, which would have to also contain the JIT. I don't think it's fair to compare a JIT'd language to a AOT'd language.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Thursday December 10, 2020 @02:39AM (#25370948)
A Java program can be AOT compiled to native code, no need to package a JIT.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by dguaraglia on Thursday December 10, 2020 @12:06AM (#25369965)
Sure, and you can do something similar with C and obtain a ~10kb executable, or even less if you put some effort. Or write that in Java and need a complex setup including the JRE and a bunch of packages to support it.

The point is that this makes deploying a Deno application simpler. Binary size is kind of the wrong metric to worry about.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by svnpenn on Thursday December 10, 2020 @12:41AM (#25370213)
My point is, what is even the point of using Deno? If its for static typing... well Go has that.

So what is the benefit?

Re:Deno 1.6 supports compiling TypeScript to a single execut... by throw_m239339 on Thursday December 10, 2020 @02:22AM (#25370836)
> So what is the benefit?

A better type system(covariance, dependent types) than Go's and generics, a richer ecosystem, deploying the same codebase on the server and in the client...

Re:Deno 1.6 supports compiling TypeScript to a single execut... by Soremwar on Thursday December 10, 2020 @02:07AM (#25370744)
What's even the point of using Go? If it's for static typing Rust has that

So what's the benefit?

Same can be said about any language really, it's personal preference

Re:Deno 1.6 supports compiling TypeScript to a single execut... by ben509 on Thursday December 10, 2020 @12:26PM (#25376025)
If you wrote a browser client in Javascript / Typescript, then it makes sense to write a backend in it as well since it's easy to share code and data between them.

Now you can also write CLI tools that are trivial to deploy and can also share code with everything else.

This is the same motivation behind other languages that do the reverse; compile to JS / WASM.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by fareesh on Thursday December 10, 2020 @02:37AM (#25370933)
Guessing here - is there any value from a team / engineering point of view to having shared code for custom classes / data structures between client and server? Here I assume client to be mean browser
Re:Deno 1.6 supports compiling TypeScript to a single execut... by txdv on Thursday December 10, 2020 @02:15AM (#25370790)
Why is Go's binary so big?
Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Thursday December 10, 2020 @02:36AM (#25370927)
Standard library and runtime.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by tgv on Thursday December 10, 2020 @05:15AM (#25372004)
I see a go binary, stand alone. And a lot of symbols. Jesus, that's a lot of symbols.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Thursday December 10, 2020 @05:27AM (#25372101)
Yes standalone, all languages have a runtime, even C.

It gets packaged inside of the executable.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by ameliaquining on Wednesday December 09, 2020 @11:58PM (#25369914)
If the 47 MB executable has no dependencies other than the kernel, then in many scenarios it'd be a lot easier to deploy than if you had to separately install a language runtime.

Of course, Node.js can also do this with pkg, and also I don't know whether executables produced this way really are dependency-free (although depending only on widely-available shared libraries would be almost as good).

Re:Deno 1.6 supports compiling TypeScript to a single execut... by 205g0 on Thursday December 10, 2020 @12:13AM (#25370012)
> then in many scenarios it'd be a lot easier to deploy

It's not. Most advanced deployments nowadays use container orchestration where deploying is as easy. For simple deployments (eg SSGs) there're enough products on the market.

Integrating the build step hides it at the same time (good for beginners) but creates many other problems in the long run if we just talk about repackaging the run-time.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by ameliaquining on Thursday December 10, 2020 @02:25AM (#25370865)
I think you're underestimating the diversity of environments out there. Not everyone's using cutting-edge deployment tech; lots of folks are just SSHing or RDPing into a physical or virtual server, copying stuff there, and running it. Certainly, that's how things were done at my last job. And it can get worse; some of these environments are locked down in some way or another, by security policies that limit what you can do. In those environments, having the executable be fully self-contained is really helpful.

(For the record, I am a proponent of things like containerization and serverless, and generally try to bring them into use wherever I can. This doesn't require me to ignore the reality that lots of places don't use them, and that this will remain true for a long time to come.)

Re:Deno 1.6 supports compiling TypeScript to a single execut... by 205g0 on Thursday December 10, 2020 @11:02AM (#25375116)
> Not everyone's using cutting-edge deployment tech; lots of folks are just SSHing or RDPing into a physical or virtual server, copying stuff there, and running it

Maybe a decade ago, tbf IDK anyone who deploys like this in 2020, people user either Docker and/or k8s or a stupid-simple netlify/surge/vercel push. Then, there's also server-less stuff but yeah, you get the idea.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by qeternity on Thursday December 10, 2020 @03:36AM (#25371282)
I’m not sure this should be encouraged...