Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1428

Re: Writing A Plain English Compiler

From "BartC" <bc@freeuk.com>
Newsgroups comp.compilers
Subject Re: Writing A Plain English Compiler
Date 2014-11-09 01:16 +0000
Organization virginmedia.com
Message-ID <14-11-020@comp.compilers> (permalink)
References <14-11-004@comp.compilers> <14-11-005@comp.compilers> <14-11-007@comp.compilers> <14-11-014@comp.compilers> <14-11-016@comp.compilers>

Show all headers | View raw


> 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]

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-04 15:50 -0600
  Re: Writing A Plain English Compiler Joshua Cranmer 🐧 <Pidgeot18@verizon.net> - 2014-11-05 00:54 -0600
    Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-06 18:52 -0600
      Re: Writing A Plain English Compiler Joshua Cranmer 🐧 <Pidgeot18@verizon.net> - 2014-11-07 22:54 -0600
        Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-08 02:41 -0600
        Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-08 03:46 -0600
          Re: Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-09 01:16 +0000
            Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-10 14:37 -0600
            Re: self-hosting, was Writing A Plain English Compiler Richard Hable <portempa@aon.at> - 2014-11-11 19:50 +0100
              Re: self-hosting, was Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-11 23:33 +0000
                Re: self-hosting, was Writing A Plain English Compiler anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-11-12 08:46 +0000
                Re: self-hosting, was Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-12 11:15 +0000
              Re: self-hosting, was Writing A Plain English Compiler anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-11-12 08:40 +0000
    Re: Writing A Plain English Compiler "BartC" <bcas@freeuk.com> - 2014-11-07 11:36 +0000
    Re: Writing A Plain English Compiler George Neuner <gneuner2@comcast.net> - 2014-11-07 16:23 -0500
      Re: Writing A Plain English Compiler Richard Hable <portempa@aon.at> - 2014-11-08 17:22 +0100
      Re: Writing A Plain English Compiler Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-11-08 10:48 -0600
        Re: language design models, was Writing A Plain English Compiler George Neuner <gneuner2@comcast.net> - 2014-11-09 14:30 -0500
          Re: language design models, was Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-10 03:29 -0600
          Re: Writing A Plain English Compiler Tomasz Kowaltowski <tk@ic.unicamp.br> - 2014-11-10 09:13 -0200
            Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-10 17:19 -0600
      Re: matching tasks to languages, was Writing A Plain English Compiler Gene Wirchenko <genew@telus.net> - 2014-11-10 15:37 -0800
    Re: Writing A Plain English Compiler Martin Ward <martin@gkc.org.uk> - 2014-11-10 22:56 +0000
  Re: Writing A Plain English Compiler "BartC" <bcas@freeuk.com> - 2014-11-07 11:39 +0000
    Re: Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-08 00:35 +0000
  Fundamentals for a Compiler and Language (was: Writing A Plain English Compiler) federation2005@netzero.com - 2014-12-29 13:30 -0800

csiph-web