News for hackers. Stuff that matters.
Re:Safe C++ proposal is not being continued by Yoric on Saturday September 13, 2025 @05:02PM (#45235274)
> There are a few really amazing things which have been achieved in C++ like fmt, a compile time checked, userspace library for arbitrarily formatting variadic generic parameters.

Anecdotal, but that's hardly unique to C++. So even if C++ were to disappear overnight (which we all agree won't happen), this wouldn't be a burning-library-of-Alexandria moment.

Re:Safe C++ proposal is not being continued by tialaramex on Saturday September 13, 2025 @05:05PM (#45235302)
Well. What other examples of this feat are you thinking of?

To me the things which come to mind are either compiler magic (e.g. C printf) or they rely on RTTI (e.g. Odin and similar C-like languages) and neither of those is what fmt does, they're "cheating" in some sense that actually matters.

Re:Safe C++ proposal is not being continued by int_19h on Sunday September 14, 2025 @12:19AM (#45237419)
Re:Safe C++ proposal is not being continued by notmywalrus on Sunday September 14, 2025 @02:57AM (#45238034)
Rust is an example of "compiler magic" in this case.

You're right about Zig, and reading the source [1] I'm still kind of impressed how unified they made comptime / runtime.

[1]: https://github.com/ziglang/zig/blob/32a1aabff78234b428234189...

Re:Safe C++ proposal is not being continued by int_19h on Friday September 19, 2025 @08:20PM (#45308428)
"Compiler magic" is generally used to describe things that are built into the compiler; I don't see why macros would qualify. And if they do, then why wouldn't template metaprogramming?
Re:Safe C++ proposal is not being continued by Yoric on Sunday September 14, 2025 @03:50AM (#45238253)
I co-implemented this in OCaml ~20 years ago, using no compiler magic (it did use a macro). Pretty sure that I've seen the equivalent in Haskell, too, and in variants of Scheme. Zig has it, too. And while, as you mention, the Rust implementation does use compiler magic, I'm pretty sure that it could be implemented as a macro, just more slowly.

etc.

Re:Safe C++ proposal is not being continued by Yoric on Sunday September 14, 2025 @12:42PM (#45241219)
(sorry, it wasn't you who mentioned it, but it was a good remark nevertheless :) )