Discussions of the Parallel Programming book
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Akira Yokosawa <akiyks@gmail.com>
Cc: perfbook@vger.kernel.org
Subject: Re: [PATCH v2 0/8] Add style guide
Date: Wed, 2 Aug 2017 09:29:10 -0700	[thread overview]
Message-ID: <20170802162910.GY3730@linux.vnet.ibm.com> (raw)
In-Reply-To: <068877e2-655b-0d6f-6dab-84d11467d0e5@gmail.com>

On Wed, Aug 02, 2017 at 11:57:33PM +0900, Akira Yokosawa wrote:
> On 2017/08/01 13:40:47 -0700, Paul E. McKenney wrote:
> > On Mon, Jul 31, 2017 at 11:43:41PM +0900, Akira Yokosawa wrote:
> >> >From e35b5bc0c56f255caee91054f05a5dd7b824b5fa Mon Sep 17 00:00:00 2001
> >> From: Akira Yokosawa <akiyks@gmail.com>
> >> Date: Mon, 31 Jul 2017 23:20:57 +0900
> >> Subject: [PATCH v2 0/8] Add style guide
> >>
> >> Hi Paul,
> >>
> >> This is the respin I mentioned earlier.
> >> Patch #2 has a few more changes from v1 to modify strings of package name.
> >> Other than that, the end result should be the same as v1.
> > 
> > Having a style guide is very good -- for one thing, it allows me to
> > copy and paste from a uniform set of examples as opposed to whatever
> > example happens to be at hand.  ;-)
> > 
> > So thank you very much!!!
> 
> Glad to know you like it!
> 
> >> Note on the status of the floatrow package:
> >>
> >> Current version v0.3b was revised 2009/08/02.
> >> There has been no update since.
> >> I'm not sure if upstreaming is possible.
> > 
> > If we have to maintain our own, so it goes.
> > 
> > The missing two patches eventually showed up, so I applied them.
> > 
> > Some comments:
> > 
> > o	I have misgivings about thin spaces instead of commas for
> > 	numbers.  I do understand the concern, given that many of our
> > 	European readers are used to 1.234.567,89 instead of 1,234,567.89.
> > 	My problem is that the NIST convention sounds like one of those
> > 	compromises that makes things worse for everyone.
> > 
> > 	But let's see what I think in a year or two.
> 
> Maybe in another decade??? ;-)

Hey, a decade is less than 20% of my lifespan thus far.  ;-)

> > o	I don't have an objection to the NIST percent convention.
> > 	Let's face it, the percent character is a pain in LaTeX
> > 	no matter what.  ;-)
> > 
> > o	I would definitely consider patches to improve the math.
> > 
> > o	I like the idea of autonumbering, but not if it requires
> > 	the code being in separate files.
> 
> No, separate files are not required.
> The LaTeX source of the code snippet cannot be embedded in \verbbox{}
> because of the LaTeX commands therein, but \verbbox{} of C sources can
> have the same option as the \verbfilebox{}.
> By defining the option as a macro, it would be easier to convert to
> auto-numbering scheme.

The main value is not the auto-numbering, given that I have to do
tab-to-space conversion anyway, and I have one script that does both.
(See utilities/c2latex.sh and utilities/latex2c.sh.)  Though I do admit
that auto-numbering would make trivial edits easier.

The win is the prettier format.

>                                            Now, I have toyed with
> > 	the idea of automatically extracting the code from the
> > 	CodeSamples directory, but haven't yet come up with anything
> > 	satisfactory.
> 
> Besides the adjustment of indentation, there need to be some way to
> specify the part of the code you want to include as a code snippet.

And it might or might not be worth it.  It has not been worth it thus
far, but who knows?

> > 	The automation would probably make for more failures to
> > 	update line-number references in the text, but then again
> > 	that sometimes happens with the current arrangements.
> > 
> > o	I am not all that much a fan of captions at the tops of tables,
> > 	but it is a very common convention, so I will accept patches
> > 	converting tables to that format.
> 
> Position of captions can be specified in perfbook.tex for each type of float.
> So it should be easy to choose a layout of your choice without any
> modification of the source of tables, similar to the monospace font choice.

OK, even better!

> > o	The ruled code (as in Listings D.3, D.4, and D.5) does look nice.
> > 	Listing D.2 looks quite strange to me.  I would be happy to
> > 	accept patches to make the listings look like Listing D.3.
> 
> Before such style adjustment, we need to convert those code snippets
> to the "listings" environment. It will involve changes of label names and
> its references, and the citing words "Figure" need to be changed to "Listing".
> 
> Those changes would be larger than the conversion from verbatim to verbbox.

Maybe chapter by chapter?  Your suggestion of starting with the litmus
tests in the updated memory-barriers section sounds good.  (And yes,
I have been stalled by other work, but will be on this no later than
the week of August 21st.)

> > o	In https://www.inf.ethz.ch/personal/markusp/teaching/guides/guide-tables.pdf,
> > 	I find the examples from The Economist to be much more attractive
> > 	than his example tables.  Not sure whether LaTeX is up to all
> > 	that without excessive formatting pain, though.  ;-)
> > 
> > 	If it is easy to do, it would be interesting to see what
> > 	Table D.2 would look like with The-Economist-style dashed
> > 	lines between the rows.
> 
> There is a package named "arydshln". It provides dashed rules for tables.
> But it conflicts with "tabulary" package. I'll see what I can.

Ouch!  Well, at least a package exists, I suppose.

> > o	Putting related code side by side as in Listings D.4 and D.5
> > 	could be quite useful.  I did this manually in a few places,
> > 	for example, Figures 9.38-9.40.  Maybe these would look better
> > 	as floatrows.
> > 
> > And the comment at the end:
> > 
> > % Capitalize initialism:
> > %    Gnu Compiler Collection = GCC
> > %    gcc should be used as a command name in \co{gcc}
> > %    When mentioning GCC's C language, use `GNU C'
> > 
> > I have been rather random here, and it would be good to have a
> > standard.  The one above looks fine to me.
> > 
> > % Trademarks:
> > %    As the Legal page covers trademarks, there is no need to
> > %    use trademark symbol in the text. They seems to have been
> > %    imported from original publications.
> > 
> > Indeed they have!
> > 
> > % Power or POWER?
> > %    IBM's trademark page at https://www.ibm.com/legal/us/en/copytrade.shtml#section-P
> > %    lists the following.
> > %        PowerPC
> > %        Power Architecture
> > %        Power
> > %        POWER
> > %        POWER5
> > %        POWER6
> > %
> > %    not Power5, POWER 5, nor Power-5
> > 
> > IBM's preferences have changed over time, so I end up importing
> > whatever was the style at the time of publication.  :-/
> > 
> > Again, consistency would be good, but IBM's preferences are likely
> > to continue to change over time.
> > 
> > What would you suggest?
> 
> What about defining a  macro named "\Power{}", which can be used like
> \Power{5} in the source code? If IBM's preference changes, we can
> change the definition accordingly.

The definition might end up with special cases over time, but better than
massive repeated rounds of search-and-replace.  ;-)

> > % Ugly line break by \co{}
> > %                                 __
> > %        atomic_store()
> > %
> > %                           seqlock_
> > %        t
> > %
> > %   Is there any way to prevent these breaks?
> > %   Maybe we need an on-the-fly script to convert such \co{}s
> > %   to couples of \co{}s.
> > %   Example:
> > %     \co{__atomic_store()} -> \co{__}\co{atomic_store()}
> > %     \co{seqlock_t} ->        \co{seqlock_}\co{t}
> > 
> > As long as it is automated!  ;-)
> > 
> > Overall, my main goal here is making the book more attractive and
> > easier to read -- not so much conventions for conventions sake.
> 
> Yes, I think I understand.
> 
> If I'm guessing right, you are in the middle of updating the memory
> barriers section.
> If the transition to auto-numbering helps in adding new code snippets,
> I can generate an example patch of a (say) litmus test.
> 
> The other changes can wait after the upcoming release, I suppose.

That sounds very good!  I am hoping to release by the end of August or
September, FWIW.

							Thanx, Paul

>         Thanks, Akira
> 
> > 
> > 							Thanx, Paul
> > 
> >>         Thanks, Akira
> >> --
> >> Akira Yokosawa (8):
> >>   Localize floatrow.sty as floatrowpf.sty
> >>   Apply workaround to floatrowpf.sty
> >>   Define 'listing' environment for style guide
> >>   styleguide: Add listing environment examples
> >>   Disable 'floatrow' layout in manually aligned code snippets
> >>   styleguide: Add example of grouping code snippets
> >>   styleguide: Add example of preferred table layout using 'booktabs'
> >>   styleguide: Tweak layout of 'Limitation' table
> >>
> >>  appendix/styleguide/hello.c        |    9 +
> >>  appendix/styleguide/styleguide.tex |  177 ++++-
> >>  defer/rcuusage.tex                 |    6 +-
> >>  floatrowpf.sty                     | 1482 ++++++++++++++++++++++++++++++++++++
> >>  howto/howto.tex                    |    4 +-
> >>  perfbook.tex                       |    4 +
> >>  6 files changed, 1668 insertions(+), 14 deletions(-)
> >>  create mode 100644 appendix/styleguide/hello.c
> >>  create mode 100644 floatrowpf.sty
> >>
> >> -- 
> >> 2.7.4
> >>
> >>
> > 
> > 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe perfbook" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  reply	other threads:[~2017-08-02 16:29 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28  9:53 [PATCH 00/10] Add style guide Akira Yokosawa
2017-07-28  9:55 ` [PATCH 01/10] appendix: " Akira Yokosawa
2017-07-28  9:57 ` [PATCH 02/10] Specify required revision of 'verbatimbox' Akira Yokosawa
2017-07-28  9:58 ` [PATCH 03/10] Localize floatrow.sty Akira Yokosawa
2017-07-31  3:26   ` Paul E. McKenney
2017-07-31  4:05     ` Akira Yokosawa
2017-07-31  5:01       ` Akira Yokosawa
2017-07-31 12:45         ` Paul E. McKenney
2017-07-28 10:00 ` [PATCH 04/10] Apply workaround to floatrow.sty and rename it floatrowpf.sty Akira Yokosawa
2017-07-28 10:01 ` [PATCH 05/10] Define 'listing' environment for style guide Akira Yokosawa
2017-07-28 10:02 ` [PATCH 06/10] styleguide: Add listing environment examples Akira Yokosawa
2017-07-28 10:03 ` [PATCH 07/10] Disable 'floatrow' layout in manually aligned code snippets Akira Yokosawa
2017-07-28 10:04 ` [PATCH 08/10] styleguide: Add example of grouping " Akira Yokosawa
2017-07-28 10:05 ` [PATCH 09/10] styleguide: Add example of preferred table layout using 'booktabs' Akira Yokosawa
2017-07-28 10:06 ` [PATCH 10/10] styleguide: Tweak layout of 'Limitation' table Akira Yokosawa
2017-07-31 14:43 ` [PATCH v2 0/8] Add style guide Akira Yokosawa
2017-07-31 14:44   ` [PATCH v2 1/8] Localize floatrow.sty as floatrowpf.sty Akira Yokosawa
2017-07-31 14:46   ` [PATCH v2 2/8] Apply workaround to floatrowpf.sty Akira Yokosawa
2017-07-31 14:47   ` [PATCH v2 3/8] Define 'listing' environment for style guide Akira Yokosawa
2017-07-31 14:49   ` [PATCH v2 4/8] styleguide: Add listing environment examples Akira Yokosawa
2017-07-31 14:50   ` [PATCH v2 5/8] Disable 'floatrow' layout in manually aligned code snippets Akira Yokosawa
2017-07-31 14:51   ` [PATCH v2 6/8] styleguide: Add example of grouping " Akira Yokosawa
2017-07-31 14:52   ` [PATCH v2 7/8] styleguide: Add example of preferred table layout using 'booktabs' Akira Yokosawa
2017-07-31 14:52   ` [PATCH v2 8/8] styleguide: Tweak layout of 'Limitation' table Akira Yokosawa
2017-07-31 15:24   ` [PATCH v2 0/8] Add style guide Akira Yokosawa
2017-07-31 15:55     ` Paul E. McKenney
2017-07-31 15:57   ` Paul E. McKenney
2017-08-01 20:40   ` Paul E. McKenney
2017-08-02 14:57     ` Akira Yokosawa
2017-08-02 16:29       ` Paul E. McKenney [this message]
2017-08-02 22:22         ` Akira Yokosawa
2017-08-02 22:48           ` Paul E. McKenney
2017-08-05  2:09             ` Akira Yokosawa
2017-08-05  3:41               ` [PATCH 0/3] Employ auto-numbering in litmus tests Akira Yokosawa
2017-08-05  3:43                 ` [PATCH 1/3] Revert commits after "Localize floatrow.sty as floatrowpf.sty" Akira Yokosawa
2017-08-05  3:44                 ` [PATCH 2/3] advsync: Employ auto-numbering in litmus tests Akira Yokosawa
2017-08-05  3:46                 ` [PATCH 3/3] styleguide: Remove references to 'floatrow' and adjust context Akira Yokosawa
2017-08-05 15:09                 ` [PATCH 0/3] Employ auto-numbering in litmus tests Paul E. McKenney
2017-08-05 15:35                   ` Akira Yokosawa
2017-08-05 15:50                     ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170802162910.GY3730@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akiyks@gmail.com \
    --cc=perfbook@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox