Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
cv5005
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
31.
▲
by
cv5005
2y ago
Pick an appropriate base type (uintN_t) for a bitset, make an array of those (K * N/4) and write a couple inline functions or macros to set and clear those bits.
32.
▲
by
cv5005
2y ago
simd doesnt make much sense as a standard feature/library for a general purpose language. If you're doing simd its because you're doing something particular for a particular machine and you want to leverage platform specifi
33.
▲
by
cv5005
2y ago
Not any different from C - a given C compiler + platform will behave completetly deterministically and you can test the output and see what it does, regardless of UB or not.
34.
▲
by
cv5005
2y ago
How does the rust compiler assure that when compiling to machine code? Machine code is less safe than C after all.
35.
▲
by
cv5005
2y ago
Or it could be made faster because certain manual optimizations become possible. An example would a table of interned strings that you wanna match against (say you're writing a parser). Since standard C says thou shall not compare poin
36.
▲
by
cv5005
2y ago
You dont need UB for that. A simple model for both compilers and programmers to understand: "A variable whose address has not been taken need not be reachable via a random pointer". I mean that's how an assembly programmer wo
37.
▲
by
cv5005
2y ago
Just make a non null checking version: GetPixelUnsafe() and let the responsibility onto the user to do the null check before the loop. All of these 'problems' have simple and straigtforward workarounds, I'm not convinced thes
38.
▲
by
cv5005
2y ago
Then use the register keyword or just reword the standard to assume the register behavior if a variables address hasn't been taken. The majority of useful optimizations can be kept in a "Sane C" with either code style changes
39.
▲
by
cv5005
2y ago
Since FILE io is part if standard C I guess you could do a plan9-style interface where you fopen("framebuffer"); and fwrite() means writing a pixel value to the screen. Since io is always implementation defined anyway, it wouldnt
40.
▲
by
cv5005
2y ago
Global warming. These days it should be considered immoral to write software that uses inefficient languages/runtimes/abstractions, we simply cannot afford to waste energy doing useless computations anymore.
41.
▲
by
cv5005
2y ago
The thing is that modern computer architecture strikes again - like the old linked list vs array thing. Doing a candidate loop over a bounding box with edge equations can be much faster than ye old scanline algorithm because it lends itself