Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm wonder what this mysterious application is that is doing heavy formatting of strings but can't afford the overhead of a temporary string, and therefore requires horrifying and inscrutable and dangerous language extensions.


Being able to use string formatting without a heap is pretty cool.

Rusts string formatting machinery does not require any heap allocations at all, you can for example impl fmt::Write for a struct that writes directly to a serial console byte-by-byte with no allocations, and then you have access to all of rusts string formatting features available to print over a serial console!

I'm not sure about the horrifying and dangerous extensions part though, I'm not really a C++ expert so I don't know if there's a better way to do what they want to do.


freestanding maybe? Embedded apps often don't shy away from using something like printf, yet they don't like unnecessary allocations.


For example, an high performance logger can ship the tuple object to a background thread for actual formatting and I/O, after converting the capture to by-value.

Formatting on the foreground thread would be a non-starter.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: