Earlier quoted context omitted.
That's a pretty terrible example. No way do you want temporary directories to be created just by loading a class. That violates all sorts of best practices. There's a better example here: https://v8.dev/features/class-static-initializer-blocks You could also use it for initialising generated constants.
What’s the difference from declaring the entropy pool in the example outside the class, in the module scope? Still private, still a single shared value.
Deno 1.14
101–110 of 111 posts
Re: Deno 1.14
#102Earlier quoted context omitted.
One of Deno's value props is to have a tighter and more explicit trust model. And this is not a obscure need. There are cloud providers who let you run JS on a specialized and restricted API. However, there is nothing stopping you from using Node or integrating V8 and go wild with it! (In fact I would argue that this is a solid strategy for some types of projects, where you can get the best of both (static/dynamic) w…
> And this is not a obscure need. There are cloud providers who let you run JS on a specialized and restricted API. Sounds rather obscure actually. Still somewhat confused why this would be useful in Deno. Looks like it's just a repeat of what happened with Java's SecurityManager, which is now being deprecated and removed.
It is how cloudflare workers work
Re: Deno 1.14
#103I tried out Deno last weekend for a fun little hack project (syncing a local Markdown file to a formatted Google Doc), and it was awesome. Writing TypeScript code for Deno feels a lot like writing Go (which is a very good thing to me): - opinionated build/fmt/deps - well-designed stdlib - no need for scaffolding files (.eslintrc, babel.config.js, jest.config.js, mocha.opts, etc.) If that sounds good to you, try Deno!
Is it fast to start up? I have been using node with ts-node, and it takes a couple of seconds before it can start executing the actual code.
Re: Deno 1.14
#104Earlier quoted context omitted.
That would make REPL difficult to use, since you would need to know in advance what you want to do to pass the right permission flags. REPL is particularly useful when trying out things "live" as they come into your mind.
A common use case for a repl is to copy and paste code into it, or to give code to someone and have them run it. It's nice to not have to think about what the code could do to the system before running it.
Otherwise you might want to check out piping support https://github.com/denoland/deno/pull/6130 Something like `echo "yourcodehere" | deno run -`
Re: Deno 1.14
#105Re: Deno 1.14
#106It's always worth reading the Deno release notes even if you're not using Deno because it's such a fascinating collection of interesting ideas. I always learn something new from them. In this case it was the existence of the URLPattern web API: https://pr8734.content.dev.mdn.mozit.cloud/en-US/docs/Web/AP... Also that Mutual TLS is an alternative term for client authentication.
Mutual TLS is where both the server and the client must present certificates and both must verify the others' certificate in order for them to communicate. It's useful for backend server to server communications mainly.
Re: Deno 1.14
#107Re: Deno 1.14
#108I tried out Deno last weekend for a fun little hack project (syncing a local Markdown file to a formatted Google Doc), and it was awesome. Writing TypeScript code for Deno feels a lot like writing Go (which is a very good thing to me): - opinionated build/fmt/deps - well-designed stdlib - no need for scaffolding files (.eslintrc, babel.config.js, jest.config.js, mocha.opts, etc.) If that sounds good to you, try Deno!
Re: Deno 1.14
#109Does anyone know if Deno has undergone a security audit yet? I'm interested in using it as a sandbox to run user-submitted JS, and I know its permission model is powerful, but I don't know if it is formally certified (if that's even a thing) and if you can prove that there can't be some exploit that can be used to break out of the sandbox.
If you’re thinking of V8 isolates, I believe Cloudflare was running their edge compute product using that.
Re: Deno 1.14
#110Earlier quoted context omitted.
> And this is not a obscure need. There are cloud providers who let you run JS on a specialized and restricted API. Sounds rather obscure actually. Still somewhat confused why this would be useful in Deno. Looks like it's just a repeat of what happened with Java's SecurityManager, which is now being deprecated and removed.
> Sounds rather obscure actually. It is how cloudflare workers work