Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
fuhsnn
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
25 ms
·
61.
▲
by
fuhsnn
1y ago
For C projects, the task should be passing the full test suite with at least address-sanitizer enabled. Amusing how some would discourage fellow human from using a programming language because of its unsafeness or undefined behavior, yet AI
62.
▲
by
fuhsnn
1y ago
As a practical example, the latest Git version can be compiled by an extremely simple (8K lines of C) C compiler[1] without modification and pass the entire test suite. Gonna miss the ability to make this claim. [1] https://githu
63.
▲
by
fuhsnn
1y ago
Perl, TCL and Python are all written in C, as well as many shells, so despite their interdependency the total complexity can be satisfied with a C11 compiler.
64.
▲
by
fuhsnn
1y ago
Latest version of Fil-C with -O1 is just around 50-100% slower than ASAN, very acceptable in my book. I'm actually more "bothered" by its compilation time (took roughly 8x time of clang with ASAN).
65.
▲
by
fuhsnn
1y ago
x86 memory operands are also nice for binary size, my amateur compiler sometimes produces smaller objects than peers despite having no load-store elimination, all by greedily opting for memory operands during instruction selection; kinda am
66.
▲
by
fuhsnn
1y ago
Thanks for the tips! Yes it can always be worked around, however the intuition I developed from doing it for over a hundred of projects [1] is that, with script like that there usually would be more compiler assumptions in C code as well, t
67.
▲
by
fuhsnn
1y ago
Another great overview of Go compiler's register allocation: https://developers.redhat.com/articles/2024/09/24/go-compile...
68.
▲
by
fuhsnn
1y ago
I'd love to have some of these libraries in slimcc's test pool, but almost every one of them have hard-coded assumptions to gcc/clang/msvc/tcc in their scripts that are tiresome to undo. For example: MLIB: assumed G
69.
▲
by
fuhsnn
1y ago
The said library is a bit farther away from the C that is widely available. It relies on C23 features, GNU statement expression, GNU nested function, sanitizer runtimes, VLA types and a very niche pattern of sizeof executing its statement-e
70.
▲
by
fuhsnn
1y ago
There is one pretty serious C++ parser project: https://github.com/robertoraggi/cplusplus
71.
▲
by
fuhsnn
1y ago
I wonder if Rust or future PL would evolve into allowing multiple borrow checker implementations with varying characteristics (compile speed, runtime speed, algorithm flexibility, etc.) that projects can choose from.
72.
▲
by
fuhsnn
1y ago
Oh, yeah, the codegen for the fn() itself would likely be the same, but the prototype of that definition is still a K&R function. https://godbolt.org/z/Psvae55Pr
73.
▲
by
fuhsnn
1y ago
In what situation fn() doesn't mean fn(void) under C23?
74.
▲
by
fuhsnn
1y ago
> `#include "file.c" name1=val1 name2=val2` That's an interesting idea! I think D or Zig's C header importer had similar syntax, I'm definitely gonna do it.
75.
▲
by
fuhsnn
1y ago
The recent #def #enddef proposal[1] would eliminate the need for backslashes to define readable macros, making this pattern much more pleasant, finger crossed for its inclusion in C2Y! [1] https://www.open-std.org/jtc1/
76.
▲
by
fuhsnn
1y ago
> our renderer currently does not use any subgroup intrinsics. This is partly due to how LLVM does not provide us with the structured control flow we would need to implement Maximal Reconvergence. Augmenting the C language family with su
77.
▲
by
fuhsnn
1y ago
This post was very helpful when I tried to figure it out: https://dougallj.wordpress.com/2021/10/30/bit-twiddling-opti...
78.
▲
by
fuhsnn
1y ago
Even Chris Lattner was treated like shit by Swift core team, that was a shocking read to me: https://forums.swift.org/t/core-team-to-form-language-workgr...
79.
▲
by
fuhsnn
1y ago
This seems to be the repo: https://github.com/tpde2/tpde
80.
▲
by
fuhsnn
1y ago
> still chockes on many common C extensions I play with ImportC occasionally, a lot of those can actually be opt out by undef'ing __GNUC__ on the preprocessor invocation, idk why they don't do that. Oh, now it chokes on C23 fea
81.
▲
by
fuhsnn
1y ago
> I like the roleplay/lore and the tech effort is impressive but I don't think it fits the idea. "An optimizing compiler requires at least 500MB of RAM, which can only be looted from level 7 Terminator elites!"
82.
▲
by
fuhsnn
1y ago
> type-punning using a union - I've read that it should be avoided and to use `memcpy` instead The other day we had standard committee members confirming union punning is good in C: https://news.ycombinator.com/item?
83.
▲
by
fuhsnn
1y ago
There are alternative STL-like libraries designed for embedded use: https://github.com/ETLCPP/etl
84.
▲
by
fuhsnn
1y ago
Chromatic major chord progressions were already popular since 60s psychedelic rock, and often used in full triads, no "power chords mostly sounding as major" argument required. Don't sleep on The Rolling Stones!
85.
▲
by
fuhsnn
1y ago
xcc is great, among small C compilers I tried it is the one that come close to TCC compile speed, does some optimizations, and with highly readable source code, incredible work.
86.
▲
by
fuhsnn
1y ago
> Defined using char, int, short, long or long long > Note that C does not have a boolean type `_Bool` and `long long` are both introduced in C99, this is mixed up info. Edit: probably tailor-made for old MSVC, which didn't suppo
87.
▲
by
fuhsnn
1y ago
The wording of GCC maintainer was "the standard doesn't require it." when they informed Linux kernel mailing list. https://lore.kernel.org/linux-toolchains/Z0hRrrNU3Q+ro2T7@tu...
88.
▲
by
fuhsnn
1y ago
Identity of the creator and the piece has always been a big part of music appreciation. Imagine how dystopian would be if you ask someone their favorite and the answer is "the music that HitAI generated when promoted 'sad song for
89.
▲
by
fuhsnn
1y ago
It's great of programmers to aim for portability, but frankly it's kind of a stretch that an arbitrary C compiler that is limited in standard support would the same time be sophisticated enough to process these tricks as intended.
90.
▲
by
fuhsnn
1y ago
FOSS alternatives are SDCC and https://github.com/EtchedPixels/Fuzix-Compiler-Kit
More ›