>   "change code like this: println!("The result is %f", foo);
>    to this: println!("The result is", foo)"
>
> These sound like they're ... in the wrong spirit, to me. Obviously some
> output should be un- or lightly-formatted (logging, diagnostic, raw-data
> output, json, tabular stuff, etc.) but that's a linguistic example that
> looks like it's intended for an end-user. That's the primary case for
> l10n-friendly format strings. I don't want to be nudging any users away
> from l10n-friendly by default in cases like that; I want to be nudging
> them _towards_ l10n-friendly.

Perhaps this boils down to what people work on most. In Servo, print!
et al are only used for debugging and logging. We have no command line
interface to speak of, and no need to have translated format strings.
That go to stdout/stderr. We will make plenty of use of string
formatting to generate strings for display in dialogs I'm sure. I
think all the code in Servo's C/C++ dependencies uses printf for
diagnostics and debugging (SkDebugf, SkPrintf from Skia as an
example).

However, in Rust, stdout is the UI, and i18n string formatting is
clearly very important there. I think compilers are in the tail of the
distribution in that they want both i18n formatted string handling and
that stdout/stderr are their interfaces.

Keep in mind that my proposal was specifically about print*! and
debug! (and friends) and not at all about fmt! or anything else.

jack.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to