Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
fuhsnn
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
181.
▲
by
fuhsnn
2y ago
I'm currently pondering an IR format for a mildly optimizing C23 implementation, and am curious how C11 atomic operations would look like in sea-of-nodes. The representation seems to be completely opposite to the programming model, whe
182.
▲
by
fuhsnn
2y ago
It'll be great if there's some way to auto generate plugin templates or hardware controller presets, Ctrlr[0] might be a good target. [0] https://github.com/RomanKubiak/ctrlr
183.
▲
by
fuhsnn
2y ago
>I also have some ideas how to make this defer implementation work with break and continue, but that is unfortunately a bit more nasty. This is the kind of things better done in the compiler, I implemented the n3199 variant of defer[1],
184.
▲
by
fuhsnn
2y ago
Aside from "making C++ safe", the design looks like a good opportunity to have better Rust interop, if a standardized FFI with clear object lifetime semantics can be established between C++ and Rust, it's a win for everyone.
185.
▲
by
fuhsnn
2y ago
"llvm-readelf --elf-output-style=JSON | jq" is handy.
186.
▲
by
fuhsnn
2y ago
https://github.com/vnmakarov/mir is also great for this, the c2m binary is an optimizing C11 JIT runner, even accept "*.c" as input.
187.
▲
by
fuhsnn
2y ago
I have some experience getting several non-trivial projects to build with a small C compiler [1]. Generally, the more a toolchain resemblance, say GCC, the more GCC specific stuff build scripts will feed to it, this may send you down a rabb
188.
▲
by
fuhsnn
2y ago
>From there they can bootstrap yacc, basic coreutils, Bash, autotools, and eventually GCC ... it’s a fascinating process. I would say about half of the list can be trimmed off if you managed to separate GCC 4 and binutils from their orig
189.
▲
by
fuhsnn
2y ago
Perl, at build time, get errno numbers of the system in a similar way[0]: preprocess errno.h with `$CC -E` and recursively scan all files in # markers for macro defines. The configure script even checks the existence of several system heade
190.
▲
by
fuhsnn
2y ago
I imagine a new kind of instant camera, instead of printing the photo they upload to a satellite blockchain, timestamp the time of shooting. Zero privacy but hopefully more truthful representation of the world. Before AI filters of any kind
191.
▲
by
fuhsnn
2y ago
>throw a random-number generator at all the delay times Reverb algorithms are indeed random enough, a leading audio plugin brand once came up with a randomizing reverb freeware[0] embedded with a "submit when it sounds cool" bu
192.
▲
by
fuhsnn
2y ago
>[[musttail]] also ends the lifetime of local objects AFAICS. That's good to know. I had this github issue [0] in the back of my mind, as well as witnessing occasions of clang turning [[musttail]] into inner loops, and concluded cla
193.
▲
by
fuhsnn
2y ago
A C standard proposal exists for tail call [0], in the form of "return goto (expression);". What I like about it, over standardizing [[musttail]], is that lifetimes of local objects are guaranteed to end. This makes it possible to
194.
▲
by
fuhsnn
2y ago
I did found plenty of docs and books mentioning setrusage() though, like a proper Mandela Effect.
195.
▲
by
fuhsnn
2y ago
>setrusage() Is it old version of setrlimit()? Couldn't locate it in any of the man.*bsd.org.
196.
▲
by
fuhsnn
2y ago
>just a simple case of bad code generation render little compiler into a toy one If you find some time to go through gcc bugzilla you'll find shockingly simple snippets of code that miscompiled (often by optimization passes), with f
197.
▲
by
fuhsnn
2y ago
chibicc[0] complement this book nicely, in addition to a basic compiler, it guides you through writing the preprocessor and driver, which, although not addressed much in literature, are the missing link between the compiler built from the b
198.
▲
by
fuhsnn
2y ago
>If there is some library that can help create machine code from assembly instructions on a line by line basis That's what JIT libraries do, for example asmjit: https://github.com/asmjit/asmjit/blob/ma
199.
▲
by
fuhsnn
2y ago
It's in fact very common to microcode instructions at early iterations of an arch. https://uops.info/table.html is a nice place if certain instructions being slow brings joy to your life.
200.
▲
by
fuhsnn
2y ago
That thread already spawned a GCC-wiki page https://gcc.gnu.org/wiki/boringcc , with a quote in bold: >The only thing stopping gcc from becoming the desired boringcc is to find the people willing to do the work. And
201.
▲
by
fuhsnn
2y ago
In its current form without at least requiring balanced enclosing brackets, dropping the semantic check will make _Generic a new macro expansion system worthy of a dedicated round of obfuscated C contest.