Re: Natural language programming?
From: FM (dartdanfm_at_yahoo.com)
Date: 11/07/03
- Next message: FM: "Re: Natural language programming?"
- Previous message: Baruch Vainas: "Re: How to get into Scientific Programming"
- In reply to: Roger Johansson: "Re: Natural language programming?"
- Next in thread: Roger Johansson: "Re: Natural language programming?"
- Reply: Roger Johansson: "Re: Natural language programming?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 07 Nov 2003 06:13:50 GMT
"Roger Johansson" <no-email@home.se> wrote:
> I think it is encouraging with a natural language programming
> language. It means that you can understand it with only common
> knowledge.
The problem is that there are many things you can do in
various programming languages that you cannot understand
it with only common knowledge, no matter how you express
it. The other problem is you can't possibly unambiguously
parse any language that is anywhere near as complicated as
any human language, the language becomes highly error-prone
and extremely difficult. The whole point of high-level
programming languages is that they allow you to express and
compute complex things precisely. Human languages, without
these extensions (programming languages are an extension of
human languages in that they are used by humans to
communicate with one another) don't allow you to do that.
> Let me take an old example:
>
> Earlier Basic used this to set a variable:
> a = 3
> Sinclair Spectrum basic:
> Let a = 3
> I can think of an even wordier way to say it:
> Let variable a be 3
Quite frankly, do you think figuring out how to set
variables is what programmers spent a lot of their time
on?
> (this would be easy to understand without any training)
> Or use this as an automatically added comment:
> a = 3 ;Let variable a be 3
This is worse than useless. If someone doesn't know the
language well enough to already know what 'a = 3' in that
language means, then he shouldn't be programming in it.
That comment conveys no extra information whatsoever and
simply adds clutter.
> As we get more available space in our computers it is no longer
> necessary with abbreviated expressions, we can use more natural
> language in programming.
Human time is still precious, however, and people do need
to read reasonably fast. This means you want to have
syntactic rules that are unambiguous, easy to learn and
use accurately. You should probably learn about formal
grammars (either a programming language course in CS or a
syntax course in Linguistics would be sufficient) before
rambling any further. Parsing is not an easy task for
computers or humans.
> With more resources available it is no longer necessary for the
> programmer to declare variables and types, such things can be taken
> care of by the computer.
What on earth are you talking about? Type declarations
are not there because computers are resource-hungry, but
rather to allow programmers to express and document
certain things. Type inference (as in ML, Haskell, etc)
has been around for decades now. Untyped languages have
been around for even longer.
> Unfortunately there is also a tendency for creation of elites with
> secret languages in our social culture, and that tendency has
> influenced the field of programming.
That applies more to human languages in general. Every
culture develops its own lexicon and language, which
become indistinguishable from the culture itself. Just
about every human word, or morpheme even, started out
that way.
> One possibility is to have different levels of clarity and "wordyness"
> built into the programming language. The user could set the editor for
> his own level when he reads or writes a program.
>
> Beginner level:
> Let variable a be 3
> Intermediate level:
> Let a = 3
> Expert level:
> a = 3 (a AS Long)
There are so many problems with this idea that it's not
even funny.
If you can't deal with the very minimal levels of precision
of expression required by language grammars, you shouldn't
engage in programming, which often requires much higher
degrees of precision.
Dan.
- Next message: FM: "Re: Natural language programming?"
- Previous message: Baruch Vainas: "Re: How to get into Scientific Programming"
- In reply to: Roger Johansson: "Re: Natural language programming?"
- Next in thread: Roger Johansson: "Re: Natural language programming?"
- Reply: Roger Johansson: "Re: Natural language programming?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|