Hacker News new | past | comments | ask | show | jobs | submit | adrift's comments login

delusional take


Having a C API like that is always nice. I don't wanna fight Rust.


WebGPU has a (mostly) standardized C API: https://github.com/webgpu-native/webgpu-headers


wgpu supports WebGPU: https://github.com/gfx-rs/wgpu :

> While WebGPU does not support any shading language other than WGSL, we will automatically convert your non-WGSL shaders if you're running on WebGPU.


That’s just for the shading language


The Rust wgpu project has an alternative C API which is identical (or at least closely matches, I haven't looked in detail at it yet) the official webgpu.h header. For instance all examples in here are written in C:

https://github.com/gfx-rs/wgpu-native/tree/trunk/examples

There's definitely also people using wgpu from Zig via the C bindings.


I found:

shlomnissan/sdl-wasm: https://github.com/shlomnissan/sdl-wasm :

> A simple example of compiling C/SDL to WebAssembly and binding it to an HTML5 canvas.

erik-larsen/emscripten-sdl2-ogles2: https://github.com/erik-larsen/emscripten-sdl2-ogles2 :

> C++/SDL2/OpenGLES2 samples running in the browser via Emscripten

IDK how much work there is to migrate these to SDL3?

Are there WASM compilation advantages to SDL3 vs SDL2?



It exists, but IMO it's not a good choice.

First of all, it doesn't support RenderGeometry or RenderGeometryRaw, which are necessary for high-performance 2D rendering (absent the new GPU API). I doubt it will support any of the GPU API at this rate, as the geometry rendering is a much simpler API. Maybe both will land all at once, though. To wit, the relevant issue hasn't seen much activity: https://github.com/Rust-SDL2/rust-sdl2/issues/1180

Secondly, the abstractions chosen by rust-sdl2 are quite different from those of SDL2 itself. There seems to have been an aggressive attempt by the Rust library authors to make something more Rust-friendly, which maybe has made it more approachable for people who don't know SDL2 already, but it has IMO made it less approachable for people who do know SDL2. The crate gets plenty of downloads, so maybe it's just me.



But then you have to fight with Rust.


Graphics programming and the required math prerequisites.


It's a fun journey -- I hope you enjoy it! I never liked math, until I read Abrash's "Zen of Graphics Programming", and learned that graphics is chock-full of math :D


Even their codebase on Github is clunky with 10 folders to get through to see any code.


This is from 2021.


Arm aiming is the way.


Definitely this. Lots of good practical advice in his videos too.


Modern C++ is a scam.


They have played us for absolute fools


Can you please elaborate?


It's a meme template. The gp post didn't spend time to actually complete it, which is disappointing because it could be very funny.


Neither did you, so now we know a partial joke which could be funny but no one cared to elaborate.


You got me. I actually was thinking about what could go in it, but this is one template that actually takes work to do, so of course I didn't actually finish it.


I was being sarcastic. I find the assertion that modern C++ is a scam hilarious. It doesn't make any sense. Who benefits from this scam? Who are the victims?

The sentence is indeed from a meme template[1], but I thought that my comment would stand on its own.

https://knowyourmeme.com/memes/stop-doing-math


Thanks for elaborating. I've been hearing all sorts of criticisms of C++ ever since the 1990's (!!!) but I've been out of the loop for a little while and maybe need some catching up.


How does said software get "flashed" onto the hardware?


The UEFI firmware is programmed onto a chip before assembly of your mother's motherboard. Although it can be updated afterwards by the end user.

The UEFI applications that you can build with Lil UEFI can be shoved into a special FAT32 partition on your disk and named EFI/BOOTX64.EFI[1], the firmware finds this file and will start executing it.

[1]: It can be named something else so long as you tell the firmware about it in advance. I think that you can also load them via netboot.


In a production environment, the eeprom chips will get flashed before they're placed on the board and soldered.

In a DIY environment, https://www.flashrom.org/ or TL866 or something.


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: