6 ms·
> a language and runtime, webserver, package ecosystem, and arguably infrastructure and database Some gentle pushbacks: Runtime and webserver yes (though not
by brundolf 3y ago
> a language and runtime, webserver, package ecosystem, and arguably infrastructure and database
Some gentle pushbacks:
Runtime and webserver yes (though not web framework), language sorta, though Node is already just as much all of these things
Package ecosystem also sorta. Any Deno module that doesn't use the Deno APIs is isomorphically runnable in the browser and most other JS contexts. This is actually more true than with Node, because idiomatic Node code uses CommonJS imports which are incompatible with the browser without transpilation
Infrastructure I don't think is really true; obviously there's Deno Deploy, but I don't use that for any of my Deno projects. If anything, the fact that it's so self-contained makes it more flexible to different kinds of infrastructure. All you need installed is the runtime, and then you run a single command and you're off to the races (with dependencies downloaded automatically as needed)
I think it strikes a great balance between batteries-included and compatibility. It's become my favorite default way to write a CLI or a web server
- steve_adams_86 3y agoI had similar hang ups about deno but my experience aligns with what you’re saying. I hit far fewer snags than I thought I would (none I suppose), and the tooling off the shelf was excellent. I was off and running within 30m or so. I got a little confused about importing packages properly but it might be down to how my IDE handles stuff and not really deno-specific. I also love it for CLI work. I was using Go pretty much exclusively for years, but I’ve used Deno twice for real work and a bit for experimentation. Go offers some features I prefer, but Deno offers TypeScript which — for better or worse — is where I think best in code. I like to maintain it more, which means a lot for something I have to deal with next year.
- j1elo 3y agoWait, Node or Deno for CLI tools? I was reading this and thinking "Go would make a much better tool for that job", so after seeing that you have actually used it in the past, I cannot but ask about some more info or comments your might have about it. A language that is designed from the ground up to compile into standalone binaries seems so much more apt for CLI tools... Deno/Node, on the other side of the spectrum, requires a whole environment and runtime, which seems like a hassle. I know of vercel/pkg but that's not a first-class citizen of the ecosystem and has its shortcomings.
- JimDabell 3y agoYou can run `deno compile` to build a standalone binary. https://deno.land/manual/tools/compiler https://deno.land/manual/tools/compiler
- j1elo 3y agoVery interesting, I just learned that Deno has direct support for doing this! Very useful, indeed. Thanks for mentioning it. Have you used it, to know what is the baseline size of the file it generates? e.g. the size of a "hello-world" command, which would be basically 99.9% composed of the runtime and core libraries.
- acdibble 3y agoIt’ll bundle the entire V8 engine. You can expect probably close to 80mb for a hello world app.
- JimDabell 3y agoI’m not sure about the size of a Hello World but a very small command-line tool I wrote is about 90MB, where the only substantial dependency is commander.js from NPM. I expect the vast majority of that is a constant size added to all binaries.
- brundolf 3y agoThe other commenter mentioned `deno compile`, but also, if you're in a situation where you can assume everyone has the deno runtime installed (maybe it's a personal script, or it's org-internal or something) then you don't really even need to do that, because the runtime is the only piece of environment you need. The dependency management is self-contained and the runtime is backwards-compatible; scripts should generally "just work"
- j1elo 3y agoI was assuming a more general case where concerns like distribution of the tool are something to think about. Of course if it's just a personal thing, it doesn't matter much, I just wasn't counting on such a small use case.