Since you posted in /c/rust@programming.dev, I'll give an answer for Rust.
When thinking about rendering, there are mostly 2 ways to complete it
- You handle setting pixels (usually rgba) at x and y coordinates
- You use a graphics toolkit that handles rendering commonly used drawing methods. Like rendering circles of a specific size, rendering a line between 2 points, etc.
For 1, the crate pixels provides rendering to x and y coordinates with the CPU to window. If you're doing lots of operations, you'll probably find this too slow, and not fast enough. To solve this problem, people use a GPU instead with shaders. vulkano-rs is a good, wgpu is also good.
For 2, I don't have immediate recommendations, but you can usually find these types of toolkits with game engines. As an example, bevy has an example of rendering shapes.
It also just depends where you want to render. If you're limited to in the browser, you'll find that maybe vulcano won't work, and you'll have to use something like WebGPU instead. Or maybe you're restricted to an environment where a web browser can't be used, so WebGPU can't be used, and Vulkano has to be how you complete it. Maybe you can't use a GPU, and need to render directly to a canvas on web page in the browser, then you can just use the MSDN docs for the canvas. etc.