Prev: Symbolic tracebacks on Debian (Was: About static libraries and Debian policy)
Next: Gnat cross compiler
From: Yannick Duchêne (Hibou57) on 25 May 2010 13:36 Le Tue, 25 May 2010 11:05:06 +0200, Dmitry A. Kazakov <mailbox(a)dmitry-kazakov.de> a écrit: > People are bad, they were created to kill, steal, become obese and > program > in C. You cannot change that. Seems obvious this activity cannot be ripped apart the rest of the world/humanity. It is mostly done like others human stuff are done. However, computer science is still one which is done the nicer. Yes, there are flow, but at least, a bug is to be fixed when discovered and it is mostly done sooner or later, even if not always the better way. Just compare that to administrations and civil services, which proudly enforce there own bugs more years or two or three century. At least, with computer science, even with C, you will never see someone to be proud of numerous existing bug and maintain and sustain this as much as they can. Just to say that, yes, human is what it is, but computer science is one of the best place where although not all is nice, things goes better than with anything else. -- There is even better than a pragma Assert: a SPARK --# check.
From: Ludovic Brenta on 25 May 2010 13:42 Dmitry A. Kazakov writes on comp.lang.ada: > P.S. I bet Ada is better for writing a C compiler than C. I don't think so; human factors would get in the way. A programmer proficient in Ada might start doing this but would eventually give up and write a Pascal compiler instead :) -- Ludovic Brenta.
From: Yannick Duchêne (Hibou57) on 25 May 2010 14:06 Le Tue, 25 May 2010 16:24:20 +0200, Georg Bauhaus <rm.dash-bauhaus(a)futureapps.de> a écrit: > Yes. Ada/Ed, though, being an Ada 83 interpreter, being > written in SETL, not C, and being prototypical for GNAT, > indicates that C is not necessarily the single language for > writing high class compilers---as some have implied. > I'm sure you know that is the case for some other languages, > too. > GNAT is one compiler where everyone can convince themselves, > since the sources are open to the public. Depends on the initial state. For precursor or near to be so, this starts with a bootstrap sequence : the compiler is written either in assembly, or C (or may be Basic), or something of the like. This state is short, and as soon as possible it is rewritten in the compiler's target language itself, and it's funfair time when the compiler is able to compile it self (a great and memorable moment of history). This first part of the history is short, then after, all goes with the compiler's target language (or a subset for safety and stability insurance). FreePascal is written in FreePascal. GCC is written in (GNU)C GNAT is written in Ada Janus (as far as I know and read about) is written in Ada SmallEiffel and its successor SmartEiffel was written in Eiffel. There are a few assembly written in assembly. For other kind of language, that's a bit different : you have some Prolog interpreters written in LISP and some LISP interpreters written in Prolog (for fun and proof of some concept... and it shows both are indeed Turing machines). This draw the line below which a language is an implementation language or a Domain Specific Language. If a compiler can be advantageously (mostly with efficiency in mind) written in it's target language, then, this target language is an implementation language. If not, it is probably a DSL (Domain Specific Language), like Prolog and LISP are (well, to be honest, LISP is a special case, as it could be an implementation language on some architectures ; assembly is a special case also). To be inquisitive : do some one have an idea of the implementation language of Basic interpreter and compilers ? I do not have an idea. -- There is even better than a pragma Assert: a SPARK --# check.
From: Yannick Duchêne (Hibou57) on 25 May 2010 14:08 Le Tue, 25 May 2010 18:15:40 +0200, J-P. Rosen <rosen(a)adalog.fr> a écrit: > In most programming languages, there is a relation between the structure > of the language itself and the kind of data it handles best. For this > reason, and others like ease of porting, it is generally a good idea to > write the compiler in its own language, safe for special cases like > initial bootstrapping. That is. -- There is even better than a pragma Assert: a SPARK --# check.
From: Yannick Duchêne (Hibou57) on 25 May 2010 14:13
Le Tue, 25 May 2010 19:34:43 +0200, Dmitry A. Kazakov <mailbox(a)dmitry-kazakov.de> a écrit: > 2. Practically, is there any SQL parser written in SQL? Because SQL is a DSL. > P.S. I bet Ada is better for writing a C compiler than C. May be or may be not. This can be done well in C too (the author is as much important as the implementation language) and then, C advocators will obviously try to create it using C. So C is most likely to be the choice.. Ada would be better for some reason, but the final product and the source is not the same thing. If the product is good, this does not matter for users if the source is hard to maintain and understand. -- There is even better than a pragma Assert: a SPARK --# check. |