Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: (OT) Where is programming headed?

by hsmyers (Canon)
on Dec 14, 2001 at 03:47 UTC ( #131837=note: print w/ replies, xml ) Need Help??


in reply to (OT) Where is programming headed?

There was (maybe still is) an author by the name of James Martin who wrote numerous books on various comp sci subjects, and whose message always seemed (at least to me) to be ”Programmers will be obsolete…“ Obviously not the case. My guess is your university and James Martin should get together.

–hsm


Comment on Re: (OT) Where is programming headed?
Re: Re: (OT) Where is programming headed?
by mstone (Deacon) on Dec 14, 2001 at 04:47 UTC

    Programmers will be necessary until someone solves the halting problem. The automatic programming problem (writing a program that writes programs for you) has been proven NP-complete.

    Even then, programmers will be necessary, because what programmers really do is translate human assumptions into symbols that a computer can manipulate. OOP, declarative programming, functional programming, descriptive programming.. they're all just frameworks on which to arrange our thoughts. Perl, C, C++, Java, Lisp.. they're just collections of symbols and primitive operations that we hang on a particular framework.

    The really hard part of programming is learning to think without contradicting oneself. When you tell a computer to contradict itself, it can extrapolate that contradiction into a database full of gibberish right smart quick. Humans, OTOH, are so good at dealing with ambiguity that we can hold self-contradictory opinions without ever noticing.

    Human thought is by nature fuzzy and ill-defined. We can identify a bear well enough to run away from it, while we're still far enough away that running will work. We don't care about its exact weight, or how many hairs are in its pelt, because finding out has never been a major survival trait.

    Computers, by contrast, are excruciatingly precise. the C code:

    float x, y; x = 1; y = 1; if (x == y) { printf ("they match.\n"); } else { printf ("close, but no cigar.\n"); }
    will fail as often as not, due to microscopic differences in the interpreted values of those two variables.

    Programmers take ideas from the fuzzy, human, "oh crap, a bear!" realm, and polish them until they work in the meticulous, "can't tell if 1 really equals 1" computer realm.

    That's not easy.

    You can always find people who'll say that computers should be able to write programs that whatever we tell them we want, and in a sense, that's true. The problem is that most people don't know what they want well enough to explain it to another human, let alone a computer.

    mike
    .

      I think I might agree with your main point, but I'd suggest that in the future you avoid using technical jargon when you're not exactly sure what it means. For example:

      Says mstone:

      Programmers will be necessary until someone solves the halting problem. The automatic programming problem (writing a program that writes programs for you) has been proven NP-complete.

      I'm not sure what you mean here, and most of the obvious interpretations are false. If you mean that it's impossible to write a program that writes programs, that's wrong, because I have a program here that I use every day that takes an input specification and writes a machine language program to implement that specification; it's called gcc. Programs write other programs all the time.

      I doubt if there's any meaningful sense in which "the automatic programming problem" (whatever that is) can be shown to be NP-complete. If you mean that it's equivalent to the halting problem, you might also want to note that the halting problem is not NP-complete, and revise accordingly.

      You said that the C code will fail "as often as not":

      float x, y; x = 1; y = 1; if (x == y) { ... }
      But you're mistaken; the result of the test is guaranteed to be true. Certain float values can be compared exactly, and 1 is among those values.

      In general, if two floats both happen to represent rational numbers whose denominators are both powers of 2, and if neither float's significand exceeds the available precision, then the values are represented exactly and can be compared exactly. In particular, integral values less than about 253 will be represented and compared exactly.

      So while I think you may have good points, the factual errors in your note spoiled its persuasiveness for me.

      Hope this helps.

      --
      Mark Dominus
      Perl Paraphernalia


        > > Programmers will be necessary until someone solves the halting
        > > problem. The automatic programming problem (writing a program that
        > > writes programs for you) has been proven NP-complete.
        >
        > I'm not sure what you mean here, and most of the obvious
        > interpretations are false. If you mean that it's impossible to
        > write a program that writes programs, that's wrong, because I have
        > a program here that I use every day that takes an input
        > specification and writes a machine language program to implement
        > that specification; it's called gcc. Programs write other programs
        > all the time.

        gcc doesn't 'write programs' per se, it just translates programs you've written in one formal language (C) to another formal language (machine code).

        Automatic programming boils down to the deep theoretical question of whether all programming can be reduced to a finite set of generative postulates, the way, say, algebra can. If that were true, programmers would be unnecessary. A few supercomputers with theorem-proving software could sift their way through all the permutations, spitting out every possible well-formed program along the way.


        > I doubt if there's any meaningful sense in which "the automatic
        > programming problem" (whatever that is) can be shown to be
        > NP-complete. If you mean that it's equivalent to the halting problem,
        > you might also want to note that the halting problem is not
        > NP-complete, and revise accordingly.

        I misspoke.. the automatic programming problem is AI-complete, not NP-complete. The halting problem is, indeed, impossible to solve with a Turning machine, which I believe Von Neumann classified as a 'type-0' computer.

        However, a Von Neumann 'type-1' computer (if I've got the numbers right), can solve the halting problem. A type-1 Von Neumann machine has an infinite tape full of ones and zeros, where the address of each cell corresponds to a unique C program, and the value of each cell is a boolean that says whether the program halts or not. In other words, it's a giant lookup table.

        Right now, we don't know if that binary sequence can be found by any means other than brute-force examination of every possible program. However, if programming can be reduced to a finite set of generative postulates, it may be possible to calculate the value of any given bit in finite time. It might even be possible to calculate that value with a Turing machine.. in which case, we could sidestep the current proof for the halting problem's unsolvability without actually contradicting it.

        Either way, my original assertion still stands. A solution to the halting problem would generate a solution to automatic programming, and vice versa.


        > But you're mistaken; the result of the test is guaranteed to be true.
        > Certain float values can be compared exactly, and 1 is among those
        > values.

        Point taken, though one could probably call that a compiler issue.. IIRC, the ANSI-C spec defines all floating-point representations in terms of a minimal error variable elim.

        Please insert the code necessary to calculate the square root of 2.

        mike
        .

        Dominus

        >> integral values less than about 253 will be represented and compared exactly

        Since this OT is turning into a C refresher course, factual accuracy should be in order. Your statement is true of C/C++ double, which is also what Perl uses for numeric values. The example  float x, y; declares a couple of single-precision floats, which can represent exactly integral values of up to about 225.

        A summary of IEEE-754 format can be found here and an interactive converter here.

        Rudif

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://131837]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2014-07-31 23:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (255 votes), past polls