The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: scj@yaccman.com (Steve Johnson)
Subject: [TUHS] origin of C header files
Date: Mon, 22 Jan 2018 20:27:16 -0800	[thread overview]
Message-ID: <c3bcb691945ad61d9d9c04be089498902c28749d@webmail.yaccman.com> (raw)
In-Reply-To: <CABH=_VTdaxXqsoi=YUAwChtY3=5HvPeoX4vxmpOmiTjkiYW0TQ@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2464 bytes --]

Well, the problem is not unique to C.   If Python has such a
mechanism it doesn't seem to be used by TensorFlow.   If a TF
operation finds an error, in execution, there is, so far as I know, no
way for the error to refer back to the source Python code, or even the
variable names involved.  You have to say "name=..." for any op for
which you want to know the name -- otherwise, TensorFlow gives them
internal names that, for large designs, can be very hard to decode. 
(Of course, in TensorFlow, most of the heavy lifting is done by C++
called by a Python wrapper, that further "enhances" the debugging
experience)

Steve

----- Original Message -----
From: "Paul Winalski" <paul.winalski@gmail.com>
To:"Steve Johnson" <scj at yaccman.com>
Cc:"Clem Cole" <clemc at ccc.com>, "TUHS main list"
<tuhs at minnie.tuhs.org>
Sent:Fri, 29 Dec 2017 20:52:00 -0500
Subject:Re: [TUHS] origin of C header files

 On 12/29/17, Steve Johnson <scj at yaccman.com> wrote:
 > I begged Dennis for a solution, and he came up with #line,
 > which allowed you to say to the C compiler "treat the next line as
if
 > it were line nnn in file fff, and following lines as successor
lines
 > in file fff. It instantly solved the problem, and was used multiple
 > times for various applications (probably most notably cfront). So
 > far as I know, many languages including FORTRAN, Pascal and Python
do
 > not have such a mechanism, making it awkward to use them as
 > preprocessor targets.

 Language processing systems where the preprocessor functionality is
 implemented as a part of the compiler itself never had the "associate
 the error message with the line in the original source" problem that
 you described. The compiler could keep an internal table mapping the
 lexical output of the preprocessor to the source lines/files that
went
 into the preprocessor phase. Most (all?) of DEC's and IBM's compilers
 operate this way.

 In keeping with UNIX's philosophy of "one image/one purpose", C's
 preprocessor functionality was in a separate image from the compiler
 itself. There are many advantages to this design, including that cpp
 can then be used for other languages than C. But is has the
 disadvantage of introducing the source correlation problem that
 required the introduction of #line.

 -Paul W.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20180122/a4331c36/attachment.html>


  reply	other threads:[~2018-01-23  4:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-29  8:26 Wesley Parish
2017-12-29 10:58 ` Nigel Williams
2017-12-29 19:28 ` Paul Winalski
2017-12-29 20:31   ` Clem Cole
2017-12-30  1:06     ` Steve Johnson
2017-12-30  1:52       ` Paul Winalski
2018-01-23  4:27         ` Steve Johnson [this message]
2017-12-31  2:32 Doug McIlroy
2018-01-12  8:44 Lars Brinkhoff

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=c3bcb691945ad61d9d9c04be089498902c28749d@webmail.yaccman.com \
    --to=scj@yaccman.com \
    /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;
as well as URLs for NNTP newsgroup(s).