1

Topic: Re: how many passes should be at the translator?

Hello, , you wrote: > Recall still porcelain pens on chains in toilets By the way, porcelain pens - cool. I would not refuse > On a subject, in my opinion, in philosophy. Article, is written 2.5 years ago: > http://files.rsdn.org/122727/pl1ex14.doc On a subject: In article it is supposed that a principle "at first describe, and then use" it is used in languages exceptional for the purpose of reduction of an amount of passes of the compiler. Then the amount of passes not so important speaks that, and it would be quite good to allow to describe a variable in any place. I think that the author  starts with a false premise. A principle "at first describe, and then use" it is used first of all for convenience of reading of the program as the person reads from top to down and to wind the code there-here it is banal inconveniently. I personally adhere to that point of view that the variable should be described as much as possible close to a place of first usage (is better - in the same construction). Still variable on a maximum should be invariable, but it does not concern any more a subject.

2

Re: Re: how many passes should be at the translator?

Hello, , you wrote: One or two, speak? $ gcc5-c-save-temps-fdump-tree-all-fdump-rtl-all-g-Wall-W-O t.c $ ls t.c. [0-9] * | wc-l 127 Or the author does not consider all these intermediate stages as "passes"?

3

Re: Re: how many passes should be at the translator?

Hello, , you wrote: V>> In article it is supposed that a principle "at first describe, and then use" it is used in languages exceptional for the purpose of reduction of an amount of passes of the compiler. > I understood so, what not for reduction and for equal one pass As far as I know, one pass almost anywhere and so is not present. However, my knowledge in this area become outdated years on 10. V>> Then the amount of passes not so important speaks that, and it would be quite good to allow to describe a variable in any place. V>> I think that the author  starts with a false premise. > the author writes that in With there were foolish prototypes of functions because of one pass, and the prototype for three ten commands can make the translator automatically and shows a slice of the real translator which and does. About 10-20 years ago the C compiler ++ was not, like,  (a preprocessor, object code generation, resolution of characters,  if correctly I remember) V>> the Principle "at first describe, and then use" it is used first of all for convenience of reading of the program as the person reads from top to down and to wind the code there-here it is banal inconveniently. V>> I personally adhere to that point of view that the variable should be described as much as possible close to a place of first usage (is better - in the same construction). > Often it is necessary to read speckled fragments, instead of it is continuous from top to bottom. > and as it is more convenient to allocate descriptions the programmer, instead of the translator should solve. Well so programmers also solved it at designing of language V>> Still variable on a maximum should be invariable, but it does not concern any more a subject. > the invariable variable is something not that. Tell about it . Than it not that?

4

Re: Re: how many passes should be at the translator?

Hello, netch80, you wrote: N> N> $ gcc5-c-save-temps-fdump-tree-all-fdump-rtl-all-g-Wall-W-O t.c N> $ ls t.c. [0-9] * | wc-l N> 127 N> N> Or the author does not consider all these intermediate stages as "passes"? And how many there it turns out? Simply interesting, and gcc near at hand is not present.

5

Re: Re: how many passes should be at the translator?

Hello, , you wrote: > as well as offered in http://rsdn.org/forum/flame.comp/6616369.flat Author:  Date: 21.11 16:31 > I continue to spread at the desire of the author articles which have not got not so in disappeared log RSDN magazine It I periodically as a trick I result this example: IF IF=THEN THEN ELSE=THEN; ELSE THEN=ELSE; I, truth, make out it a little differently: IF IF=THEN THEN=ELSE; ELSE ELSE=IF;/* UPD: Here I as a result was mistaken: passed one THEN */IF IF=THEN THEN THEN=ELSE; ELSE ELSE=IF;/* it is correct so. During an epoch of punched cards because of such trifle it was possible to lose easily the working day */But I never spoke about dullness of compiler writers PL/1. On the contrary, it is possible to consider the compiler working on IBM/360 as a masterpiece. Which delivered much  to some students. Because worked in 96 storages. And it was the base for a failure to students who sometimes asked 128. , this compiler was to six-checkpoints. Rake of programming languages of that time - absence of reserved keywords. As consequence - the requirement to the compiler to carry out deeper analysis of the text of the program. And the requirement to the programmer - to track itself. Because during an epoch of punched cards the initial text was read on printout. Or directly from cards. To distinguish a name of a variable from a syntactic word in such conditions it is problematic. There illumination not especially well worked.

6

Re: Re: how many passes should be at the translator?

Hello, , you wrote: > On a subject, in my opinion, in philosophy. Article, is written 2.5 years ago: > http://files.rsdn.org/122727/pl1ex14.doc Any in my opinion  delirium. At first, if we speak about number of passes in a context of grammar of language it is a question of number of passes of a parcer. After the termination of grammar analysis the compiler can make 100500 more "passes", for the purpose of the analysis of the program, optimization and . These "passes" generally are a little connected To grammar of language. Secondly, the first compiler Si really possessed a single-pass parcer (the macro processor was generally the separate program) that was for those times defensible as storages was a little, and disks slow. But in that version of language of Si at all there were no prototypes of functions, they appeared strongly later. And nevertheless, to cause function to its description, or, generally, from other file, it was authorized. In the third, languages in which it is possible to refer to the entities described later, and allowing, nevertheless, one-pass parse, exist. As far as I understand, such languages concern, among other, Go, JavaScript, in some measure a C ++. In the fourth, the modern compiler spends time most part at all at all for parse, and on optimization and . It is easy to be convinced Of it, comparing speed of compilation with included  and without. Therefore the number of passes of the compiler now especially is not important. In the fifth, simple syntax is important, first of all, for the person, instead of for the compiler. And that it helps the compiler, it only not so important, though also a pleasant, additional bonus.

7

Re: Re: how many passes should be at the translator?

>> the Author writes that in With there were foolish prototypes of functions because of one pass, and the prototype for three ten commands can make the translator automatically and shows a slice of the real translator which and does. V> about 10-20 years ago the C compiler ++ (was not, like,  (a preprocessor, object code generation, resolution of characters,  if correctly I remember) Resolution of characters is first pass .  the compiler does not concern. So it turns out only two. And the preprocessor too does not concern the compiler is a separate program. On an input to the compiler program unit - the file processed by a preprocessor arrives. Here it also is processed by the compiler which creates the object code. Another matter that the compiler shares on two large enough  front-end and .

8

Re: Re: how many passes should be at the translator?

Hello, , you wrote: the Right answer on a question: Yes who considers them? 1) to do language without an output of types or with a single-pass output of types mockery at users of language. 2) in the modern world language without  is not necessary. And to write at first the compiler, and then too most for support  nonsense full. Even in  it understood. And support  works absolutely differently than the stupid translator. There it is necessary and to understand the broken text and  to enumerate changes for to do analysis of hundred megabytes of source codes on each key press not really.... <<RSDN@Home 1.0.0 alpha 5 rev. 0>>

9

Re: Re: how many passes should be at the translator?

Hello, LaptevVV, you wrote: LVV> Resolution of characters is first pass . In the unit can to do the compiler also. LVV> Linker does not concern the compiler. They now is very tightly . LVV> So it turns out only two. And the preprocessor too does not concern the compiler is a separate program. The preprocessor can be built in the compiler that two times lexical scan not to do. If we tell it about Si, in more other languages of a preprocessor can and not to be at all. LVV> on an input to the compiler program unit - the file processed by a preprocessor arrives. At Go, for example, the compiler looks in the imported units, and can make some optimization decisions, whether type to do function , untwisting all chain.

10

Re: Re: how many passes should be at the translator?

Hello, , you wrote: > On a subject, in my opinion, in philosophy. Article, is written 2.5 years ago: > http://files.rsdn.org/122727/pl1ex14.doc it is more convenient. Community more, it is possible to read online instead of to download dock, well and at the same time receive  and possibility normally to make comments on other articles.

11

Re: Re: how many passes should be at the translator?

Hello, , you wrote: > so I offered the manager from the very beginning > All these articles (and, probably, and other authors) for a long time in editions lay, would transfer all of them the automatic machine to "articles" and business with the end did not understand that you offered and why to managers. Your article? Here also publish it on .  it purely forum, remaining sections were actual in bearded the ninetieth unless. Any special reading it is not necessary, people not silly, misprints at all happen also all it understand.