HackerLangs
トップ新着トレンドコメント過去質問紹介求人

spiffyk

no profile record

投稿

Contributor Poker and Zig's AI Ban

kristoff.it
10 ポイント·投稿者 spiffyk·2 か月前·0 コメント

High-Quality Chaos

daniel.haxx.se
5 ポイント·投稿者 spiffyk·3 か月前·0 コメント

Given AI, should I still consider becoming a computer programmer? – Yes, and

htmx.org
4 ポイント·投稿者 spiffyk·4 か月前·2 コメント

Google warns EU against 'erecting walls' in tech sovereignty push

ft.com
8 ポイント·投稿者 spiffyk·5 か月前·3 コメント

Documents found to have been forged because they were written in Calibri

en.wikipedia.org
3 ポイント·投稿者 spiffyk·7 か月前·0 コメント

[untitled]

5 ポイント·投稿者 spiffyk·10 か月前·0 コメント

コメント

spiffyk
·26 日前·議論
Fair, but it is less of a burden than just submitting a report with no proposed fix. Also, submitting quality patches regularly seems to be a good way to eventually become a maintainer, provided that both sides are interested (cURL generally is – at least that seemed to be the vibe at the last year's cURL Up event I attended).
spiffyk
·26 日前·議論
> but then what?

Then you send the patch upstream, they incorporate and maintain it for you. Congratulations, you just FOSSed.
spiffyk
·先月·議論
A cache line is simply the unit of data a CPU cache works with (generally 64 bytes, because someone somewhere has probably determined that that is the best line size for general use), much like there are units of data like bytes (8 bits nowadays, but there have been weird ones historically), pages (varies between hardware as well, and may be OS-configurable), etc.

As TFA mentions, a CPU does some predictions about what cache lines to prefetch, e.g. when you do sequential reads. Moreover, the x86_64 instruction set provides a prefetch instruction through which you are able to give the CPU a hint "hey, I'm gonna be using this soon, prepare accordingly, pretty please".

Still, the utility of prefetching is diminished if you only use a single byte from each cache line, because the mechanism generally depends on you doing other work while the next cache line is being fetched. So really the best case scenario is to take as much time as possible to work with what is already fetched, so that there is time for the next unit of data to be fetched in the meantime.
spiffyk
·3 か月前·議論
Pretty sure if you let only a handful of individuals from an almost-extinct species roam around freely in an uncontrolled environment, chances are pretty high something is going to kill them off before they reproduce, hence why they are almost-extinct.

The zoo provides a controlled environment needed to restore the species.

EDIT: typo/word ordering
spiffyk
·3 か月前·議論
I expressly said "not be so tightly coupled to LLVM" because I know they're not planning on dropping it altogether. But it is the plan for LLVM and Clang not to be compiled into the Zig binary anymore, because that has proven to be very burdensome. Instead, the plan seems to be to "side-car" it somehow.
spiffyk
·3 か月前·議論
There is actually another C compiler written in Zig, Aro[1], which Zig started using since 0.16 for its TranslateC module.

[1]: https://github.com/Vexu/arocc
spiffyk
·3 か月前·議論
Zig actually bundles LLVM's Clang, which it uses to compile C with the `zig cc` command. But the long term goal seems to not be so tightly coupled to LLVM, so I'm expecting that to move elsewhere. They still do some clever stuff around compiler-rt, allowing it to be better at cross-compilation than raw Clang, but the bulk of it is mostly just Clang.

There is also another C compiler written in Zig, Aro[1], which seems to be much more complete than TFA. Zig started using that as a library for its TranslateC functionality (for translating C headers into Zig, not whole programs) in 0.16.

[1]: https://github.com/Vexu/arocc
spiffyk
·3 か月前·議論
How is it a hack? I mean, you may not like the fact that Zig does not provide syntax sugar for interfaces, but how exactly do you think they are implemented in languages that do?
spiffyk
·4 か月前·議論
It does not need to be an explicit check (i.e. a condition checking that your index is not out of bounds). You may structure your code in such a way that it becomes a mathematical impossibility to exceed the bounds. For a dumb trivial example, you have an array of 500 bytes and are accessing it with an 8-bit unsigned index - there's no explicit bounds check, but you can never exceed its bounds, because the index may only be 0-255.

Of course this is a very artificial and almost nonsensical example, but that is how you optimize bounds checks away - you just make it impossible for the bounds to be exceeded through means other than explicitly checking.
spiffyk
·4 か月前·議論
First, if a performance optimization is a reliability regression, it was done wrong. A bounds check is removed because something somewhere else is supposed to already guaratee it won't be violated, not just in a vacuum. If the guarantee stands, removing the extra check makes your program faster and there is no reliability regression whatsoever.

And how does performance improve reliability? Well, a more performant service is harder to overwhelm with a flood of requests.
spiffyk
·4 か月前·議論
That whole section is kind of weird. The mention of operator overloading also seems out of place, since the operator is not overloaded here at all.
spiffyk
·4 か月前·議論
Not that it fits everyone, but that is basically how the Linux kernel is being developed.
spiffyk
·4 か月前·議論
That, too, though I'm sure that particular problem is mainly because of the textual animation in the background.
spiffyk
·4 か月前·議論
Funny how you can tell a project is vibe-coded just from a first glance at its website. All these websites seem to somehow have the same visual style. Anyone noticed this?
spiffyk
·4 か月前·議論
That is also my understanding. My personal theory is that many corporate compliance departments (or whoever is in charge of this at a particular place) just disallow any *GPL use in their company, regardless of whether it would actually cause problems, so this is an attempt to "unblock" the library for those. Instead of, you know, educating people about the nuances of different copyleft licenses.
spiffyk
·4 か月前·議論
The indie gamedev scene is full of people for whom games are an art form. These people don't give two hoots about what "the industry" prioritizes, they just want to make their games their way.

Calling their creations slop and suggesting using AI to make them is honestly quite the insult.
spiffyk
·4 か月前·議論
I think the biggest mistake you can make is shifting your mindset from making a game to making a game engine. No, you still want to be dead set on making your game, you just don't have the ready-made building blocks from an off-the-shelf engine, so you have to make your own as you go, and only as needed. Personally, when I was working on my little game, I found it helpful to call the endeavour—just like Noel Berry in TFA—"making a game without an engine", rather than "making a custom game engine". I only really wrote the absolutely necessary plumbing that I needed for the game I was making, nothing more.

The same goes for software libraries in general, I think. Just make your program. Don't make an overly general library for something you won't need anyway. If the code proves useful for reuse, just factor it out after the fact and generalize as needed.

EDIT: Typos, wording
spiffyk
·5 か月前·議論
> What if something is costly, that you need to compute dynamically, but not often, makes it into the frame? Do you separately now create a state flag for that one render object?

The point of immediate mode UIs is not necessarily that there is no state specific to the UI, but rather that the state is owned by user code. You can (and, in these more complex cases, should) retain state between frames. The main difference is that the state is still managed by your code, rather than the UI system ("library", whatever).
spiffyk
·5 か月前·議論
I actually use a very similar paradigm successfully in a game [1] whose (immediate-mode) UI is fully responsive. I allow more operations than just cutting to do that, but the basic idea seems to be the same. The code may look like a bit of a mess at a first glance [2], but I still find it easier to work with and make it do what I actually want with some very basic vector maths, than with the layout-container rules of most UI frameworks.

[1]: https://fruitsandtails.fghj.cz/

[2]: https://codeberg.org/spiffyk/FruitsAndTails/src/branch/main/...
spiffyk
·5 か月前·議論
You don't. Labels are local to functions in C.