Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
vitaut
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
61.
▲
by
vitaut
2y ago
Unfortunately reflection as currently proposed is insufficient to implement string interpolation.
62.
▲
by
vitaut
2y ago
We could introduce g-strings instead.
63.
▲
by
vitaut
2y ago
This proposal is not targeting C++26 and there is a new revision of it: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p34...
64.
▲
Simulating fast binary black hole collisions on the GPU
(20k.github.io)
1 points
by
vitaut
2y ago
|
0 comments
65.
▲
by
vitaut
2y ago
> C++ has built-in regex now and they're pretty damn good too Sadly, `std::regex` is anything but good (poor performance, lack of Unicode support) and should be generally avoided.
66.
▲
by
vitaut
2y ago
More context: https://www.reddit.com/r/cpp/comments/1h0ximn/comment/lz7j2r...
67.
▲
Building Bridges to C++
(circle-lang.org)
5 points
by
vitaut
2y ago
|
0 comments
68.
▲
by
vitaut
2y ago
Glad you like it =)
69.
▲
by
vitaut
2y ago
It was emulated using horrible macros: https://github.com/fmtlib/fmt/blob/8f5e07656e25ec64ec7c843f0... . IIRC some early versions of `std::tuple` did something similar.
70.
▲
by
vitaut
2y ago
{fmt} used to support pre-C++11 compilers that didn't have variadic templates. It was a pain to emulate variadics but it wasn't impossible.
71.
▲
Double to string conversion in 150 lines of code
(vitaut.net)
3 points
by
vitaut
2y ago
|
0 comments
72.
▲
by
vitaut
2y ago
If I interpret the numbers correctly it is of the order of ~1000 times slower than modern algorithms such as Dragonbox.
73.
▲
by
vitaut
2y ago
Changing global new/delete is a non-starter in a reusable library. Allocator is a much more localized change and roughly the same amount of work.
74.
▲
by
vitaut
2y ago
It is indeed possible to remove unused code with techniques like format string compilation but that's a topic for another post.
75.
▲
by
vitaut
2y ago
{fmt} has an optional implementation of the old Dragon4 algorithm that is smaller in terms of code size but not as fast.
76.
▲
by
vitaut
2y ago
You send an email to the Library Working Group chair.
77.
▲
by
vitaut
2y ago
I couldn't believe what happened next.
78.
▲
A Modern Formatting Library
(fmt.dev)
3 points
by
vitaut
2y ago
|
0 comments
79.
▲
A DSL for Implementing Math Functions
(blog.sigplan.org)
86 points
by
vitaut
2y ago
|
13 comments
80.
▲
by
vitaut
2y ago
Wait, ICQ has been working?! BTW I still remember my ICQ number although I haven't used this messenger in many years.
81.
▲
An Introduction to Low-Latency Scripting with Libriscv
(fwsgonzo.medium.com)
2 points
by
vitaut
2y ago
|
0 comments
82.
▲
by
vitaut
2y ago
This is so spectacularly outdated. KOI-8 has been dead for ages.
83.
▲
by
vitaut
3y ago
There are some fundamental reasons why cout is slower than stdio/{fmt}: https://stackoverflow.com/a/65325727/471164 .
84.
▲
Out-of-bounds read and write in glibc's qsort()
(qualys.com)
4 points
by
vitaut
3y ago
|
1 comments
85.
▲
by
vitaut
3y ago
I agree that modules is the right long-term solution and in fact {fmt} is modularized: https://vitaut.net/posts/2023/cxx20-modules-in-clang/ .
86.
▲
by
vitaut
3y ago
Unfortunately the std module alone doesn't help much because 1 second is 3x slower than before the optimization described in the post but maybe more fine-grained modules will (or if std module import made faster).
87.
▲
by
vitaut
3y ago
Good catch, thanks! Fixed now. This explains why the difference was kinda low compared to another benchmark: https://github.com/fmtlib/fmt?tab=readme-ov-file#compile-tim... .
88.
▲
by
vitaut
3y ago
Implementations can be improved somewhat but there is a certain set of dependencies that must be included according to the standard and for string it's pretty big.
89.
▲
by
vitaut
3y ago
AFAICS the main problem is that <string> pulls in a lot of dependencies.
90.
▲
by
vitaut
3y ago
std::cout is thread-safe but because of the concatenation-based API parts of the message may interleave. C++23 std::print is safe (and the output doesn't interleave). See https://vitaut.net/posts/2023/print-in
More ›