From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a7f223906eb859a X-Google-Attributes: gid103376,public From: mfb@mbunix.mitre.org (Michael F Brenner) Subject: Re: GOTO considered necessary Date: 1997/06/07 Message-ID: <5ncp5a$n1d@top.mitre.org>#1/1 X-Deja-AN: 246896767 References: <5n977i$2cmc$1@prime.imagin.net> Organization: The MITRE Corporation, Bedford Mass. Newsgroups: comp.lang.ada Summary: GOTO not done for style, but for speed Date: 1997-06-07T00:00:00+00:00 List-Id: 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.