It’s been a long-standing issue and I hope it is resolved one day. I’ve been calling libc’s printf
directly sometimes. In other situations, the definition
print_formatted(fmt, args...) = @eval @printf($fmt, $(args...))
comes in handy but is very slow. You can get an idea of how performance is affected here: https://gist.github.com/dpo/11000433
However, if you’re going to do lots of printing with one computed format string, @eval
may be worthwhile. I use this approach when I know a format will be used many times, e.g., https://github.com/JuliaSparse/HarwellRutherfordBoeing.jl/pull/6/files#diff-ebdd0a248bebc40afece10a0d03009daR20.