text stringlengths 0 2.02k |
|---|
So by default, when you run a Deno program, whether that's a local program on your computer or a remote program via an HTTP URL, it's given no access to the system. All it can do is compute; it cannot access your file system, it cannot open outbound connections... It can't do anything mischievous. It can calculate some... |
**Jerod Santo:** And you give it those privileges via command line flags, right? |
**Ryan Dahl:** Via command line flags. You can do allow all if you want a Node mode... \[laughter\] There's no privileges, there's no gating. We have allow write, to write to the filesystem. We have allow run, to run subprocesses. We have allow read to read the filesystem. We have allow plugin to load Rust plugins, whi... |
**Jerod Santo:** Is that something you can put in the file itself, or does it have to be a flag to the runtime? |
**Ryan Dahl:** \[32:13\] It has to be a flag. We are considering having a configuration file. We are really conservative about adopting new file formats. I was just talking about how we try to keep things as boilerplate-free as possible. So we don't want to force people to write a configuration file. We don't want the ... |
So for now they are command line flags... And they're pretty obvious and annoying, and that's kind of purposeful, because these are security things. They should be obvious and annoying. You should be very clear that you are allowing this system to run arbitrary sub-processes. Yeah, so via command line flags is how you ... |
**Adam Stacoviak:** How often are those flags being used by general applications you see being built? |
**Jerod Santo:** All the time. |
**Ryan Dahl:** All the time. I mean, it depends on what you're doing. Let's say you're writing a program like ESLint - this ESLint-like program doesn't need to make outbound network connections. It doesn't need to write to the disk. All it needs to do is read from the disk. So you would only enable the allow read in th... |
**Jerod Santo:** Yeah, so I was telling you during the break that I was writing this little script with Deno the other day, and basically it went out to the Slack API, got some data from there about members of our community, and then looped over -- I was trying to pick a random winner for a giveaway, from a certain cha... |
**Adam Stacoviak:** Node mode. |
**Jerod Santo:** Yeah, Node mode, please. |
**Ryan Dahl:** I mean, if you're the one who's writing it... |
**Jerod Santo:** Totally. |
**Ryan Dahl:** ...then you're pretty sure that it's going to be okay. |
**Jerod Santo:** Yeah, exactly. |
**Ryan Dahl:** The problem comes when you're running somebody else's code. |
**Jerod Santo:** Yeah, like I said, this was an inconvenience, but it's like a very explicitly, well-considered inconvenience that's like "Yes, we're doing this because the trade-off is completely worth it." |
**Adam Stacoviak:** This is a shift left kind of moment, where you're taking typically maybe security concerns that you might rather just say "deno run" or whatever the command is to run a Deno application. But you're kind of shifting left, saying "These are security concerns that Deno resolves and has control over" an... |
**Ryan Dahl:** Sure. I haven't heard the term shift left before. |
**Adam Stacoviak:** Shift left is whenever you take the security concerns, which if you take a product lifecycle, left to right, left being dev, iteration, right going to production... |
**Ryan Dahl:** I see. |
**Adam Stacoviak:** A shift left is you sometimes think about security further to the right, once it shipped, potentially. Shift left is a term used by security minds to take that security concern and shift it more left into dev land. |
**Ryan Dahl:** Yeah, I should mention that there is a new feature --prompt. Deno run --prompt. So if you don't wanna allow all -- the current behavior is if you hit one of these ops that's trying to access the file system and you don't have the correct allow flags, you get an exception, the process drops out, errors ou... |
**Jerod Santo:** \[36:24\] I like that. It sounds like a good compromise. Kind of shifting a little bit further right, but you're following the web browser's lead, where it's like "Are you sure you want to give this person access to your webcam?" And if you say yes, then it's on you. |
So security front and center. We've talked about packages and how that all stuff works, importing other people's code, we've talked about TypeScript... What are some other aspects of Deno that are cool and exciting? There's some tooling things, there's a formatter, there's some of these kind of developer experience thi... |
**Ryan Dahl:** Yeah, so there's a bunch of sub-commands in Deno, deno run being the most obvious one to run a script. But we're kind of taking this Go approach where we're just going to build in all the tooling for you, so that you don't need to bring in all this other third-party tooling. |
For example, we have a code formatter built into the system, so you can deno format your code. We have a linter built into the system. You can deno lint. We have a test runner - deno test - to run tests. We actually have all sorts of stuff in there. We have test coverage, we have a documentation generator, and we have ... |
Generally, Deno knows all about your source code, it knows all about your dependencies and what it's doing... And why not? We're distributing this executable; all of this stuff is written in Rust, and so it compiles down really tightly... |
So our formatter that you run is not Prettier. It's something called Deprint, and it's written in Rust, and it's like 100 times faster. And our linter is not ESLint, it's deno lint, and deno lint is written in Rust and is very fast. |
We have deno lsp, which allows VS Code to talk to Deno, and get tab completion, really nice editor interaction... So Deno can basically tell your editor documentation, all sorts of interesting interactions that Deno can help provide VS Code. |
**Jerod Santo:** That's all really cool stuff. How much of that stuff is informed or inspired by other languages? Are you a language aficionado? Do you watch what the Go folks are doing, what the Elixir folks are doing, what the Haskell folks...? Are you watching these different ecosystems and saying "Oh, there's a goo... |
**Ryan Dahl:** Absolutely. This was heavily inspired by Go. Not just in these various toolings, but all throughout the system. It's important to continually improve and take good ideas where you can get them. |
**Jerod Santo:** So the standard library is pretty fleshed out as well. I'm just wondering, where are the holes? Because Deno still -- it's at 1.0, but it's newer; it's not as mature. Is the ecosystem still waiting for large holes to be filled? I know you recently shipped HTTP/2, web server back-ends... So things that ... |
**Ryan Dahl:** Yes, that is still the situation. You know, things take time... I expect this will be worked out over time. I remember back in 2010 people would be like "How do I connect to MySQL with Node?" and I would turn red-faced... |
**Jerod Santo:** \[laughs\] You write a driver. |
**Ryan Dahl:** ...and apologise that I did not have a MySQL library yet... And they're like "But how is that going to happen?" and I said "I don't know how that's going to happen. I just hope that that is solved at some point." And it's embarrassing to even think that that was a concern, because that was totally not a ... |
\[40:20\] You know, Deno and Node are very similar systems. They're both built on V8, they're both JavaScript... They're pretty similar. The differences are relatively superficial. I mentioned this Deno.land/standardlibrary, the Node compatibility layer... This is a work in progress. If you go check it out, there's som... |
But there's still a lot of work to do... You mentioned this HTTP/2 web server - up until recently, Deno was using a web server written in TypeScript that was a loose port of Go's web server. It's built on top of TCP sockets and TLS sockets. It was a nice HTTP 1.1 server, but had some problems in that it didn't support ... |
What we'd really like to do - I've mentioned this earlier, about linking in native code libraries using Rust... Rust obviously has a web server already implemented. In fact, Deno already has that web server in its binary somewhere, deep inside of it. What we really wanna do is just allow people to call from JavaScript ... |
**Break:** \[42:39\] |
**Adam Stacoviak:** Ryan, back in March 29th you announced the Deno company, and obviously, you've got a great new start to what you began with Node. A lot of new beginnings here, a lot of wrongs made right... And to put behind that a company. So why are you on this path? I suppose more than ten years - Node 2009, now ... |
**Ryan Dahl:** Programming languages are important. The world is built on software, and of the programming languages, dynamic programming languages are, I would say, what most people are interacting with day-to-day. But most business needs are best expressed in Ruby on Rails, or Node/JavaScript, or Python, because to b... |
I work on this problem because I think it's very empowering to be able to take a system like Node or Deno or Perl or Ruby and just start programming really fast. I got started with Perl myself, and I don't know if you guys feel this way, but there's that feeling of power when you first really grok the language and you ... |
Yeah, I just don't think there's enough effort being -- obviously, I'm talking a lot about Rust, Go... These programming languages are very important, but they're targeted at different use cases. I love Rust. I would never start a new C++ project, as I said, but I'm not going to use that to rename a bunch of files on m... |
Of the dynamic programming languages, JavaScript is the biggest; V8 is the fastest VM in JavaScript. It's the fastest dynamic language VM, period... And JavaScript has this industrial standardization process with it. It's tied to the web, so if you believe that the web is going to be here in a couple of years, JavaScri... |
So if you're going to choose one of these languages to invest in and build on, I think it's pretty clear that JavaScript is the language ultimately that we're going to be using. |
I think once you play around with this stuff a bit, and you learn Python, and you learn Ruby, and you learn JavaScript and Perl, you get the feeling that they're pretty much the same thing. There's different syntax here, there's different ways to do different things, but the are very similar systems, essentially with d... |
**Adam Stacoviak:** \[48:22\] Yeah. Bet on JavaScript, basically. |
**Ryan Dahl:** Bet on JavaScript. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.