-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Open
Copy link
Labels
display and printingAesthetics and correctness of printed representations of objects.Aesthetics and correctness of printed representations of objects.featureIndicates new feature / enhancement requestsIndicates new feature / enhancement requests
Description
A large part of my original motivation of porting/implementing the ryu float -> string algorithm in Julia was to then be able to use it in various packages: CSV.jl, Parsers.jl, JSON.jl, etc. 6 years ago, it was a relatively simpler/looser world, so using the Ryu.writeshortest, Ryu.writefixed, and Ryu.writeexp functions directly seemed fine.
We're now trying to be better package developer citizens and not rely on Base internals, which may change, and thus break future package versions.
The proposal here would be committing to a public API around "lower level" float -> string writing, specifically around being able to write to an AbstractVector{UInt8} + pos::Int directly.
writeshortest,writefixed, andwriteexp; basically matching what we have today, just not including the possibly not-future-proofRyumodule prefix- Make
Printf.format(buf, pos, ::Printf.Format, args...)part of the Printf public API. It's not specifically documented as part of the public API, and I think it carries a bit of overhead over whatRyu.writeXdo (well, obviously, since Printf uses those functions directly). The advantage is the functionality is already there and namedspaced in Printf already w/ thePrintf.Formatbeing a pretty common/standard convention for specifying the "api" of how to write floats.
oscardssmith and jmkuhn
Metadata
Metadata
Assignees
Labels
display and printingAesthetics and correctness of printed representations of objects.Aesthetics and correctness of printed representations of objects.featureIndicates new feature / enhancement requestsIndicates new feature / enhancement requests