3 ms·
Shame that we're just nearing precompiled xprintf statements. It's so wasteful and slow to keep scanning same string for printing instructions at runtime. And v
by vardump 11y ago
Shame that we're just nearing precompiled xprintf statements. It's so wasteful and slow to keep scanning same string for printing instructions at runtime. And very bug prone.
- mrottenkolber 11y agoCommon Lisp had precompiled printing/formatting for ever: FORMAT. E.g. FORMAT is a macro.
- capisce 11y agoAnd Idris even enables a type-safe version: https://www.youtube.com/watch?v=fVBck2Zngjo https://www.youtube.com/watch?v=fVBck2Zngjo So if you mismatch the types you'll get a compile time error instead of a run time error.
- nickpsecurity 11y agoThat's pretty cool. Looking for the text version of it led me to another one more accessible to average programmer: http://www.codeproject.com/Articles/159910/Extremely-Efficient-Type-safe-printf-Library http://www.codeproject.com/Articles/159910/Extremely-Efficie...
- deleted 11y ago[deleted]
- tmzt 11y agoF# also supports a typesafe printf format notation. http://fsharpforfunandprofit.com/posts/printf/ http://fsharpforfunandprofit.com/posts/printf/
- reikonomusha 11y agoTo be clear, FORMAT is a function possibly with an associated compiler macro to expand constant format strings into more efficient code inline.