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. 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.The point is that this makes deploying a Deno application simpler. Binary size is kind of the wrong metric to worry about.
So what is the benefit?
So what's the benefit?
Same can be said about any language really, it's personal preference
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...
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.
It gets packaged inside of the executable.
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).
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.
(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.)
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.