<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 31, 2016 at 5:21 PM, Chandler Carruth via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span class="gmail-"><div dir="ltr">On Mon, Oct 31, 2016 at 3:46 PM Zachary Turner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="gmail-m_8296346337731727738gmail_msg"><div class="gmail-m_8296346337731727738gmail_msg">Hi all,</div><div class="gmail-m_8296346337731727738gmail_msg"><br class="gmail-m_8296346337731727738gmail_msg"></div><div class="gmail-m_8296346337731727738gmail_msg">Tentatively final version is up here: <a href="https://reviews.llvm.org/D25587" class="gmail-m_8296346337731727738gmail_msg" target="_blank">https://reviews.llvm.org/<wbr>D25587</a></div><div class="gmail-m_8296346337731727738gmail_msg"><br class="gmail-m_8296346337731727738gmail_msg"></div><div class="gmail-m_8296346337731727738gmail_msg">It has a verbal LGTM, but I plan to wait a bit longer just in case anyone has some additional thoughts.  It's a large patch, but if you're interested, one way you can help without doing a full-blown review is to look at the large comment blocks in FormatVariadic.h and FormatProviders.h.  Here I provide a formal description of the grammar of the replacement sequences and format syntax.  So you can look at this without looking at the code behind it and see if you have comments just on the format language.</div><div class="gmail-m_8296346337731727738gmail_msg"><br class="gmail-m_8296346337731727738gmail_msg"></div><div class="gmail-m_8296346337731727738gmail_msg">Here's a summary of (most) everything contained in this patch:</div><div class="gmail-m_8296346337731727738gmail_msg"><br class="gmail-m_8296346337731727738gmail_msg"></div><div class="gmail-m_8296346337731727738gmail_msg">1) UDL Syntax for outputting to a stream or converting to a string.</div><div class="gmail-m_8296346337731727738gmail_msg"><font face="monospace" class="gmail-m_8296346337731727738gmail_msg">    outs() << "{0}"_fmt.stream(1)</font></div><div class="gmail-m_8296346337731727738gmail_msg"><font face="monospace" class="gmail-m_8296346337731727738gmail_msg">    std::string S = "{0}"_fmt.string(1);</font></div></div></blockquote><div><br></div></span><div>I continue to have a strong objection to using UDLs for this (or anything else in LLVM).</div><div><br></div><div>I think this feature is poorly known by many programmers. I think it will produce error messages that are confusing and hard to debug. I think it will have a significant negative impact on compile time. I also think that it will exercise substantially less well tested parts of every host compiler for LLVM and subject us to an increased rate of mysterious host compiler bugs.</div><div><br></div><div>I also think it forces programmers to be aware of a "magical" construct that doesn't really fit with the rest of the language.</div><div><br></div><div>It isn't that any of these issues in isolation cannot be overcome, it is that I think the value provided by the UDL specifically is substantially smaller than the cost.</div><div><br></div><div>I would *very strongly* prefer that this is accomplished with "normal" C++ syntax, and that compile time checking is done with constexpr when available. I think that will give the overwhelming majority of the benefit with dramatically lower cost.</div></div></div></blockquote><div><br></div><div>+1, the UDL seems a bit too automagical.</div><div>`format_string("{0}", 1)` is not that much longer than `"{0}"_fmt.string(1)`, but significantly less magical.</div><div><br></div><div>Simple example: what should I type into a search engine to find the LLVM doxygen for the UDL? I know to search "llvm format_string" for the format string, but just from looking at a use of the UDL syntax it might not be clear that format_string is even called.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>