Hacker News new | ask | show | jobs
by rana1-31 1759 days ago
So the Deno runtime is written in Rust and so is all the Deno tooling... So why would you use Deno if it is not good enough for itself?
6 comments

The Python and Ruby interpreters and runtimes are written in C. Turns out that compiled systems languages are good choices for implementing other programming languages.
My point was not the compilers/interpreters, it was the fact ALL the tooling is NOT in Deno.
Maybe because Deno folks are pragmatics and not fanatics.

Rust is faster than V8. I'm not sure if ALL Deno tooling is written in Rust, but it makes sense to write, say, Typescript => JavaScript converter in Rust if it's 10-100x faster.

All that tells you is that if you want a very fast Typescript => JavaScript converter then you too should use Rust (or Go or C++) and not JavaScript executed by V8.

But writing a web app?

You're free to use Rust for that as well but millions of people chose nodejs instead and those are the people that might choose Deno in the future.

And indeed, you can see as a great example from the discussion on this thread how they eventually arrived at relying on Rust for most steps in the tsc toolchain: https://github.com/denoland/deno/issues/5432

The conclusion reached there is as you have stated: Rust is simply an order of magnitude faster in most cases.

IMO, I don't think a single threaded and interpreted language would be a good choice for something that complex, especially for CPU bound tasks.
If you are writing for the web or building things for a different use-case than deno targets.
You are going to have to reword this, it makes no sense to me.
Rust is not well suited for the same things as javascript / typescript / jsx / etc.

Also javascript and typescript are not well suited for compilers and dev tooling.

It shouldn't be seen as a negative that Deno is using rust in places where it really shines, which is a totally different use case than what deno is typically used for.

Other than browser based applications why would you choose JavaScript/TypeScript etc over Rust?

Developer tooling is not complicated and there is plenty of existing tools written in JavaScript, so it seems weird when they rule out there own language as not good enough. It should make anyone think twice before using Deno server side if it is not good enough for themselves.

This sounds like an argument from 25 years ago. We are well past the false idea that compiled no-runtime languages are better for all use cases.
What is a use case for an interpreted runtime language?
The parts used to make your car were likely delivered to the factory by a semi truck, and not by another car. Should you buy a semi truck to go to the mall then, since even the carmaker thinks that cars aren't good enough? Obviously not. Different requirements are a thing.
Typescript/Deno is very ergonomic and presents a lower barrier for entry for writing web servers. However, it's a relatively large and slow to start runtime which makes it less than ideal for developer tools.

You should use the right tool for the job. Not every language is good for every job or every person.

I have done work on compiler, developer tooling and a lot of other stuff people would consider 'compilated' and working on those was far less complex than some business logic in API's I have had to work upon.

So if the experienced developers writing Deno are using Rust for type safety etc to catch their mistakes, then why would you trust yourself to use a less strict lanaguage on a likely more complex project?

My guess: Deno would perform too slowly which would hurt the UX. It would also be harder to maintain than a language like Rust. And of course Rust doesn't need a runtime.
I think you nailed it!

If Deno wouldn't use itself because of reasons like this; then people should really think twice before using it to build anything server side.

Not everything is about performance. Deno lets developers be more efficient than Rust, and it is easier to hire developers that already knows TypeScript/Node.
How is Deno more efficient?
If you're building a application on top of PostgreSQL and GraphQL then there's no Rust equivalent to PostGraphile, which is a JS/TS lib.

If you're building on top of GCP services, there are official JS/TS libs but no official Rust libs.

If you're doing data science then the ecosystem of Python libraries (another interpreted language) will get you up and running much faster than Rust.

So yes, there are plenty of cases where using an interpreted language will be much more productive than limiting yourself to Rust.

They mean more efficient for the developer not the machine.
Because people want to write JS/TS and want a better runtime for it?
But not just the runtime, all the tooling including linters and document generators etc why are they not written using Deno then?
I'd chalk this up to the dev team having capacity with people who favour rust. Rather than some organisational or systemic choice.
Not a lot of dog fooding going on then!
99% of runtimes out there are not written in the target language.