Live data from Hacker News

A Secure Runtime for JavaScript and TypeScript Built with V8, Rust, and Tokio

deno.land

61–68 of 68 posts

Re: A Secure Runtime for JavaScript and TypeScript Built with V8, Rust, and Tokio

#61
post #20

Earlier quoted context omitted.

It is very interesting although I didn't really understand the 'security' part. The motivation seems to be twofold - some bad things have happened because of compromised npm packages and v8 happens to have a robust sandbox. This sounds like a solution looking for a vaguely defined problem. The illustrative example he gives is 'malicious linter'. Is malicious linter that important a threat?

In the example the linter itself is not malicious, but used to deliver a malicious program that can have unrestricted filesystem access. Not vague at all, see recent news on the ‘event-stream’ package being used to steal cryptocurrency wallets.

The 'vague' part is not that it doesn't happen - see the comment you are replying to.

Re: A Secure Runtime for JavaScript and TypeScript Built with V8, Rust, and Tokio

#62
post #36

For the inevitably "what differentiates this from node?" Single executable Allows imports from url File system & network Sandboxing is controlled with flags Dies on uncaught errors https://deno.land/manual.html#introduction

>Dies on uncaught errors how can JS programmers deal with this?

I would imagine you have a watchdog of some sort (perhaps a special URL) and have something probe that every 15-60 seconds etc to see if it is up, if it does not respond then spin up a new instance and kill the failed instance.

Cattle not pets!

Re: A Secure Runtime for JavaScript and TypeScript Built with V8, Rust, and Tokio

#63
post #30

Earlier quoted context omitted.

Sure but logic doesn't exist in a vacuum so in most cases you are going to import / export your input data or your results to the filesystem or through the network. I actually suggested a more granular, per-module approach to this during the Node Forward and IO.js debacle years ago: https://github.com/node-forward/discussions/issues/14 At the time it was deemed to difficult to implement in Node.js after the fact, whi…

It is actually more interesting about the definition of “per module”, because technically every single file is its very own module from the view of V8, and is reinforced in Deno since we are trying to be web compatible, so there is not even a package.json-like construct for you to identify the “root” of any library, more so as there is no more index.js magical resolution

Could force all side effects to be called from the main module.

Re: A Secure Runtime for JavaScript and TypeScript Built with V8, Rust, and Tokio

#64
post #10

As a contributor to Deno, I am actually quite surprised that this got resurfaced on Hacker news after the hype June last year. That being said, I suggest checking out this video (recorded this April) for updated information about Deno, since things have changed quite a bit since the initial announcement: https://youtu.be/z6JRlx5NC9E (Edit: fixed link, posted the wrong one. Why would YouTube think I want to share ads.…

Curious about deno's development stage: can the brave already run it in production, or there are probably too many breaking changes in the pipe that it's better to wait?

Check out the benchmarks. I'm pretty sure normal usage (aka actual HTTP server, not specialized use cases just for benchmarks) is quite a bit slower than node.js

Re: A Secure Runtime for JavaScript and TypeScript Built with V8, Rust, and Tokio

#65
post #38

Earlier quoted context omitted.

It was rhetorical and meant to be facetious.

on node, this can actually be very difficult or even impossible if using 3rd party libraries. For example, some node internals like networking require the invoker to attach to some obscure .on("error") event to avoid uncaught errors. and a lot of the time these 3rd parties are not aware of it. I'm all for deno being built from the ground up to properly crash on uncaught errors. Silent ignoring is a really stupid deci…

Yeah, I'm a huge fan of erroring out properly. It makes it much easier to find problems before they cost money.

I think the erlang/elixir model of fail fast and try to restart is the best for availability.

Re: A Secure Runtime for JavaScript and TypeScript Built with V8, Rust, and Tokio

#67
post #58

Earlier quoted context omitted.

on node, this can actually be very difficult or even impossible if using 3rd party libraries. For example, some node internals like networking require the invoker to attach to some obscure .on("error") event to avoid uncaught errors. and a lot of the time these 3rd parties are not aware of it. I'm all for deno being built from the ground up to properly crash on uncaught errors. Silent ignoring is a really stupid deci…

I never understood why this is necessary. Using promises means you get to use try-with-resources style construct for handling non-memory resources safely. As such you no longer need to crash on uncaught errors, except errors pertaining to resource disposal.

i think the reason is that, in my example of networking, the network i/o is an "interupt" kind of event, that is triggered outside of normal execution. like if there's a socket timeout.

probably didn't have to be designed this way, but it was designed pre-promises and I guess they are lothe to change it.

Re: A Secure Runtime for JavaScript and TypeScript Built with V8, Rust, and Tokio

#68
post #55

Earlier quoted context omitted.

It is actually more interesting about the definition of “per module”, because technically every single file is its very own module from the view of V8, and is reinforced in Deno since we are trying to be web compatible, so there is not even a package.json-like construct for you to identify the “root” of any library, more so as there is no more index.js magical resolution

I'm really sad that I lost my gist on this, but I was working on a system in Node.js for defining the capabilities of modules in an es module graph (as you suggest) where there might not be defined package boundaries. The implementation complexity (required changes to upstream V8) resulted in us going with node policies as they are today. I don't remember the exact API, but basically an es module graph is a directed…

This looks interesting. How did you lose the gist? You just can't find it on https://gist.github.com/?
Post reply on HN