Hacker GitHub

← All repos

fmtlib/fmt

View on GitHub ↗ ★ 25,901 C++

A modern formatting library

53 mentions on Hacker News by 32 people: 9 stories, 44 comments · first 2015-02-10 · latest 2026-05-13

Mentions per year 53 mentions · busiest year 2023 (11)
20082026
  1. u can type in crow.toml something like [dependencies] fmt = { git = " https://github.com/fmtlib/fmt " }. crow will clone the repo and will try to find crow.toml in it. cant find? so, crow will use wheels (from the word "wheelchair". it's…
    comment by anybodyy · 2026-05-13 · in I made Rust’s cargo copy but for CPP
  2. …{alias = "fmt"}) add_requires("vcpkg::fmt", {alias = "fmt"}) add_requires("git://github.com/fmtlib/fmt v11.0.2", {alias = "fmt"}) target("myapp") set_kind("binary") add_files("src/*.cpp") add_packages("fmt") Then you use it like #
  3. It is possible to compress the table using the technique from Dragonbox ( https://github.com/fmtlib/fmt/blob/8b8fccdad40decf68687ec038... ) at the cost of some perf. It's on my TODO list for zmij.
  4. …but it's possible to compress them to hundreds of bytes using the method from the Dragonbox paper ( https://github.com/fmtlib/fmt/blob/a6e871e39b835e5f87c5f5627... ) at the cost of some performance.
  5. ▲ 2
    {fmt} v12: 60% faster double formatting, full constexpr, and C++ 20 modules
    story by ashvardanian · 2025-09-17 · 0 comments
  6. …addition to FILE's buffer. If you are interested in what {fmt} is doing, a good starting point is https://github.com/fmtlib/fmt/blob/35dcc58263d6b55419a5932bd... . It is also possible to bypass stdio completely and get even faster output (…
    comment by vitaut · 2025-07-20 · in Stdio(3) change: FILE is now opaque
  7. …at fmtlib/fmt, which APIs treat FILE as non-opaque? Edit: ah, found some of the magic, I think: https://github.com/fmtlib/fmt/blob/35dcc58263d6b55419a5932bd... I'm curious how much speedup is gained from this.
    comment by Retr0id · 2025-07-20 · in Stdio(3) change: FILE is now opaque
  8. ▲ 7
    Fmtlib / fmt A modern formatting library
    story by Bluestein · 2025-07-20 · 0 comments
  9. …general, it is a bad practice. However, it can be useful for some low-level libraries. For example, https://github.com/fmtlib/fmt provides a type-safe replacement for `printf` that can write directly to the FILE buffer providing comparable…
    comment by vitaut · 2025-07-20 · in Stdio(3) change: FILE is now opaque
  10. …in seconds: zyn new my_project cd my_project Add dependencies directly from Git: zyn install https://github.com/fmtlib/fmt.git@9.1.0 Run it fast, run it clean: zyn run --release Why Zyn? Unlike legacy build systems, Zyn keeps things…
    comment by zyntraxis · 2025-05-17
  11. it's probably not chrome because they are using this third party library: ( https://github.com/fmtlib/fmt ). also, it might be that this sink is actually meant to write a message to the console but due to configuration options its a noop.…
    comment by benmmurphy · 2025-01-08 · in How is my Browser blocking RWX execution?
  12. Some people are noticing that println is very new. But there already is https://github.com/fmtlib/fmt and it has been there quite a long time.
  13. It was emulated using horrible macros: https://github.com/fmtlib/fmt/blob/8f5e07656e25ec64ec7c843f0... . IIRC some early versions of `std::tuple` did something similar.
    comment by vitaut · 2024-10-21 · in The C23 edition of Modern C
  14. …for C++20 and https://en.cppreference.com/w/cpp/io/print for C++23 https://github.com/fmtlib/fmt is what it's based on, for C++11 and up support.
    comment by steveklabnik · 2024-10-16 · in The C23 edition of Modern C
  15. ▲ 3
    Fmt: A Modern and Lightweight C++ Formatting Library
    story by DemoDay_Pro · 2024-08-14 · 0 comments
  16. …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... .
  17. …fastest numeric formatting and I/O: * https://vitaut.net/posts/2020/fast-int-to-string-revisited/ * https://github.com/fmtlib/fmt/pull/1882 * https://vitaut.net/posts/2020/optimal-file-buffer-size/ Here's just one example:…
  18. …heavily optimized for build speed and is usually faster to compile than equivalent iostream code: https://github.com/fmtlib/fmt?tab=readme-ov-file#compile-tim... . Once modularized std is available we might be able to be compete with…
  19. …for older compilers, or to use some more cutting-edge features that haven't been standardized yet, https://github.com/fmtlib/fmt is available to you.
    comment by steveklabnik · 2023-12-26 · in Learn Modern C++
  20. {fmt} has internal buffering but it's not yet exposed to users. There is a feature request for it: https://github.com/fmtlib/fmt/issues/2354 . FILE buffering is not too bad but it can be easily optimized:…
  21. …is an incoming way out of that with work of Victor Zverovich on std::format and libfmt [1]. [1]: https://github.com/fmtlib/fmt
  22. …string processing code which works on "raw" data in memory buffers. If convenience matters look at https://github.com/fmtlib/fmt (or std::format which AFAIK is less feature rich) and https://github.com/imageworks/pystring .
  23. I like C much more than C++, but even with that must say that https://github.com/fmtlib/fmt is pretty nice (which is the base for std::format). Together with pystring ( https://github.com/imageworks/pystring ) it makes string processing in…
  24. …with my pretty up-to-date compilers (testing Debian bookworm gcc/clang right now). There is only https://github.com/fmtlib/fmt but it doesn't seem prepackaged for me. Have you actually used std::format_to_n? Did you go through the trouble…
    comment by jstimpfle · 2023-07-13 · in C++23: The Next C++ Standard
  25. …aren't complete, even though <format> is C++20. The recommended way to get those headers is to grab https://github.com/fmtlib/fmt as an external library... Talk about the level of hype and lack of pragmatism that's going on around here.…
    comment by jstimpfle · 2023-07-13 · in C++23: The Next C++ Standard
  26. …to great lengths to avoid them and I agree with them. print/println are based on the fmt library ( https://github.com/fmtlib/fmt ), which had it's first release in 2015, so it's roughly as old as Rust afaik. It's mainly inspired by Python…
    comment by dxuh · 2023-07-11 · in C++23: The Next C++ Standard
  27. fmtlib ( https://github.com/fmtlib/fmt ), a C++11 formatting library that was the basis for C++20 std::format, is able to do this.
    comment by otherjason · 2023-01-17 · in Rust vs. C++ Formatting
  28. …libs mentioned 1)fmt and 2)sdl2. Let's go with that. Usually all libs have version tags associated: https://github.com/fmtlib/fmt/releases/tag/9.1.0 https://github.com/libsdl-org/SDL/releases/tag/release-2.24.... Rust Cargo.toml files help…
  29. http://tmplbook.com/ and study the source code of some good-quality open source project, for example https://github.com/fmtlib/fmt/ and this could be also handy: https://en.cppreference.com/w/cpp/meta
  30. …have a significant user base. 1: https://lists.llvm.org/pipermail/llvm-dev/2020-June/142300.h... 2: https://github.com/fmtlib/fmt/pull/2190
    comment by bla3 · 2021-03-28 · in Preview: IBM z/OS v2.5 [pdf]
  31. …which one can learn including: https://github.com/skypjack/entt https://github.com/taocpp/PEGTL https://github.com/fmtlib/fmt
  32. strtod is not a good benchmark. Is it faster than std::format or https://github.com/fmtlib/fmt ?
  33. …speed between printf, std::format and C++ iostream. The last one is monomophization, I believe. https://github.com/fmtlib/fmt#compile-time-and-code-bloat
  34. …over cstdio. Orthodox C++ would ban this but you can have both printf-style with type safety with https://github.com/fmtlib/fmt Which inspired C++20's std::format: https://en.cppreference.com/w/cpp/utility/format Which is also banned by…
    comment by kllrnohj · 2020-12-28 · in Orthodox C++
  35. …And it's not reliant on the compiler doing its own magic checking outside of the language. [1] https://github.com/fmtlib/fmt
    comment by quietbritishjim · 2020-08-14 · in Implementing a Type-safe printf in Rust
  36. ▲ 1
    An open-source formatting library {fmt} version 7.0 released
    story by vitaut · 2020-07-06 · 1 comment
  37. …fast_io gives 15% perf improvement by replacing a safe format_int API from https://github.com/fmtlib/fmt with a similar but unsafe one + 50kB of extra data. Adding safety will likely bring perf down which the last line seems to confi
  38. ▲ 44
    Fmt – A Modern Formatting Library
    story by int_hdlr · 2020-05-24 · 12 comments
  39. …With iostreams there are no format strings so there is nothing to validate. Libraries such as https://github.com/fmtlib/fmt are allow to do compile-time parsing of the string though.
  40. Interesting side note: https://github.com/fmtlib/fmt of the same author has been aded to the C++20 standard. One of the few inclusions into the standard which (IMHO) can be universally considered to be a good thing. If you're coming from…
  41. I stopped using `<<` for the most part after I discovered the excellent fmt library[1]. [1] https://github.com/fmtlib/fmt
    comment by umvi · 2019-07-03 · in D as a C Replacement
  42. FWIW {fmt} already supports formatting of containers, tuples and ranges as of version 5.0 ( https://github.com/fmtlib/fmt/releases/tag/5.0.0 ), for example: #include <fmt/ranges.h> std::vector<int> v = {1, 2, 3}; fmt::print("{}", v); //…
    comment by vitaut · 2019-05-01 · in Pprint: Pretty Printer for Modern C++
  43. …your python & rust equivalents. Speaking as a python evangelist who uses C++ out of nece$$ity. [1] https://github.com/fmtlib/fmt
    comment by klyrs · 2018-12-23 · in C++20 Ranges
  44. …loop, you can use boost::irange for(auto i: irange(0,10)){ For the output stuff, you can use fmt ( https://github.com/fmtlib/fmt/blob/master/README.rst ) which is on track for standardization. fmt::print("{} {} {} ", a,b,c); Overall most…
    comment by RcouF1uZ4gsC · 2018-05-05 · in CPY – Code C/C++ with no redundancy
  45. …several implementations. The fastest itoa I’ve found was fmt::FormatInt class from there https://github.com/fmtlib/fmt Based on the article, I think fmtlib will be faster than what they did here.
    comment by Const-me · 2017-12-24 · in How to Print Integers Really Fast
  46. …formatting syntax, which also happens to generate much smaller binaries than Boost.Format. [1] https://github.com/fmtlib/fmt
  47. ▲ 1
    Release 4.0 of fmt, a formatting library for C++, is available
    story by vitaut · 2017-06-28 · 0 comments
  48. ▲ 2
    Safe printf-like formatting library fmt 3.0 released
    story by vitaut · 2016-05-07 · 0 comments
  49. Also C++ has Python-like formatting: https://github.com/fmtlib/fmt . Disclaimer: I'm the author of this library.
    comment by vitaut · 2016-05-01 · in C++ Has Become More Pythonic (2014)
  50. Thanks for the suggestions. There has been some work to make formatting more customizable ( https://github.com/cppformat/cppformat/issues/235 ). This will enable extensions like the ones you suggest while keeping the library itself lean.…
    comment by vitaut · 2016-01-09 · in How to C in 2016