11 ms·
Deno v1.8 – support for WebGPU, private modules, Intl, and much more
- christophilus 6y agoI really want to use Deno, but until it's got a decent solution for cryptography, it seems as if encrypted session cookies are a no go, which makes a lot of my use cases a no go.
- lucacasonato 6y agoWe are hoping to ship WebCrypto support in 1.9, in 6 weeks. That should do most general purpose crypto stuff pretty well.
- chovybizzass 6y agono xml library either.
- afavour 6y agoWhy not make an external module for that? I don't see why it would need to be integrated into the runtime.
- dopidop 6y agoIndeed, unless it’s core in own the runtime store state to manipulate xml it’s seems like something that should be a user module
- stjohnswarts 6y agoThis is the best idea for XML. XML is big monster so to include it in the core might not be the right thing.
- jdxcode 6y agoI used https://github.com/nekobato/deno-xml-parser https://github.com/nekobato/deno-xml-parser which worked fine for my use-case. It's 1 TS file with no dependencies.
- tedk-42 6y agoI doubt it's worth writing this into the core of Deno to support a dying markup language.
- aetherspawn 6y agoMost of the web is XML-like (XHTML, Sitemaps, Manifests, RSS etc). It's not going anywhere any time soon. Denying XML support may as well be like denying JSON support at this point.
- crowlKats 6y agoFor people seeking a solution, one can use deno_dom, which implements various DOM related APIs, including DOMParser, which lets you parse XML
- sarak12070 6y ago28% discount on Manual Coffee Bean Grinder https://topsaleproductsonline.blogspot.com/2021/03/28-discount-on-manual-coffee-bean.html https://topsaleproductsonline.blogspot.com/2021/03/28-discou...
- modeless 6y agoWow, WebGPU support is really cool. Graphics is usually an afterthought in programming language runtimes, which is crazy when you consider that most devices these days have a GPU which is physically larger and has far more raw compute power than the CPU. I understand why. The extremely proprietary and platform specific nature of graphics APIs and hardware makes it hard. WebGPU is a good choice for portability.
- coding_lobster 6y agoI was under the impression that Deno is a runtime mostly intended for the server environment which is probably an area where GPU presence isn't generally as strong as on other types of devices outside of the applications that specifically need it. I could be wrong of course about anything or everything.
- dexwiz 6y agoWebGPU is an abstraction over classic graphics and newer compute APIs.
- pocketgrok 6y agoNot necessarily. Ryan has said a major motivation for creating deno was to let JS compete with Python for local scripting and ML.
- dexwiz 6y agoLooks like they are using wgpu, which is the main (only?) implementation of WebGPU. Seems like WebGPU will work because everyone is going to ship the same shim (wgpu) over the top of proprietary APIs.
- tyingq 6y agoLooks like Cloudflare isn't happy about this url: https://deno.land/posts/v1.8/webgpu_triangle.png https://deno.land/posts/v1.8/webgpu_triangle.png
- mmastrac 6y agoI wonder if they were APNG animations. Other than that, it doesn't seem like it should have triggered any other rule violations.
- lights0123 6y agoIt's their restrictions on non-HTML bandwidth usage. All images on the site are blocked like that: https://deno.land/images/icons/apple-touch-icon-180x180.png https://deno.land/images/icons/apple-touch-icon-180x180.png
- searchableguy 6y agoif anyone from cloudflare is reading this thread, please reach out to luca on twitter: https://twitter.com/lcasdev/status/1366938508875726851 https://twitter.com/lcasdev/status/1366938508875726851 This is breaking all the code which relies on deno.land/std and deno.land/x registries too. In the meantime, you can rely on other module registries or cdns: 1. https://nest.land/ https://nest.land/ 2. https://www.skypack.dev/ https://www.skypack.dev/ 3. https://esm.sh/ https://esm.sh/ You can also use raw github links but don't do that in production.
- tasogare 6y agoGood illustration of why relying exclusively on code being online (external repositories, code on github, hosted code like this) to make a project compile is a bad idea.
- gabrielizaias 6y agoDeno does have a local cache for this exact reason.
- barosl 6y agoWow, the `Deno.permissions` API is a great idea! Why haven't I thought of this? It sounds like a natural extension to what browsers are already capable of. It would make it very convenient to grant permissions to remote scripts without knowing the exact permissions they require beforehand.
- rajangdavis 6y agoAsking out loud, but is anyone aware of a way to build Ruby on Rails assets with Deno in place of yarn and node? The use case is to be able to leverage ES6/Typescript but have security built into the assets management. I'm not unhappy with the sprockets pipeline, but I would like to move forward with a modern assets pipeline without having to think too hard about the security implications of using yarn and node.
- qbasic_forever 6y agoMaybe esbuild can help? It's a go-based bundler that does typescript, es6, etc. and a lot more. https://github.com/evanw/esbuild https://github.com/evanw/esbuild It's still pretty well integrated into the npm world and distributed as a node package though, so there might be some issues.
- rajangdavis 6y agoThanks, I'll take a look, there might be something to look at to get something going.
- e1g 6y agoesbuild is a "bundler" and can replace webpack/rollup, but you still need to use yarn/npm to install all dependencies exactly the same as you do now. If your concern is primarily security-driven, esbuild is not to the topic. This applies to all other bundlers like Snowpack and Vite etc. As for migrating to Deno: you probably will not be able to do this because most NPM packages will not run in Deno out of the box. Your build pipeline almost certainly relies on libraries like gulp/sass/globby, and those projects will need to be ported first (or made compatible by their authors).
- searchableguy 6y agoAny modules on npm for web may work with minimal to no changes. You will need to convert them to esm. There are cdns which provide automatic conversion. 1. https://esm.sh https://esm.sh 2. https://skypack.dev https://skypack.dev Deno provides built in bundler. It is low level but there are third party packages built on top of it. All the three packages mentioned have equivalent in the deno ecosystem. Try searching on https://deno.land/std https://deno.land/std and https://deno.land/x https://deno.land/x Manual for built-in stuff in deno: https://deno.land/manual https://deno.land/manual
- deleted 6y ago[deleted]
- pid_0 6y agoJana aka a amd fidj
- ww520 6y agoWhat's the difference between WGSL and GLSL? Is WGSL a native language understood by the GPU? Or is it a purely Web-level construct and needs translation to GLSL before piped to the GPU?
- skohan 6y agoGLSL is not a native language understood by the GPU. GLSL is a high level language which has to be compiled to machine instructions for the GPU, just like HLSL and WGSL.
- ww520 6y agoYes. The GPU only runs machine code. That makes sense. GLSL is compiled by the OpenGL driver. The question becomes is WGSL sitting on top of OpenGL driver and thus requires the OpenGL drivers to support it or with a transpiling to GLSL, or does it has its own WebGPU driver that can compile the WGSL and interface with the GPU directly?
- skohan 6y agoI would imagine the details are platform specific. I doubt that anyone is using OpenGL, as WebGPU is intended to bring the benefits of the Vulkan/Metal/DX12 generation of graphics APIs to the web. On platforms supporting Vulkan, WebGPU implementations are probably compiling WGSL to SPIRV before handing it to the driver, and a DX12 implementation would probably compile it to DXIL. I'm not aware of any intermediate representation on Apple platforms, so it's probably transpiled to MSL there.
- ww520 6y agoThanks for the detail explanation. Good to know different platforms have different approach to it.
- BadInformatics 6y agoThe latter. WGSL (purposefully) lacks many of the high-level niceties of GLSL or HLSL in order to be a good compile target as well. IIRC it has a 1-1 mapping to SPIR-V constructs, so you can see how one might build higher-level languages/DSLs/compilers on top of it.
- tambourine_man 6y ago>Deno has a set of reviewed (audited) standard modules that are guaranteed to work: deno.land/std This is such a great idea.
- aitchnyu 6y agoIs a comprehensive std a goal for Deno? In the future, can I replace Python and make a 10 line script to download a gzipped csv and parse it incrementally?
- lucacasonato 6y agoYes! We have a CSV parser in the standard lib, and HTTP requests that are gzipped are automatically decompressed if they specify the `transfer-encoding: gzip` header.
- 40four 6y agoIs https://deno.land https://deno.land seriously getting the ‘hug of death’?! I’m seeing some very odd behavior. I’ve gone from getting an SSL error, to stuck in loading ‘forever’, to sometimes it loads. Anyone else experiencing this?
- simlevesque 6y agoIt's not just you.
- 40four 6y agoOk, I see the other thread on this now. Sounds like it’s hosted on Cloudflare? That is somewhat concerning, considering they say they are on the business tier.
- brundolf 6y agoHas anybody here used Deno recently? I tried it out at 1.0 and it was... a little bit rough. Basic APIs like fs weren't stable yet, the documentation on how to import them was out of date, there were multiple VSCode extensions and it took a couple hours to get one of them working properly. Of course these are all relatively easy things to smooth out over time so I'm curious what the experience is like now.
- searchableguy 6y agoIt's pretty good. Deno provides LSP now which is what Vscode extension use. Other text editors also work with deno since they can use LSP. I haven't had any problems with fs APIs. They provide almost everything and any nice utilities can be imported from std. Testing has gotten a lot better. Bundling and compiling works too. Support for third party platforms such as vercel, heroku, and other platforms is decent. Many rails-like frameworks are also popping up. Overall, I am satisfied.
- brundolf 6y agoTo be clear: IDE support existed and worked fine once I got it going. It just wasn't a smooth experience out of the box; I had to do some digging on Google, fiddle with the configuration, hunt for answers in GitHub tickets, etc. For a runtime whose main appeal (for me) was no-hassle TypeScript, all the hassle put a pretty big damper on things. Glad to hear things seem better now
- searchableguy 6y agoToday, you can run an init command on Vscode to initialise a deno project. It should work smoothly from there. It provides auto completion for registries and code lens for external code which was missing before, I think when you used it.
- mattlondon 6y agoI've not used it professionally for anything yet but I have been hacking around with it on the side for fun (I've recently created a Gopher protocol client and added it as a Third Party module: https://github.com/matt1/deno-gopher https://github.com/matt1/deno-gopher / https://deno.land/x/gopher@v0.0.5-alpha https://deno.land/x/gopher@v0.0.5-alpha - it has been a fairly enjoyable process) On the whole I have been quite happy with it - the VSCode support is now pretty good (and even without proper integration it was still fully usable even if I didn't get intellisense and had some red squiggles around the imports etc), and sounds like this release will improve it even more. I do agree though that the documentation is a bit sparse - the auto-generated docs are nice enough, but it could benefit a bit more from some more coverage of human-generated docs for some of the more common use-cases... that will come with time I guess. My main criticism is that the built-in test framework is a GREAT thing to have, but it does not have support for mocking or spies so it is limited in real-world usefulness. E.g. in my Gopher protocol client, there is not an easy way to mock out the `Deno.connect` built-in function to create a TCP socket so it is hard for me to test failures at the TCP level. I am sure with some gymnastics I can abstract everything away under layers of interfaces and classes and manually inject everything to make testing easier, but it would be nice to just be able to mock/spy out functions/classes rather than have the entire architecture of the project be dictated by the testing framework. There are third-party alternatives that can be used, but I'd prefer to stay as close to "standard" as possible.
- christiansakai 6y agoThis is probably a dumb question, but I'm interested in Deno's TypeScript default configuration. I wonder if I can just steal that configuration and just use it for all of my (TS compiled to JS) NodeJS projects.
- searchableguy 6y agoI recommend reading this page on that: https://deno.land/manual@v1.8.0/typescript/configuration#how-deno-uses-a-configuration-file https://deno.land/manual@v1.8.0/typescript/configuration#how...
- boredpandas777 6y agoVery exciting.
- mleonhard 6y agoIs there any way to limit RAM used by the code inside the VM?
- tehbeard 6y agoThere might be in V8 flags you can pass in to deno run?
- pugio 6y agoI'm hoping deno can lead to a good Electron alternative, in the same spirit and philosophy. I'm currently working on an app and would love to ditch a bunch of the node specific tooling for the deno alternative.
- mschuetz 6y agoWhat are average build times for a deno project? One reason I've sticked with JS, Electron and node up until now are zero build times, but I really miss static typing.
- mattlondon 6y agoUsually just a few seconds (depending on project size), if that. You can also disable some checks (e.g. type checks) to trim it down even further.
- mattlondon 6y agoThere are Deno bindings for webview. https://github.com/webview/webview_deno https://github.com/webview/webview_deno I have had a quick play around with it - seems functional. Usual caveats about cross-platform webview apply, but I don't see those as major blockers these days unless you are doing something particularly fancy/niche I love that you can just run the examples by copy-pasting a command and everything is auto-downloaded via Demo's modules. No installation or huge separate binary downloads. Awesome stuff.
- pimeys 6y agoDoes Deno have a standard API for building Rust modules that communicate with JavaScript? With Node, you have the N-API which is C++, which you can use with the Rust wrappers. But, a standard Rust API for native modules would be much nicer to use compared to the N-API...
- crowlKats 6y agoYes, there is the unstable plugin system that can be used for that
- cutemonster 6y agoIs that for writing performance critical code in rust? And call from Deno?
- mattlondon 6y agoIf any Deno dev/members are here, it would be really really nice to see mocking/spy support in the Deno test framework. This is the major thing holding me back from using Deno more at the moment. Not being able to mock out a class/function or spy on a particular call etc means that there are large parts of my code/particular situations that are not able to be tested easily without refactoring my entire codebase to use manual IoC and excessive-OO to hide things away under layers of interfaces etc. E.g. I cannot currently mock out `Deno.connect` (....? or can I?) so it is hard to test all sitautions there. Unfortunately this sort of thing (connecting to a remote system) is often quite critical and would benefit hugely from extensive testing. It would be great to be able to create tests where calls to Deno.connect throw errors, or where it returns 0 bytes, or a special sequence of bytes and so on and so on to verify that my code works - this is the classic sort of `Spy` functionality seen and used extensively in Jasmine et al. I know there are third-party solutions to this, but it would be nice to see this in the standard distribution.
- __jem 6y agoWhat language runtime provides mocking/spy support? This seems excessively catered to IOC OO design, not the kind of thing a multi-paradigm language usually supports.
- e12e 6y agoAFAIK deno ships with "test" as a sub command - having access to mock/spy seems reasonable in that context. It sort of follows from the "batteries included". Just like deno bundles typescript - there is a reasonable expectation to track latest stable typescript features.
- caspervonb 6y agoHi there. Any examples from deno.land/x of what you'd expect from spies and mocks in std/testing?
- KyleJune 6y agoI believe they intentionally left it up to third party modules instead of baking in one way of doing it. I created a module called mock on their third party module registry that can be used for spying on and stubbing functions. Even with third party modules, you cannot mock Deno.connect directly because the Deno object is not extensible. If you'd like to spy on or stub connect, you could have Deno.connect passed in to your function as an argument that you can replace in tests with a spy wrapper around it or your mocked out version of it.
- Vinnl 6y agoIt looks like Deno's really starting to come together! Interested to see where it'll be going in the future.
- ramino 6y agowhat do they mean with private modules?
- searchableguy 6y agoAbility to import code from private github repos and other places.
- thysultan 6y agoThat you can import a module that needs authentication to access, like a private github repo etc.
- nahuel0x 6y ago> We believe JavaScript, instead of Python, could act as an ideal language for expressing mathematical ideas if the proper infrastructure existed. It would be nice to read a rationale about this.
- pragmatic8 6y agoIndeed. I find this to be a rather strange opinion; in terms of the language itself, I can’t really say one is better than the other for expressing mathematics.
- johannes1234321 6y agoAs long as we're sticking to core language JavaScript is not the right answer as the only numeric type, Numeric, is a IEE-754 "double". For lots of maths however integer semantics are better suited. Python has arbitrary sized integers in the language, which even improves the usefulness. Of course libraries and extensions could eventually help.
- nahuel0x 6y agoJS now has BigInt, an integer type with arbitrary precision.
- stjohnswarts 6y agoAnd python doesn't? It has bignum, is that inferior? It is also arbitrary precision. Seems like to claim javascript has "sufficient" numerical properties would be better than claiming it is far superior to python. To do otherwise seems like FUD
- johannes1234321 6y ago> And python doesn't? That's not what they stated. They corrected me and pointed me to BigNum. BigNum is documented in MDN as a "Global Object" https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... I don't find a reference to it in the ECMAScriot standsrd, https://262.ecma-international.org/10.0/ https://262.ecma-international.org/10.0/ Thus I claim the Python approachbiss till better in that specific area. I don't know Deno's source for their claim. Certainly relevant is what area of Maths you're looking at. For instance looking at reread rations for vectors and matrices might be relevant for different maths problems. The functional approach in some of these things also might be interesting for some Maths problems ... broad topic :)
- goldsteinq 6y agoI was curious about how `Deno.permissions` prevents things like "requesting the permissions, then clearing the screen and asking to press 'g'". Apparently, `Deno.permissions.request()` just stops program execution waiting for user response, so it's impossible to do anything after this call. It also seems to reset text color, so it's impossible to make text invisible. iTerm custom escape sequences allows program to change color profile on the fly. Setting bg and fg to the same value hides Deno messages and allows someone to conceal which permissions are being granted.
- goldsteinq 6y agoIssue: https://github.com/denoland/deno/issues/9666 https://github.com/denoland/deno/issues/9666
- caspervonb 6y agoThank you! we'll look into it!