DEV Community

Cover image for Deno 1.0 is out!
Robert
Robert

Posted on • Updated on

Deno 1.0 is out!

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
Enter fullscreen mode Exit fullscreen mode

Using homebrew

brew install deno
Enter fullscreen mode Exit fullscreen mode

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" });
}
Enter fullscreen mode Exit fullscreen mode

Blog post: https://deno.land/v1

Top comments (23)

Collapse
 
ben profile image
Ben Halpern

I think this is the most concentrated hype on a new software thing I've seen in a long time.

Collapse
 
omenlog profile image
Omar E. Lopez

πŸ˜‚ yes you all right, seems that many people in the community are aware of this

Collapse
 
ben profile image
Ben Halpern

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.

Collapse
 
rattler18 profile image
OEM

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.

Collapse
 
bsodmike profile image
Michael de Silva

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.

Collapse
 
jackharner profile image
Jack Harner πŸš€

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?

Collapse
 
ben profile image
Ben Halpern

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.

Collapse
 
jenc profile image
Jen Chan

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.

Thread Thread
 
ben profile image
Ben Halpern

I know that feeling all too well πŸ˜„

Collapse
 
jackharner profile image
Jack Harner πŸš€

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!

Collapse
 
emtr0 profile image
emTr0

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!

Collapse
 
wobsoriano profile image
Robert • Edited

You're on the right track :) Don't worry about it. Node isn't going anywhere!

Node is very stable.

Collapse
 
desgrangeremi profile image
RΓ©mi Desgrange

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.

Collapse
 
vlasterx profile image
Vladimir JovanoviΔ‡ • Edited

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.

bad feeling

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 ;)

Collapse
 
ejsmith profile image
Eric J. Smith

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.

Collapse
 
delta456 profile image
Swastik Baranwal

Hmm guess I will try Deno instead of Node js now

Collapse
 
felipperegazio profile image
Felippe Regazio

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" (?).

Collapse
 
rattler18 profile image
OEM

✌️😁Lol, I'll stick with the cartoon anyday anytime.

Collapse
 
leandroruel profile image
Leandro RR

well need another post to explain what is this exactly

Collapse
 
spirix3 profile image
Nick Muoh

He made a video explaining the reasoning of what he wanted to fix in node by creating deno
youtu.be/M3BM9TB-8yA

Collapse
 
wobsoriano profile image
Robert

I'm constantly updating the post :)

Collapse
 
bernardbaker profile image
Bernard Baker

That looks interesting. I heard about this before....

Collapse
 
athul7744 profile image
Athul Anil Kumar

Very helpful article!
The cover image is absolutely pretty, lovely inclusion. A young lonely dino looking at a bleak landscape.