HNHacker News
TopNewBestAskShowJobs

aartaka

131 karma · joined September 19, 2022

CTO of Brainfuck Enterprise Solutions https://github.com/bf-enterprise-solutions Previously maintainer of https://nyxt-browser.com Website https://aartaka.me
submissionscomments
aartaka··on Pretty.c
It's a set of C Preprocessor macros, so you don't even need to somehow process the code—you just #include the header and hack away as if it was regular C!
aartaka··on Pretty.c
Indeed, I might need to revisit foreach with type inference. Should be totally possible.
aartaka··on Pretty.c
Yes, it's one of the inspirations!
aartaka··on Pretty.c
You might like https://aartaka.me/oop-c
aartaka··on Pretty.c
With C23 (nullptr, auto typing, typeof) and C11 (generics) it got more guarantees and type-related primitives. You can still do void*, but you are strongly discouraged from it.
aartaka··on Pretty.c
Thanks!
aartaka··on Pretty.c
You're welcome!
aartaka··on Pretty.c
C17 doesn't have auto, but C23 does, and thus my `__STDC_VERSION__ > 201710L` (notice the greater than sign, it doesn't include C17 itself.)
aartaka··on Pretty.c
I won't stop you, so be my guest.
aartaka··on Pretty.c
Yeah, I love sugar ;)
aartaka··on Pretty.c
Thanks!
aartaka··on Pretty.c
Author here. I'll be glad to accept any contribution that makes C more readable, so PR away!
aartaka··on Pretty.c
Can't wait to learn of how it went!
aartaka··on Pretty.c
Well, you don't have to use it all. My projects mostly use booleans, len(), max/min, and some operator aliases, because there wasn't much need for other tasty stuff yet. So give it a shot, even if for a couple of operator macros!
aartaka··on Pretty.c
Thanks!
aartaka··on Pretty.c
Yes, LOOP is a huge inspiration and my favorite programming language!
aartaka··on Pretty.c
Thanks!
aartaka··on Pretty.c
Thanks!
aartaka··on Pretty.c
Will do.
aartaka··on Pretty.c
Indeed, FLT_EPSILON is not a one-size-fits-all solution, but it's good enough for frequent case of comparing big enough numbers, which is not covered by regular ==. So it's a convenience/correctness trade-off I'm ready to make.
aartaka··on Pretty.c
Yes, and it's a shame that underlying features were only shipped in C11 (generics) and C23 (auto type inference!)
aartaka··on Pretty.c
Scoping defer to a block is actually more useful and explicit than function-exclusive that Go does, so I consider that a feature.
aartaka··on Pretty.c
You're welcome!
aartaka··on Pretty.c
Author here. I don't see any problem with this
aartaka··on Pretty.c
Yes, code blocks in Org are executable, but I was aiming for simple embedding and zero build-time, thus conservative choice of separating README and the actual header.
aartaka··on Pretty.c
Added in commit ef510ca!
aartaka··on Pretty.c
"loop" added in commit 626408b, thank you!
aartaka··on Pretty.c
Pretty C does aliases "repeat" for "do", so yeah, I've got you covered!
aartaka··on Pretty.c
"forever" added in commit 67ff9ef, thank you!
aartaka··on Pretty.c
Indeed! But I've reserved "unless" for a ternary conditional, which is more useful anyway.

Oh shit wait, you're John Tromp, BLC creator! I'm a fan!

← PreviousPage 3 of 4Next →