News for hackers. Stuff that matters.
Re:Deno 1.35: A fast and convenient way to build web servers by steve_adams_86 on Wednesday July 05, 2023 @12:19PM (#36602619)
I 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.

Re:Deno 1.35: A fast and convenient way to build web servers by j1elo on Wednesday July 05, 2023 @03:44PM (#36606044)
Wait, 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.

Re:Deno 1.35: A fast and convenient way to build web servers by brundolf on Wednesday July 05, 2023 @04:34PM (#36606736)
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"
Re:Deno 1.35: A fast and convenient way to build web servers by j1elo on Wednesday July 05, 2023 @05:21PM (#36607334)
I was assuming a more general case where concerns like ditributio 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.
Re:Deno 1.35: A fast and convenient way to build web servers by zellyn on Thursday July 06, 2023 @09:50AM (#36615725)
Or just use Hermit to automatically install deno on first run… https://github.com/cashapp/hermit

(Disclaimer, I work for Square, a sister org within Block of CashApp, where the folks that created Hermit work.)

I've started using Hermit for all my personal projects... one too many times I've cloned one of my own github projects I haven't touched for a couple of years and taken half an hour to remember/decipher how to get everything installed and running. Now I just use Hermit, and possibly a `bootstrap.sh` file that will `pip install -f requirements.txt` or suchlike, and I'm off to the races.

Re:Deno 1.35: A fast and convenient way to build web servers by JimDabell on Wednesday July 05, 2023 @04:25PM (#36606596)
You can run `deno compile` to build a standalone binary.

https://deno.land/manual/tools/compiler

Re:Deno 1.35: A fast and convenient way to build web servers by j1elo on Wednesday July 05, 2023 @05:24PM (#36607366)
Very 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.

Re:Deno 1.35: A fast and convenient way to build web servers by acdibble on Wednesday July 05, 2023 @05:47PM (#36607617)
It’ll bundle the entire V8 engine. You can expect probably close to 80mb for a hello world app.
Re:Deno 1.35: A fast and convenient way to build web servers by JimDabell on Wednesday July 05, 2023 @05:50PM (#36607653)
I’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.
Re:Deno 1.35: A fast and convenient way to build web servers by steve_adams_86 on Wednesday July 05, 2023 @06:57PM (#36608369)
You're not wrong — Go is awesome at this, and on paper it's generally a better tool for the job. I had to write a CLI tool that did a ton of concurrent fetching and processing with interactive retries, pausing, and other nasty UX stuff that would have been misery in TypeScript compared to Go, but I had it working well inside of a week. I don't think the same would be true of something I'd make with Deno, or at least not with the same performance.

Yet I can model solutions better in TypeScript, I work faster most of the time, I find the people I work with tend to understand complex TypeScript projects far more readily than complex Go projects, and some tooling (certainly not all) can be nicer in TypeScript land. There are definitely trade-offs. There are some go-to packages I love to use and fit my habits extremely well in that ecosystem though, so that's a welcome benefit for me personally.

If I had to build something very fast, reliable, more readily portable, and well-suited to Go's strengths, I wouldn't hesitate to use it. For something smaller or far nicer to model with TypeScript's type system, or with a team that isn't up to speed with Go, I'll seriously consider Deno without feeling like it's a major compromise.

Re:Deno 1.35: A fast and convenient way to build web servers by j1elo on Thursday July 06, 2023 @09:26AM (#36615409)
Everything you said makes sense. If it's a tool shared and maintained by a team, technology is not the only matter to consider. Familiarity and ease to model the problem is also very important. Thanks for sharing your perspective
Re:Deno 1.35: A fast and convenient way to build web servers by steve_adams_86 on Thursday July 06, 2023 @04:43PM (#36622690)
You’re welcome!

The more I think about this the more I realize how spoiled we are these days. These are both awesome tools in their own right that didn’t even exist when I got started. It’s a real joy to have such great tools to work with.