Re: Improved accuracy in diagnostics. Is it worthwhile?

Thomas Koenig <tkoenig@netcologne.de>
Fri, 18 Mar 2022 18:12:15 -0000 (UTC)

          From comp.compilers

Related articles
Improved accuracy in diagnostics. Is it worthwhile? drikosev@gmail.com (Ev. Drikos) (2022-03-18)
Re: Improved accuracy in diagnostics. Is it worthwhile? 480-992-1380@kylheku.com (Kaz Kylheku) (2022-03-18)
Re: Improved accuracy in diagnostics. Is it worthwhile? tkoenig@netcologne.de (Thomas Koenig) (2022-03-18)
Re: Improved accuracy in diagnostics. Is it worthwhile? drikosev@gmail.com (Ev. Drikos) (2022-03-19)
| List of all articles for this month |

From: Thomas Koenig <tkoenig@netcologne.de>
Newsgroups: comp.compilers
Date: Fri, 18 Mar 2022 18:12:15 -0000 (UTC)
Organization: news.netcologne.de
References: 22-03-035
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="46601"; mail-complaints-to="abuse@iecc.com"
Keywords: errors, design, comment
Posted-Date: 18 Mar 2022 14:24:30 EDT

Ev. Drikos <drikosev@gmail.com> schrieb:


> This is mainly a parsing question but it's also Fortran related as well.


[...]


> So far, my approach has been that improved diagnostics shouldn't slow
> down the processing of correct programs.


With today's computer speeds, this is likely not a very important
consideration any more.


If you are compiling, it is usually a small fraction of time that
is spent in the parsing, and much more in optimization and code
generation. An example: Compiling a 50 k line Fortran program with
"gfortran -O2" takes 17.4 seconds on the computer I type this on.
Checking with "gfortran -fsyntax-only" takes 4.2 seconds. (For
those who want to reproduce: aermod.f90 from the Polyhedron suite).


50k lines for a single source files is already quite a lot (much
longer than most source files for modular programs are likely to
be) and throwing a bit more CPU time at the problem to reduce user
confusion by emitting better error messages is extremely likely
to be a win for the user. Just be careful to avoid anything
worse than O(n log n) for code size, or somebody will come
along with a test case that takes _really_ long.


(Take the above with a grain of salt for C++ headers.)




> Is it worthwhile to improve
> diagnostics by disabling default actions in a LALR parser?


I would presume so. Run a few benchmarks and find out.
[In my experience, lexing and optimization take most of the
time, and parsing is insignificant. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.