groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] It is time to modernise "groff"


From: Roger Leigh
Subject: Re: [Groff] It is time to modernise "groff"
Date: Thu, 31 Aug 2017 22:35:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 31/08/17 21:54, Bjarni Ingi Gislason wrote:
Introduction:

A) There are about 1400 lines in the code in the "groff" repository that
contains the backquote, grave (`) as a directional quote, but it is output
exactly as itself, as it is not processed as an input to "groff" to be
formatted and typeset.

Example:

an-old.tmac:.    tm `R' is a string (producing the registered sign), not a 
macro.

As a general point, if ` and ' are used as single quotes in C++ sources, you can actually use ‘ and ’ and tell the compiler that the input is UTF-8. It's been the default for GCC for over a decade; even the recent-ish Microsoft compilers support it.

The C++11 language standard also introduces a u8"" string literal type. It's a UTF-8 string literal. There are also u and U literals for UTF-16 and UTF-32, respectively, if you want to have characters and strings in various explicit wide representations without the ambiguity of L wchar_t. If it's not already, having groff be unicode-clean from end to end would be greatly desirable, and these aid portable use of unicode characters directly in the program input.

While groff predates standard C++, and restricts itself to C for the most part, it has a lot of esoteric stuff relating to memory management which could for the most part be replaced by standard containers and smartpointers. It would be a bit slower to compile, but make the source base much more accessible; I found it difficult 15 years ago.


Regards,
Roger



reply via email to

[Prev in Thread] Current Thread [Next in Thread]