comp.lang.ada
 help / color / mirror / Atom feed
From: mfb@mbunix.mitre.org (Michael F Brenner)
Subject: Re: GOTO considered necessary
Date: 1997/06/07
Date: 1997-06-07T00:00:00+00:00	[thread overview]
Message-ID: <5ncp5a$n1d@top.mitre.org> (raw)
In-Reply-To: 5n977i$2cmc$1@prime.imagin.net


Item 4 states that GOTOs in FSAs are done to match the style of what
an FSA actually is. I disagree. The reason is for speed. Speed is the
purpose of designing and implementing code; the language is the method
used to provide that speed (e.g. readably, with no memory leakages,
with memory leakages, with hanging pointers, without hanging pointers,
in a go-to-less style, or whatever language attributes you wish to use).
Until language reference manuals specify a method of guaranteeing
tail recursion optimization, total inlining, gargantuan level movement,
and algorithm rewriting, there will be many FSAs that are more quickly
implemented with each state as a label, and the transition matrix
implemented as GOTO statements. This is independent of the field
(compiler theory, business processes, command and control, 
ASIC, or other custom chip or application). When a language attribute
(procedures, table-driven, good style, bit matrixing, maintainable,
readable, etc.) interferes with speed, then there will be applications
where the trade-off must be made in favor of the speed. However,
the world is full of unmaintainable FSAs which were implemented
as thousands of GOTOs, the original table-driven FSA prototype was
lost, and now it is almost impossible to reliably change the GOTOs.
So when you make a trade-off to increase your speed by manually
compiling a table-driven FSA into a bunch of GOTOs, consider
typing the original table into comments right after the label 
corresponding to the START state. 




  parent reply	other threads:[~1997-06-07  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-06  0:00 GOTO considered necessary Samuel Mize
1997-06-06  0:00 ` Michel Gauthier
1997-06-07  0:00 ` Robert Dewar
1997-06-17  0:00   ` Woodrow Yeung
1997-06-20  0:00     ` Robert Dewar
1997-07-09  0:00       ` Woodrow Yeung
1997-06-23  0:00     ` Adam Beneschan
1997-06-07  0:00 ` Michael F Brenner [this message]
1997-06-08  0:00   ` Robert Dewar
1997-06-17  0:00     ` GOTO considered necessary (FSAs) Nick Roberts
1997-06-09  0:00 ` GOTO considered necessary Wolfgang Gellerich
1997-06-09  0:00 ` Anonymous
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox