How Lever can help with WebGPU development
Webkit announced a next-generation 3d web graphics API. I am glad that the discussion has begun. The API proposal shows the direction and it is finally away from the opengl.
Use of Lever programming language as a test platform might lead to ultimately better API quicker.
Lever has semi-automatically created Vulkan API bindings. To make this feasible I had to provide additional support for structures and flags in the foreign function interface. The results were promising but the support of Vulkan was lagging behind.
Today I started building an easy-to-use API on top of vulkan. This sample program shows how far I've managed to simplify the Vulkan API. I am confident that I will succeed. The WebGPU API designers will face the same challenges as I do and they have the pressure to bring up the missing pieces if there are any.
Vulkan API conveniently represents all the details there are in modern GPU hardware. It even includes mobile phone hardware. I don't know if it will be the official backend for the WebGPU implementation. Also, I don't think the Webvulkan is out of the question.
Lever and Javascript are similar enough to implement the WebGPU API very much like it reads in the specification. Though I already noted that it is infeasible to implement the current proposal in Vulkan. For example the queue management doesn't match and neither the handling of descriptor sets do.
Assuming the problems stay same, were you working with Vulkan or without it. A working prototype in flexible language helps anticipating potential problems in implementing the API in more challenging setting of webkit and C++.
Vulkan bindings
When Vulkan was released I did tweaks and upgrades into Lever's FFI to reduce the hassle of using Vulkan API with Lever. I succeed and wrote several sample programs. Eventually I thought to myself I was too early and moved on to work on rest of the language. Lever's Vulkan bindings are about a year stale now. Update would take one weekend.
Despite this the bindings still work on the current version. It is a good sign.
Lever and Javascript differences
Lever resembles coffeescript. It could be made to look like
javascript though some differences would remain, like the
lack of undefined
. "terraforming" the language is likely
not necessary for conducting useful studies.
Sounds good?
If you think there are good ideas here and you are involved in the Web GPU community group, you can directly contact me and get to discussion.