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


Groups > comp.compilers > #1393

Re: A Plain English Compiler

From Martin Ward <martin@gkc.org.uk>
Newsgroups comp.compilers
Subject Re: A Plain English Compiler
Date 2014-10-27 11:54 +0000
Organization Compilers Central
Message-ID <14-10-008@comp.compilers> (permalink)
References <06-02-122@comp.compilers> <06-02-125@comp.compilers> <14-10-005@comp.compilers>

Show all headers | View raw


On 25/10/14 00:33, gerry.rzeppa@pobox.com wrote:
> [Note that this is a followup to some messages from 2006.  See
> http://compilers.iecc.com/comparch/article/06-02-122 - John]
>
> We've decided to take this thing to its logical conclusion. See
> https://www.indiegogo.com/projects/the-hybrid-programming-language

John said (back in 2006) "You can certainly chop English down to
a small unambiguous subset, but then you've just reinvented Cobol"

As someone who has had to work with COBOL somewhat, it is interesting
to compare the two languages:

"Plain English" is even more verbose that COBOL, for example:

   put the picture's gpbitmap's width minus 1 times the tpp into the
picture's box's right.

I assume that this means:

picture.box.right = (picture.gpbitmap.width - 1) * tpp

and not:

picture.box.right = picture.gpbitmap.width - (1 * tpp)

since the latter has a redundant multiplication.
This means that multiplication does not take precidence
over addition in "Plain English" (unlike in mathematics).

The language does not have formulae at all (unlike COBOL), although
these are planned to be added. When formulae are added, I assume that
they will follow the usual rules of arithmetic: in which case the
discrepency between the "verbose" style and the "formula" style will
become even more confusing!

In COBOL, the above statement could be written:

COMPUTE RIGHT OF BOX OF PICTURE = (WIDTH OF GPBITMAP OF PICTURE - 1) * TPP

COBOL has a large number of machine-independent data structures:
strings, packed decimal, binary decimal and floating point.
For example, packed decimals can have up to 31 digits plus
a (fixed) decimal point and a sign. So you can process numbers
up to 9,999,999,999,999,999,999,999,999,999,999.
"Modern" COBOL (i.e. COBOL 2002 and later) includes bit manipulation,
recursion, user-defined functions and other features.
(Although, IBM has not yet implemented COBOL 2002 in their mainframe
compiler: having only had 12 years or so to work on it!).

"Plain English" only has 8 bit unsigned and 16 and 32 bit signed
binary numbers, 32 bit pointers, strings and records.
So "Plain English" cannot handle any number bigger than 2,147,483,648.
There are also "ratios" which appear to be represented as a signed
numerator and unsighed denominator. I don't know what you do if you
want to address more than 4GB of RAM, or, for that matter, work with
floating point numbers!

Strings appear to be represented using the Windows-1252 character set
-- no Unicode for you!

In old-fashioned (pre-2002) COBOL you had to use a whole byte to
implement a flag: or encode several flags into one data item with some
complicated coding to access and update them.  In "Plain English" a
single flag takes 32 bits of storage: which seems a step backwards to
me!

"Plain English" has numeric operations: plus, minus, times and divided
by (with optional remainder), but no power operation.

Finally: there are no nested IF statements and no nested loops.
How do you process a two-dimensional array without a nested loop?
Well, since there are no two-dimensional arrays in the language,
(or even one-dimensional arrays, for that matter), you don't have
to worry about that!

Routines can declare local data: but since each routine has to be
extremely short (due to the lack of nesting of conditionals
or loops), any time you need a nested conditional or loop
you have to split the code into separate routines: which means
that any shared data has to be global variables!

--
			Martin

Dr Martin Ward STRL Principal Lecturer & Reader in Software Engineering
martin@gkc.org.uk  http://www.cse.dmu.ac.uk/~mward/  Erdos number: 4
G.K.Chesterton web site: http://www.cse.dmu.ac.uk/~mward/gkc/
Mirrors:  http://www.gkc.org.uk  and  http://www.gkc.org.uk/gkc

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


Thread

Re: A Plain English Compiler gerry.rzeppa@pobox.com - 2014-10-24 16:33 -0700
  Re: A Plain English Compiler lesliedellow@gmail.com - 2014-10-25 06:01 -0700
    Re: A Plain English Compiler "Derek M. Jones" <derek@knosof.co.uk> - 2014-10-25 19:51 +0100
    Re: A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-10-30 14:53 -0500
  Re: A Plain English Compiler Martin Ward <martin@gkc.org.uk> - 2014-10-27 11:54 +0000
    Re: A Plain English Compiler Kartik Agaram <ak@akkartik.com> - 2014-10-27 12:25 -0700
      Re: A Plain English Compiler Kaz Kylheku <kaz@kylheku.com> - 2014-10-27 21:45 +0000
        Re: reading and writing, was A Plain English Compiler Stefan Monnier <monnier@iro.umontreal.ca> - 2014-10-28 17:37 -0400
        Re: A Plain English Compiler Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2014-10-29 01:28 +0100
          Fw: A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-10-30 04:02 -0500
        Re: A Plain English Compiler mac <acolvin@efunct.com> - 2014-11-03 13:15 +0000
      Re: A Plain English Compiler Ivan Godard <ivan@ootbcomp.com> - 2014-10-27 15:07 -0700
      Re: A Plain English Compiler Martin Ward <martin@gkc.org.uk> - 2014-10-28 15:14 +0000
        Re: A Plain English Compiler Stefan Monnier <monnier@iro.umontreal.ca> - 2014-10-28 17:33 -0400
        Re: A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-10-30 17:05 -0500
          Re: A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-10-31 01:05 -0500
            Re: A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-10-31 21:22 -0500
      Fw: A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-10-30 04:01 -0500

csiph-web