News for hackers. Stuff that matters.
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by danielvaughn on Wednesday August 18, 2021 @07:05PM (#28228273)
So I'm familiar with WebGPU, but I'm not really sure why there would be a native (non-web) implementation of it. What are the practical uses of this, as opposed to just using something like Vulkan?
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by kvark on Wednesday August 18, 2021 @07:38PM (#28228588)
See prior discussion: https://news.ycombinator.com/item?id=23079200

Includes a link to the relevant Fosdem talk;)

Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by enos_feedler on Wednesday August 18, 2021 @07:11PM (#28228341)
Cross platform. You could build a rust app with a WebGPU target that runs across web and native.
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by tenaciousDaniel on Wednesday August 18, 2021 @08:17PM (#28228887)
Ah nice, I see. Any particular reason for Rust being used? Just curious, because I would (naively) expect to see similar projects with Golang, C++ etc but I really only see Rust.
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by kvark on Wednesday August 18, 2021 @08:38PM (#28229014)
Rust is great for this!

Google has an implementation of WebGPU called Dawn, which is quite impressive. It's written in C++.

Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by jms55 on Wednesday August 18, 2021 @08:38PM (#28229011)
This implementation is developed by firefox (at least, last I checked). Google has an implementation along similar lines in C++ called dawn, and I'm pretty sure webkit plans to use dawn. So you see them in Rust/C++, but no one has written an implementation in go afaik.
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by dralley on Wednesday August 18, 2021 @08:46PM (#28229074)
A Go implementation would only be usable from Go, whereas Rust and C++ can export a C API that many different languages can use.

Plus, using system libraries (DirectX, Villain, Metal, OpenGL) from Go would be a pain and possibly suffer worse from the FFI penalties than just using a higher level library written in Rust/C++ to begin with.

Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by kvark on Wednesday August 18, 2021 @08:40PM (#28229033)
For all we know, Safari on Windows(!) is going to use Dawn. But anything on Apple platforms isn't quite clear. They may get their own implementation.
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by kangz on Thursday August 19, 2021 @07:40AM (#28232630)
I think you meant WebKit on Windows (used for other browsers than Safari). Once Dawn is integrated in WebKit for one OS, it should be easy to extend WebKit to use it on other OSes so maybe it will be a quick way to have WebGPU implemented in Safari?
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by kvark on Thursday August 19, 2021 @08:53AM (#28233206)
Thanks for correcting! For a moment I started wondering if I exposed any confidential info here, phew!
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by frutiger on Wednesday August 18, 2021 @08:59PM (#28229148)
The Windows version of Safari was discontinued in 2012.
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by Jweb_Guru on Wednesday August 18, 2021 @08:35PM (#28229000)
It's cross-platform, safe, (reasonably) standardized, and fast (in roughly that order of priority). Even if you only care about the last three, there are not all that many competitors outside of maybe Metal, which is not the API what most people are thinking of when they say they don't care about working cross platform :P Vulkan emulation exists for some older machines, but it's generally slow and janky due to the impedence mismatch of trying to build a very low level API on top of a high level one.
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by wrnr on Wednesday August 18, 2021 @08:17PM (#28228882)
Then rust code using webgpu can compile to wasm. WebGPU does a bit of extra work to make it the safe to run code on the GPU from different domains. Also, Vulkan is not support on most platforms.
Re:Wgpu-0.10 released: WebGPU implementation now in pure Rust by user-the-name on Wednesday August 18, 2021 @07:44PM (#28228651)
An API that is more usable than Vulkan, a better fit for modern hardware and faster than OpenGL, and that runs on top of already existing and well-supported platform APIs.