Hacker Newsnew | past | comments | ask | show | jobs | submit | miguel_martin's commentslogin

defer is literally just an explicit RAII in this example. That is, it's just unnecessary boiler plate to wrap the newResource handle into a struct in this context.

In addition, RAII has it's own complexities that need to be dealt with now, i.e. move semantics, which obviously C does not have nor will it likely ever.


> RAII has it's own complexities that need to be dealt with now, i.e. move semantics, which obviously C does not have nor will it likely ever.

In the example above, the question of "do I put defer before or after the `if err != nil` check" is deferred to the programmer. RAII forces you to handle the complexity, defer lets you shoot yourself in the foot.


SDL is not perfect, e.g. you can't get pinch/zoom events on MacOS. IMO, using the OS APIs yourself is better.


"Everyone in San Francisco is talking about the singularity" - I'm in SF and not talking about it ;)


But you're not Everyone - they are a fictional hacker collective from a TV show.


Your comment just self-defeated.


Yet, here you are ;)


Another one down.


Your site is down.


its not :)


Sad!

These are really high quality and performant libraries.

Here is video demonstrating text rendered with Blend2D in real time (NO glyph cache used) - on the CPU!

https://vimeo.com/1152635716?fl=pl&fe=cm


Just use blend2d - it is CPU only but it is plenty fast enough. Cache the rasterization to a texture if needed. Alternatively, see blaze by the same author as this article: https://gasiulis.name/parallel-rasterization-on-cpu/


Blaze outperforms Blend2D - by the same author as the article: https://gasiulis.name/parallel-rasterization-on-cpu/ - but to be fair, Blend2D is really fast.


You need to rerun the benchmarks if you want fresh numbers. The post was written when Blend2D didn't have JIT for AArch64, which penalized it a bit. Also on X86_64 the numbers are really good for Blend2D, which beats Blaze in some tests. So it's not black&white.

And please keep in mind that Blend2D is not really in development anymore - it has no funding so the project is basically done.


> And please keep in mind that Blend2D is not really in development anymore - it has no funding so the project is basically done.

That's such a shame. Thanks a lot for Blend2D! I wish companies were less greedy and would fund amazing projects like yours. Unfortunately, I do think that everyone is a bit obsessed with GPUs nowadays. For 2D rendering the CPU is great, especially if you want predictable results and avoid having to deal with the countless driver bugs that plague every GPU vendor.


That is fair - sorry for spreading mis-information! That's unfortunate to hear about Blend2D.


It's sad that RuneScape is not on this list, yet it is on their site - https://www.webdesignmuseum.org/?s=runescape


Thanks for letting me know. I've already added this website.


See also: Nim's std/selectors API - https://nim-lang.org/docs/selectors.html, it supports: "Supported features: files, sockets, pipes, timers, processes, signals and user events." - here's a HTTP server event loop using it: https://github.com/guzba/mummy/blob/master/src/mummy.nim#L11...


This is what an AGENTS.md - https://agents.md/ (or CLAUDE.md) file is for. Put common constraints to correct model mistakes/issues with respect to the codebase, e.g. in a “code style” section.


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

Search: