Deno, a new way to JavaScript. Ryan Dahl. JS Fest 2019 Spring
Vložit
- čas přidán 27. 07. 2024
- The talk from JS Fest conference in Kyiv, Ukraine.
From async-await to ArrayBuffers, the JavaScript language has changes significantly in the decade since Node.js was designed. Deno takes advantage of these developments and incorporate lessons learned in the development of Node to provide a new JavaScript platform built on V8 and Rust. This talk will teach the audience how to get started with Deno.
Presentation: bit.ly/2U0lQmZ
Fb: / jsfestua
Website: jsfest.com.ua/
Upcoming JS Conference:
JS Fest 2020 - 30-31st of October, Kyiv, Ukraine
Details and tickets: bit.ly/3bBxiiK
It's happening! Deno from last year's talk is coming to life!
skip to 3:04, audio gets fixed. before has a lot of noise.
TL;DW is the foundation of Deno is V8, Rust, Tokio and TypeScript. Tokio is a rust library that acts as the "event loop"
thank god.
14:27 "I'm convinced that TypeScript is the next version of JavaScript". Couldn't agree more. Built in Rust. Love It!
Okay, time to dumb javascript and learn typescript
Node is bad for Heavy CPU stuff, I hope Rust combine with [Deno] helps, why he did not use Golang ?
@@kenyadorcelus917 I like your question because I wonder myself about choosing between GoLang and Rust for different problems. I can only hazard a guess here but my experience is that Rust provides better tooling at compile time, through the borrow checker, for getting the code right - by which I mean completely avoiding nulls etc. Additionally, both GoLang and Rust have techniques for dealing with race conditions, but Rust's approach again works at compile time whereas GoLang tools don't kick in until the program is run/sampled. An additional reason could be that the absence of GC in Rust provides more predictable heap resource usage. I'll go out on a limb here and say that I think many of the GoLang uses in Kubernetes etc might have been done in Rust if it had arrived earlier. Don't get me wrong, I love GoLang, but I think Rust will have the edge when performance and quality trump development speed. There are some other features like Generics and Pattern matching that I personally like in Rust, but aren't there (yet or ever by design?) in GoLang. Would be great to hear others thoughts on this.
Rust for performance reasons imo, golang isn't exactly the best language to create a compiler and language, you need something closer to the metal which rust delivers relatively safe
@@kenyadorcelus917 , yes and no. The Node architecture makes it very easy to queue cpu intensive tasks and run them on a worker thread. That definitely scales better than a native but naive approach. Also Node has a very pleasent FFI and of course WASM.
And it might be a bad idea to implement a language that relies on gc with a language that itself relies on gc. Also Go doesn't give you generic programming, modern programming constructs (like for each loops) or direct access to threads or memory. You are always reliant on the runtime.
I deno about all this
👏
I'm sold: "When you depend on something in Deno core, your dependency graph terminates"
I always knew that something is wrong with Node being really not quite js.
Brilliant talk, thanks Ryan! I'm sold.
Deno is an anagram for Node (:
Yeah just noticed that too lol
It also sorts the letters alphabetically.
🤯
@@PhilippLenssen oh my god so it’s basically “node”.sort()…
(Well, probably also needs a split and join, but still)
46:30 "You can be heroes, maybe, just for one day." And no one bats an eye...
ha i chuckled at that but im 50
Criminal. If I was there you'd hear me dying in the audience
I groaned at that but I'm 50
Not many fans of Bowie here in Ukraine, but I definitely smiled at that moment :)
I am so excited for this project. Maybe (probably) I have Stockholm syndrome, but I love Typescript. I love that this feels like the next step of Node... Ryan has explicitly addressed many of the major problems while still keeping what he got right. Deno ❤️.
Most successful libraries are already written in TS or at least have correct type definitions. So what would change?
Like the concept a lot. Being able to optionally use typescript or javascript seems good for protyping then wanting to use a type system
Ryan Dahl - the superstar in JS world!
You should have comenetd more about all the amazing and convenient implications using the es6 import system. Looking forward to this proyect, it really is a right eveolution from node proy
Great talk!!!
i love that he's laughing at his own joke before he even says it at 46:25
Awesome! Thanks!
@25:11 "So you were wrong! Guy over there... hahahah :')
wow this is lovely
I hope it will not be experimental forever, but a new standard technology for server development.
There needs to be read and write access by glob patterns and network access by port ranges.
Ryan u are besttt :) And Rust + Typescript is always besttttt.
Ryan is a genius. I'd love to code with him someday.
Really interesting..
At 5:00 it lists the reason why Deno was developped stating that Promises / Async / Await, etc. was not supported in Node in 2009. Maybe not but Node does support those now in 2019 so again, why?
Typescript is good, it solves a problem I don't have.
wow this beach goes everywhere.
No one: What regrets do you have making Node?
Ryan Dahl: Yes
This is exactly what I am looking for.
I want to quickly prototype tooling scripts for automation purposes using JS. Node requires this bulky boilerplate project structure for anything useful to happen (using a single dependency in Node requires all that), which I don't like. Node is OK for a company product that has already commited to Node for a large scale project that isn't intended to be rewritten for a long time, but I'd rather have less stuff when bulding and/or prototyping tooling (and anything else ftm), which Deno allows for. It also seems like a lot of thought has been put into the syntax of Deno, which makes it more accessible and concise for this purpose as opposed to something like Python (opiniated of course).
I also personally love the idea of scripting using JS. Its template strings, promises + async/await, undefined type, falsy truthy and nullish evaluation in conditionals, object literals + prototypes, functional factory and constructor functions, higher order array methods (forEach, map, reduce, etc.), and more make it amazing for getting things done intuitively. Programming is heavily reliant on being able to quickly get your ideas into the form of working code, i.e prototyping, as well as for others to be able to make sense of that code. JS is amazing for this purpose.
I believe the success of Deno for things that Node is used for comes down to the formation of a healthy and vibrant community to build and maintain all the dependencies that people would want to use in their projects. With that in place Deno can, and probably will, eventually be the defacto standard for building backend, and other, tech with JS.
WHy not just code in RUST?
deno is french verlan for node
Does Deno use bigint where 64bit integers are required instead of number (which is used by Node)?
Why are some people act like they are forced to use every new JS framework or runtime ?
Short answer: they're stupid.
Long answer: they're stupid. Unable to aknowledge the flaws of the current Node ecosystem and the benefits that Deno brings. That doesn't mean, that you must learn TS instead of JS. To learn TS, is to learn JS. To push for Deno, is to push for greater security and sanity of best practices. I don't know for client engineers, but those who use Node as a server or other security sensitive areas, Deno is what we wanted for a long time.
Moslty it's because corporate said so.
@@lukasbobinas1607 , TS doesn't enforce it's type system, which isn't sound anyway. So it doesn't guarantee for anything! For whom type safety is an absolute requirement should use Java or Rust.
omg, how ryan dahl using vim feels like a whole new world
The console is quite a bit out of sync with him talking
But wait, what if I deny read write access, but the package just forks some process and that process accesses file system?
run subprocesses requires another flag `--allow-run`
3:01 - oh thanks for that
2:57 finally AI entered chat, and fixed the noise!
First question I ask myself ... why are very random non related functions all in the "Deno" namespace.
How deno handle versioning for external modules?
@version.number on the import URL itself
29:15 how's it working when both his hands are AFK?
he typed with legs
there is delay between screen and cam
Latency
21:20 Any GO programmers who said Node was dead?
This is for you :)
how the hell he is using macOS on thinkpad
probably a hackintosh. here's the guides www.tonymacx86.com/forums/mojave-laptop-guides.197/
It's probably just a Thinkpad skined MacBook, the little red dot of 'i' is not lighting and the curve of the display is similar to MacBook.
@@jo3y585 I think you're right
exactly, i came to see comments to find out 🤣🤣🤣
@G1K777 LOL
8:10 yes, it is time, all hail the future king, WASM
what's the challenge of adding --allow-read, allow-write, etc flags to node?
Sure it wouldn't solve 100% of the challenges he's talking about especially for node_modules but if its possible than it is certainly a step in the right direction.
Backwards compatibility. You'd have to remove this access by default, and there are thousands and thousands of programs depending on being able to run `node whatever.js`, in npm scripts, and npm modules... npm-installable CLIs... The whole ecosystem is built around the assumption that you can access the filesystem and everything any time, even in npm install hooks for example.
@@IsaiahOdhner True. It's too late for 'secure out of the box' for Node.
But a workaround for that would be introducing a 'safe' mode for Node through an explicit flag. So similar to the introduced for newer HTML version or JavaScript's "use strict";. You could add a cli option, so start with something like `node --secure server.js` (and then of course switch over to `node --secure --allow-net server.js`. Funny that you'd have flags canceling each other out. Though adding an `--allow-x` flag could imply that the `--secure` flag is also there, and all other `allow-x's would need to be explicit.
If they do I wonder what they'll call the old 'insecure mode', as 'quircks mode' (HTML) and 'sloppy mode' (JS) are really funny names 😀. However in a way Ryan already wrote his "Node; the nice parts" with DeNo.
BTW: I think similarly they could add typescript support to Node, with JIT or AOT compilation (and tree-shaking?) with a --ts flag. Though running `node server.ts` might choose to imply the --ts flag based on the .ts extension since that won't really cause backwards compatiblity problems.
At 18:44, after setting read access to "allow always", one would expect that we don't get the permission access prompt a second time?
Different processes.
3:00 Kreygasm
I find it interesting that he says its POSIX and unixy and then there is this Deno.copy that reverses this philosophy upside down.
Typically in unix mv, cp commands use WHAT WHERE, paradigm. Deno.copy uses WHERE WHAT. I already know I'll be making a ton of mistakes with this if I ever move to deno. Other than that its improvement on Node on every level.
The year 2029 Ryan Dahl - Wow you are many people here... Ok so, JS has evolved, and it's new subset - Strictscript by Amazon is so great, and they do such a great job with it. Now I'm not saying that you should stop using Deno or Node - they will be used forever, although, I do believe that Strictscript is the future of javascript so - I've made this new tool "Edon" - it runs Strictscrip, written in Crystal. It's just like node and deno but much more "webby" - let's write a dog.js program with it and I hope you will see it's potential :3
next lang will be "Done"
22:35 I think he recorded the coding part before hand
i think its just delay
Good talk. But it's a bit weird Ryan didn't mention other alternatives like Luvit luvit.io
Javascript just can't stay still can it?
my thought exactly
No. It's used out of initial context.
imagine this is a modern Js funtion: {in React} => few months later > hahaha
This isn't JS, it's just a way to use JS. That's the main thing that people forgot a few years ago with the release fatigue was really bad . . . that just because something came out doesn't mean you have to use it at all, let alone even pay attention to it.
If it's not useful for you, then forget about it and keep on truckin.
wtf is he on a hackintosh?
probably. the patches and keks have gotten pretty good for Dells and ThinkPads.
Deno = superset(Node)
How long is this one going to last before "yet-anudder" framework supercedes this? 1 month? 2 months perhaps? Think I'll stick with vanilla JS.
TypeScript is not a framework and it is extremely useful.
"console log action" 😂
0:28
He created Node.js - and still works ? Wow...
What else do you want to do? :)
@@royhonders Good one.
He did not expect NodeJs to go that big.
Every day we are further away from John McCarthy's light.
i'd say we came closer to each more and more.
More air quotes please. I only counted like 500.
Nice talk Ryan. Seems like a neat project. I did kind of wonder though why you don't just use Perl 6 for scripting.
Lol
deno is so cute >////< Can I see it's full-body shot?
why
As always, should you or any of your devops team be caught or jammed using deno, the cto will disavow any knowledge of your actions.
While I'd like to use Rust as a scripting language embedded in another app possibly with a REPL, Rusti seems to have had problems lately. Maybe cling and C++?
However, TypeScript isn't the answer. The type of things that Deno targets is well handled by cargo-script, which is just a way to write a Rust program with it's cargo deps listed in the same file. It has a .crs extention for Windows and a #! first line for *nix.
Didn't get it. Why should deno control the access of a file on my system? That's what an OS is made for.
I suppose you'd also want every website you visit to have free access to every file on your system? Because that's what you're asking for when you say that.
Here we go again, another shinny object...
abi ooo omo iya mi
Is he using MacOS on a ThinkPad ? :) WTF? Must be a cover or smth
no
I thought the same :/
More javascript :(
And here we go again, the endless JS "churn" continues. I'm jumping off the merry-go-round this time, so long suckers!
How are you guys not excited for this project lol
I don't really understand what the problem with node_modules is. Where else would you organize dependencies? It is what enables repeatable builds, native dependencies and caching, all in one place. Why would I want to paste some URLs directly into my program?
But NPM can resolve any git repository. Where is that not "webby"? Why would you split the ecosystem? That's what's so great about NPM.
6:54 What is it with SSH keys? Every webserver has access to them. I don't quite follow. What security do I gain with some special flags?
Built in TypeScript is a bad idea. TypeScript works so fine because it decouples modern JavaScript from the implemented standard in Browsers or in Node. So I can downlevel in any way without compromise. With built in TypeScript you would render that advantage useless. And after all, TypeScript doesn't enforce or guarantee anything. It is wonderful as a compile time construct, but why would you built it into a runtime?
What is it with you and "webby"? What is wrong with __filename? Python denotes special functions and constants with two underscores and it is a good convention.
Well, nice thing that typed arrays can make sockets more efficient, but why not letting socket.write take a string and deal with encoding internally? I think that is a low-level implementation detail.
While Promise based APIs are quite nice, I would have loved to see the new stream API. I hope to see more ReactiveX. And of course WASM. What are the ideas around multi-threading and FFI?
i.redd.it/tfugj4n3l6ez.png
Ryan creates Node in 2009, 10 years later he regrets and then starts working on Deno, in 2029 will probably be the same story.
Matheus Seabra Next will be ‘Done’.
Introducing Nedo
lets stop JS upgradation with Deno :)
Deno.copy to print the content of a file, seems really weird to me (as node dev). Prefer node's fs.readFile and console.log. Sorry, but Deno didn't impressed me at all. Ryan said it's built on typescript, but all his examples were just vanilla js. So the differences to nodejs are so little, specially when you're using typescript already. The only significant change are es modules with ability to resolve modules from url. Not sure, if this is enough to convince me to switch to Deno in the future.
mayo2001 for sure you can also do readFile + console.log in Deno (with very similar API). The copy thing is kind of more Unix-y and Golang like (io.Copy). I agree that given the current stage of development there might not be motivations to switch, and many of the significant changes in design is not yet visible to the user space (e.g. message passing). So treat it as a technical preview for now as more interesting changes coming soon
This guy talks just like Elon Musk and it makes me breathe in a weird way
Oh please not another framework or meta language.
This is another (better) runtime for your existing .js programs lol
NO MORE CMD prompts. I have 50 CLIs and frameworks that all want to pile commands and their own syntax on me. We need web interfaces or GUIs in an app to configure things. You can still add a repl or config file but there needs to be a visual way to add file names and locations.
I can't remember 30,000 commands and their syntax. Just CSS/HTML alone has over 500 tags plus their properties and values. PHP has several thousand functions that you might use several hundred of on any given day. Same with JS. Auto complete only works when you type the first few letters but if you don't know that you are screwed and are pulling out the documentation.
If each system outside of direct code used a GUI it would reduce the number of commands I need to use by 80%.
if typescript is new version of javascript, the future is grim, hate java inspired devs typing everything, crippling my ideas, workflow and making me waste time on typing everything >< how about dev's concentrate on proper work process and start writing unit/integration tests instead? do you really need your compiler to constantly hold your hand?
don't get me wrong though, deno focus on security is great, did it really needed new project though? why not convert actual node with every version piece by piece or make node v2, why constantly rewrite everything?
Valid JavaScript is by definition valid TypeScript.
Types are optional.
That's the whole idea.
@@matthijshebly not sure you get it... types are useless, you gain nothing from them except false sense of security, it's not 1950 anymore, be professional and test your code instead, time spent on tests is not wasted, but it is wasted on typing.
Okay you're not a programmer.
Got it.
@@matthijshebly i work for google, over a decade of experience, nice try.
@@efreitorhabibulin238
Well good for you.
If you really work for Google, you should probably be aware that TypeScript doesn't force you to use types.
Deno is a flop
he's a weird talker
nothing weird about it
Good effort. But in terms of performance and scalability, it is miles behind Node.js, and considering that its community is also tiny compared to that of Node.js, it will never catch up.
for now ... but nodejs have the worst error handler because is build from c++, but with rust will be better, but I agree must be a lot accept from the community to create a better runtime than node, we can't judge the runtime with nodejs in mind, node has 10 years and deno, have what? 3 months? (of course haave more, but lets to talk when they release de beta).
Design improvements always have opportunities to get traction. Deno, by design, will be a huge improvement over NodeJS. Anything that alleviates node_modules and dependencies pain is a net gain for the JS community.
Almost makes me sick. Ya cool great. Explore. But JavaScript is so forever about the new kid. Just stand still for a while jeez