Re: Strings again

"Roger Binns" <[email protected]> Sat, 31 Jul 2004 16:43:13 -0700
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Mark Hahn wrote:
> OK then, what does Prothon have to do to be one of these "next
> generation languages"?
>
> You make it sound impossible, but you must believe it can be done if
> you think a new generation is going to do it.  My experience says
> that this kind of thing is accompished by breakthroughs in simple
> creative approaches, not by some kind of brute force "program every
> possbility" approach.  So what new breakthrough is going to make this
> happen?

Actually I think rediscovering some stuff from the mainframe
world is what it will take :-)  The I/O "structure" was usually
forms or "structure" based, generally geared around full screen display
or reading an entire record from a database.  To a certain extent
I/O in HTML/XML is the same sort of thing (form/structure based).

I don't know the easy answer as to how to express this, but I do
know that the right code looks elegant, and potentially follows the
structure of the output (ie indentation levels in the code formatting
follow nesting in the output/input).  I would expect the print statement
to be told which bit of the structure I am outputting, and something
similar for inputting data.

As a simple example, take this:

  print "Hello, here are some numbers"
  for i in range(1,11):
      print i

Maybe the "right" thing looks like:

  print "Hello, here are some numbers"     !TITLE!
  for i in range(1,11):                    !LIST!
      print i                              !ITEM!

(I invented ! as the syntax but it could be anything).

On a teletype, the output should be the same as the first
version.  In HTML it should be

<html><head><title>Hello, here are some numbers</title></head>
<body><ul>
<li>1</li>
<li>2</li>
....
</ul></body></html>

XML would be somewhat different, but you get the idea.  In
theory a gui interface could automatically happen as well.

Anyway that is a strawman - I think it could be done a lot
better but don't have any proposals.

Roger