Re: Writing A Plain English Compiler

"BartC" <bc@freeuk.com>
Sun, 9 Nov 2014 01:16:41 -0000

          From comp.compilers

Related articles
[6 earlier articles]
Re: Writing A Plain English Compiler bc@freeuk.com (BartC) (2014-11-08)
Re: Writing A Plain English Compiler Pidgeot18@verizon.net (=?UTF-8?Q?Joshua_Cranmer_=f0=9f=90=a7?=) (2014-11-07)
Re: Writing A Plain English Compiler gerry.rzeppa@pobox.com (Gerry Rzeppa) (2014-11-08)
Re: Writing A Plain English Compiler gerry.rzeppa@pobox.com (Gerry Rzeppa) (2014-11-08)
Re: Writing A Plain English Compiler portempa@aon.at (Richard Hable) (2014-11-08)
Re: Writing A Plain English Compiler Pidgeot18@verizon.invalid (=?UTF-8?Q?Joshua_Cranmer_=f0=9f=90=a7?=) (2014-11-08)
Re: Writing A Plain English Compiler bc@freeuk.com (BartC) (2014-11-09)
Re: Writing A Plain English Compiler tk@ic.unicamp.br (Tomasz Kowaltowski) (2014-11-10)
Re: Writing A Plain English Compiler gerry.rzeppa@pobox.com (Gerry Rzeppa) (2014-11-10)
Re: Writing A Plain English Compiler martin@gkc.org.uk (Martin Ward) (2014-11-10)
Re: Writing A Plain English Compiler gerry.rzeppa@pobox.com (Gerry Rzeppa) (2014-11-10)
Re: self-hosting, was Writing A Plain English Compiler portempa@aon.at (Richard Hable) (2014-11-11)
Re: self-hosting, was Writing A Plain English Compiler bc@freeuk.com (BartC) (2014-11-11)
[3 later articles]
| List of all articles for this month |

From: "BartC" <bc@freeuk.com>
Newsgroups: comp.compilers
Date: Sun, 9 Nov 2014 01:16:41 -0000
Organization: virginmedia.com
References: 14-11-004 14-11-005 14-11-007 14-11-014 14-11-016
Keywords: design, comment
Posted-Date: 10 Nov 2014 03:14:27 EST

> Gerry:
> I don't think it's at all rare for a new language to be "written in
> itself".
> (Though many of today's most popular languages are not: Javascript, for
> example.) It is somewhat more rare to have a complete development
> environment
> written in the new language; and quite rare for a compiler-writer to
> "prove"
> his language by writing a wysiwyg page-layout facility in his new language
> and then use that facility to produce the documentation for the language.


(Probably not so rare; it's what I used to do and still do. Because once a
language is working enough to be useful, then why shouldn't it be used for
whatever tasks happen to come up? It's a good test of language and
implementation.


Self-hosting (implementing a language in itself) is a nice touch, but
I don't think it's that important, perhaps because people are
realising that the best language to implement a compiler in, is not
necessarily the language that is being compiled. Unless of course you
are trying to use a single language for everything.)


> And extremely rare for the whole thing to be written in English-language
> sentences. Point me to some English-sentence compilers (or even
> interpreters) written in English: SIRI? No. Alpha? No. Inform? No.


I've looked at your project in a little more detail. It seems quite
interesting, but I think the Plain English aspect is obscuring the
rest of the project.


It's an odd mix of high and low level features, for example there is
even some inline machine code in there! (In 'the noodle', so perhaps
it isn't implemented quite 100% in itself, unless this is some
temporary bootstrapping or other code.) Then there are direct calls to
Win32 functions.


Plus there is lots of code that would be written in pretty much the
same way in nearly every other language, but the need to pretend it is
plain English just adds clutter. One example:


a uuid is a record with
    a number called d1,
    a wyrd called d2,
    a wyrd called d3,
    8 bytes called d4.


(I would guess someone savvy enough to know what to do with a UUID can
probably be trusted with some conventional syntax.)


What's not clear is whether an expression such as A+B*C needs to be
written as 'Multiply B by C then Add A', or whatever it might be. See,
people who had known perfectly well how to write such an expression,
are now reduced to guessing! I think anyone who's been to school would
be able to cope with writing algebraic expressions. (I take it that
numeric constants are allowed to use digits and don't have to be
written out in words.)


So in many ways the language is conventional (apart from it's many
restrictions: no nested statements for example); so what does plain
English add except long-windedness and clutter (and which can't be
done for viewing purposes by a translator or a smart editor)?


You're right that it is rare to use natural English as a basis for syntax,
but perhaps there are good reasons for that!


--
Bartc
email: change @ to as@ in bc@freeuk.com
[Even COBOL has COMPUTE A=B+C+D as an alternative to
ADD B TO C TO D GIVING D (or something like that.)
English isn't a very good way to describe algorithms
once they get at all complicated. -John]


Post a followup to this message

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