37

Canvas_ity: A tiny, single-header <canvas>-like 2D rasterizer for C++

The project is great. The HN comments are embarrassing. Isn’t it ironic to imply laziness by chiming in with “vibe coded” which in itself is such a lazy reaction.

2 hours agomsephton

Thank you for sharing. The only thing I don't understand why this is a header only implementation with a macro that goes in a C++ file.

    #define CANVAS_ITY_IMPLEMENTATION
2 hours agoddtaylor

It is common for header-only libraries: you need to include this header in one c++ using the macro for linking (don't use that macro in other c++ files to avoid duplicate symbols). In C++, you can declare a function as many times as you want, but you can only define it (write the actual body) once in the entire project.

24 minutes agoerwincoumans

It would be interesting to compile to WASM to compare side by side for performance and accuracy.

3 hours agoLerc

vibe-coded?

3 hours agoranger_danger

Most likely not seeing as the commit containing the bulk of the implementation dropped in 2022.

3 hours agonicoburns

maybe just the README then

3 hours agoranger_danger

The README is older than ChatGPT too. It's very unlikely that it's vibe coded or vibe written.

3 hours agoflowerbreeze

Would that be an issue?

3 hours agopeter-m80

Yes, it's a canvas library, there's a lot of risks of including AI generated code that hasn't been checked in a rasterizing library.

2 hours agoAmlal

A lot of risks compared to what? I imagine bugs in kernel drivers or disk utilities be riskier.

2 hours agoivanjermakov

Such as?

an hour agoJoeyJoJoJr

Yes.