Disclaimer
Don't panic. Node isn't going anywhere.
What is Deno?
From deno.land:
Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.
- Secure by default. No file, network, or environment access, unless explicitly enabled.
- Supports TypeScript out of the box.
- Ships only a single executable file.
- Has built-in utilities like a dependency inspector (deno info) and a code formatter (deno fmt).
- Has a set of reviewed (audited) standard modules that are guaranteed to work with Deno: deno.land/std
But why!?
From Ryan Dahl:
JavaScript has changed significantly since Node was designed in 2009. Notably:
- Promises / Async / Await
- ES Modules
- Typed Arrays
Node has problems:
- A poorly designed module system, with centralized distribution.
- Lots of legacy APIs that must be supported.
- Security
(These problems aren't unique to Node. Python and Ruby suffer similary)
Ryan Dahl's HolyJS talk
Installation
Using shell
curl -fsSL https://deno.land/x/install/install.sh | sh
Using homebrew
brew install deno
Getting Started
A sample http server
import { serve } from "https://deno.land/std@0.50.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
req.respond({ body: "Hello World\n" });
}
Blog post: https://deno.land/v1
Top comments (23)
I think this is the most concentrated hype on a new software thing I've seen in a long time.
π yes you all right, seems that many people in the community are aware of this
I get it though, it's just demonstrating a lot of attention to detail, running with the good stuff of node and getting rid of as much bad as possible.
Total hyper v show. I'd rather just learn Rust. Whats the point of using Deno when underneath is just plain old V8. I pity the Devs that fall for it.
Took me a couple of days to get the hang of Rust, and loving it so far. Highly highly recommended! Oh and read the initial few chapters of the book first, especially the one on borrowing. It'll help you out a lot later on.
Might be a dumb question, but what is this supposed to replace? What problems is this solving in the web world that's got everyone all hyped?
I'm not so close enough to Node lately to know the feeling, but my sense is that it's essentially "node, but better", which wouldn't be something everyone would take so seriously if it weren't created by the creator of node.
Also, node as a thing to me was always great idea, great opportunity, not-so-great ultimate development experience or outcomes.
I also get the sense that it's good timing in terms of the maturity of TypeScript.
I appreciate this response after seeing this acronym/name float around here and there but had no time to figure out what deno actually was.
I know that feeling all too well π
I'm still learning how to use Node anyway, so it makes sense that I wouldn't get it, but "Node but better" from the guy that made Node does sound pretty appealing.
Thanks for your thoughts!
Congrats!
Question. I'm still learning but my learning path put me on track to learn the MERN stack. Should I continue and additionally learn how to use Deno or learn Deno instead of Node?
Also, one of the books from the recent must read for js posts listed Eloquent JS, which covers Node. Was it a waste to buy (I wanted to also support the author) or still a great book to read regardless of Deno aiming to be better than Node?
Thanks!
You're on the right track :) Don't worry about it. Node isn't going anywhere!
Node is very stable.
Am I the only one having mixed feeling about this url dep ? I mean we say in Go that this is maybe the worst part of the language. It's cached and everything, but you can have some sort of package.json with
package_server
key and run your own package server. That's what happened in Java (your own artifactory) or in python for example.I am not a fan of this online requirement in order to download and run modules at run time. IMHO this alone is another SPOF, because if for some reasons Internet goes down, you are doomed. Maybe I got something wrong, but this is my impression. I guess that they are caching this in some
deno_modules
type of folder?Another problem that I see is that they are vetting modules personally, which is all great now at the start, but this approach doesn't scale. This is a future bottleneck and an opportunity to reject future modules because someone from this vetting team dislikes how someone writes their code. This will lead to fanboyism.
I'll stick with nodeJS and to be honest, I am tired from "never seen before / revolutionary" tech in front-end / back-end. Let them prove themselves before we all jump in ;)
Thatβs not how it works. During dev you give it permission to download your deps. Then you ship your deps folder with your app. So the prod version isnβt downloading anything.
Hmm guess I will try Deno instead of Node js now
Node... Deno... soon we can a have a "Done" language, maybe. Ok, but if i understood, Node and Deno are like "The Lion King 1994" and "The Lion King 2019" (?).
βοΈπLol, I'll stick with the cartoon anyday anytime.
well need another post to explain what is this exactly
He made a video explaining the reasoning of what he wanted to fix in node by creating deno
youtu.be/M3BM9TB-8yA
I'm constantly updating the post :)
That looks interesting. I heard about this before....
Very helpful article!
The cover image is absolutely pretty, lovely inclusion. A young lonely dino looking at a bleak landscape.