Hacker News new | past | comments | ask | show | jobs | submit login
Deno 2 (deno.com)
152 points by frou_dh 63 days ago | hide | past | favorite | 24 comments



Deno 2 with full Node compatibility is huge, presupposed it works reliably without runtime surprises. I wouldn't mind if I get a warning when a Node package is not supported, but runtime must be rock solid, especially with server packages like node-postgres (pg).

Apart from this little doubt, I love it:

The APIs and std lib are so extensive that we don't need huge amounts of third party packages. Typescript support is great. Deno actually can check Typescript (not just run it by stripping it as Node or Bun). Compiling (bundling) is another great feature.


I just tested it with ioredis node.js package for production use and Deno 2 could handle:

- Automatic connection pooling

- 400MB/s+ of throughput

- 20 000+ keys and larger values (10-50kb)

- 1000+ concurrent reads/writes

- 200-250MB of RAM usage max

Without breaking a sweat, the limitation was my keydb test server.


Deno has had full node compatibility for a while hasn't it? It's very mature in my experience


Making their stdlib compatible for other runtimes are huge W! I'd drop some third party libs in favor of them.


Question for those who use Deno in their $job: How well does Jest work with Deno to test TypeScript? I was wondering because the announcement says it supports typescript natively, which is intriguing after I've had issues with node+jest+es6+typescript.

(Issues = mts vs ts, configuration problems, lots of conflicting documentation. It doesn't help that I'm mostly DevOps and don't spend every day on writing Lambdas for AWS etc)

Edited to add: The installation page[1] talks about asdf[2] but I find mise-en-place[3] to be faster than asdf.

1: https://docs.deno.com/runtime/getting_started/installation/

2: https://asdf-vm.com/

3: https://mise.jdx.dev/

Mise/asdf are pretty great. A .tool-versions file in your homedir will set up default versions, and you can override them with .tool-versions in your repos. And because 2 different tools can read those versioning files, you can include them in the repo and pin versions.


IMO vitest is much better than Jest when it comes to TS support. It just works out-of-the-box.


I've started using Deno for some small hobby scripts and projects, and it's been really good so far. Their LSP server and VSCode extension are way faster and better than the default one, and configuration for a new project is much easier. Plus all the things like `deno fmt`. In comparison Bun only ships the runtime, without any of the tooling niceties.

I think I wouldn't use TypeScript without Deno now :)


I wonder how much Bun pushed them to have full Node.js compatibility.


Who knows but I doubt it.

It's probably more about people complaining they can't run Next or some other framework on Deno which directly impacts their business (Deno Deploy).


Doubt it too, because -if I remember the public discussion correctly- how to migrate projects over from node to deno without basically rewriting anything was a question straight from the beginning. And bun was not a thing, or was it? - First bun 1.0 release was 2023, deno 1.0 2020.. so maybe, but unlikely :)

Anyways, that backwards compat is huge


Deno has had node compatibility for longer than Bun has been announced

It's always been controversial in the deno compatibility since they originally promised to take a principled stance NOT to support node in order to move the scene forward. But they quickly realized that they were in a market and they needed to compete and backtracked on that almost immediately


Finally something that comes close to Dart tools, or it reminds me a lot of it.

Does "deno install" behave like pnpm with the way it handles node_modules efficiently?

Also, is there any summary of the Deno 2 presentation? 1 hour is a bit too much to take in. It's almost like a movie.

The site presents Deno 2 as if it has finally beat Bun in terms of performance, is that the case? Either case, I downloaded Deno 2 from asdf and I'll give it a try, looks exciting!


> The site presents Deno 2 as if it has finally beat Bun in terms of performance

Bun's HTTP server performs 51% faster before parallelism. Their benchmark is incorrect. They posted a correction, and their correction is also incorrect. Benchmarking correctly is hard, and we put a lot of effort into making sure our benchmarks are easily reproducible.

Bun v1.1.30: 283,386 requests per second (51% faster)

Deno v2.0.0: 187,359 requests per second

Deno v1.45.5: 185,522 requests per second

The following code:

  let i = 0;

  export default {
    async fetch(request: Request): Promise<Response> {
      return new Response(`Hello, world! ${i++}`);
    },
  };

Run with:

    oha -c 10 -n 10000000 --disable-compression http://localhost:{port}
This was tested on a Linux x64 machine running Debian 11 with a 32 core Intel i9-13900 CPU and 64GB of RAM. In this benchmark, the HTTP server runs on a single thread, so the CPU core count is not as relevant but still worth mentioning.

If we increase the number of concurrent connections from 10 to 1,000 - Bun's HTTP server performs 267% faster.

Bun v1.1.30: 209,133 requests per second (267% faster)

Deno v2.0.0: 78,289 requests per second

Deno v1.45.5: 76,628 requests per second

Run with:

    oha -c 1000 -n 10000000 --disable-compression http://localhost:{port}

Note that we add the --disable-compression for Deno's benefit here (as it does nothing for Bun right now)

Have not yet spent enough time investigating their other benchmarks.


Thank you for the input Jarred! I felt something wasn't right.


> 1 hour is a bit too much to take in. It's almost like a movie

It's more like 20 mins.

There's a general intro of like 10 mins on Deno and then like 30 mins of a livestream with the Deno team.


The logo is not as cute, sad :(


Well done, the Deno team!

I found the FAQ in the announcement well made too, with some good and questions and answers.

I'm already having a great time with Deno v1 on my side project - thank you!


Deno 2 Python 3.13 TCL 9.0

Full of surprises this October


being able to run Next.js with Deno is huge! I will give this a try!


hoping it gets added to homebrew soon.


Just did it:

  $ brew update && brew install deno
  $ deno --version
  deno 2.0.0 (stable, release, aarch64-apple-darwin)
  v8 12.9.202.13-rusty
  typescript 5.6.2


Yup. Awesome! Thanks!


they mentioned in the livestream they were working on it


is there a devcontainer to play around with it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: