views:

771

answers:

9

This is my very first question so I am a bit nervous about it because I am not sure whether I get the meaning across well enough. Anyhow, here we go....

Whenever new milestones in programming have been reached it seems they always have had one goal in common: to make it easier for programmers, well, to program.

Machine language, opcodes/mnemonics, procedures/functions, structs, classes (OOP) etc. always helped, in their time, to plan, structure and code programs in a more natural, understandable and better maintainable way.

Of course functional programming is by no means a novelty but it seems that it has experienced a sort of renaissance in recent years. I also believe that FP will get an enormous boost when Microsoft will add F# to their mainstream programming languages.

Returning to my original question, I believe that ultimately programming will be done in a natural language (English) with very few restrictions or rules. The compiler will be part of an AI/NLP system that extracts information from the code or should I say text and transforms it into an intermediate language which the compiler can compile.

So, does FP take programming closer to natural-language programming or is it rather an obstacle and mainstream OOP will lead us faster to natural-language programming?

This question should not be used to discuss the useability or feasability of natural-language programming because only the future will tell.

+23  A: 

Sorry, I don't agree at all. Code is ultimately a blueprint for making things (objects), so it has to be very precise and rule-governed in order to function reliably. Natural language won't take over programming any sooner than sketching ideas on napkins will take over mechanical engineering.

MusiGenesis
But if those skeches could be part of a tool for design they could get your started on the path to the final product. I like sketching up ideas for robotics, applications, and networks on my Tablet. Help with design and implmentation. Best part is on a tablet you get more than just the one drawing layer from the napkin.
Matthew Whited
I never meant to disparage napkinology. It has its place in engineering, just like natural language has its place in programming (it's for hitting on the receptionist).
MusiGenesis
+1 for hitting on the receptionist. Everyone should take programming lessons from Ross Jeffries :) ... oh, wait, different NLP *sigh*.
Charles
+8  A: 

I personally have come to the conclusion natural language programming is somewhat crack.

English is not exactly suited to be used fully as a programming language, too many abstract words that have no-correlation in programming, such as emotive terms and other abstract notions that have no place in programming, so to say programming could ever be "natural language" would follow, that "natural language" could be programming, but it isn't.

Now while I get what you're saying here, the problem is the english language has too many scrap terms and repeated names for the same things, so we'd be using something that isn't even specific to the domain of programming, for the task of programming.

I think its more suited that people understand that programming is in fact a highly specialized language, and use their brains and learn to code in a language, which is simple, declarative, and has a consistent definition, unlike English, where definition is highly subjective.

Once you learn the ins and outs of a language, and learn its schematics and behaviors, you can combine them to do new things.

Take Perl, everyone lambasts it for being line noise, but when you know many programming languages, once you get past the initial hurdles of "OMG LINE NOISE", there is a degree of intuitiveness about it where you can make stuff up you never read about and then see it magically works just as you expected.

And IMHO, domain specific languages trump spoken ones for targeted problem solving.

Kent Fredric
@Bill the Lizard: heh, proof of concept, humans understand typos. ;) Computers... will fail bad.
Kent Fredric
Could not agree more
da5id
I agree that English is not an easy language to interpret but I suppose this is true for most modern languages.
RB
@Kent: Actually, the spellchecker should have alerted you to those. :)
Bill the Lizard
@Bill: I have a spell checker. Its part of firefox. ;). Should != did. Software fails. Often it gets wrong suggestions too when it detects inaccuracy ( which a human can easily solve )
Kent Fredric
@RB: Natural languages are simply too ambiguous and imprecise. The text to describe a problem that, in a "verbose" programming language, would take 100 lines can easily need 100 pages to clarify all the ambiguitys. As an exercise: try to write a text to, unambiguously and detailed, describe a blog.
Renato Soffiatto
A blog is a chronologically indexed log file, consisting of written content with optional images and/or videos and/or sound , produced by one or more people, and made freely available to the public via the interweb-tubes. There!
defmeta
+2  A: 

I don't think that functional programming is any closer to natural language programming than OO programming. Functional programming has a very verb-oriented syntax. When you program in Lisp or Scheme, you spend a lot of time thinking about functions and what actions you want to take on your data. In OO programming, you spend most of your time thinking about objects, hence it seems very noun-oriented. However, in Smalltalk, C++, and Java, you also have methods, which allow you to apply verbs to all of your nouns (so to speak).

I don't think that OO programming will necessarily lead us to natural language programming, but from my point of view it's a little bit closer than functional programming. Functional programming, to me, seems a little bit closer to math than to natural language. That's not such a bad thing, since maybe math is the language we should be thinking in when we program anyway.

Bill the Lizard
Honoring the request of the questioner to avoid debates about the prospects and merits of natural language programming, I agree mainly with this comment that Functional programming (which is actually older than OOP) is not a step closer to whatever that is.
orcmid
I'm also not clear to me that OOP is any closer to natural language programming, despite the sometimes-heard magical belief that programming-language Objects have some intimate relationship to "real objects." That magical thinking is, for me, demonstration that OOP is not on any road to NLP.
orcmid
OOP objects don't *inherently* have a relationship to real world objects, but you can model them that way if you need to. I use and create plenty of objects that don't.
Bill the Lizard
+3  A: 

"So, does FP take programming closer to natural-language programming or is it rather an obstacle and mainstream OOP will lead us faster to natural-language programming?"

Neither. Both operate on the same principle that you have to be specific about what you want the computer to do. There must be no room for uncertainty, and neither paradigm has anything to do with natural languages. They tackle an entirely different problem: That of managing and structuring complex code and large codebases.

The big obstacle in natural languages is the parsing. It is impossible to unambiguously parse natural language. Even humans can't do it without a lot of context information (facial expressions, tone of voice), and even then, we still get it wrong quite often.

OOP and FP are only about what happens after parsing. Which meaning is assigned to each semantic element, once it's been identified and parsed.

Perhaps we'll one day be able to program in natural language. I doubt it'll happen within the next couple of decades, but it may happen one day. But today's programming paradigms will neither speed up this process or delay it. They simply have nothing to do with it, and won't help solving the parsing problem.

jalf
A: 

The current spurt of interest in Functional Programming result primarily of C# 3.0's cool new features is basically to enable parallelism and denotes a shift towards multi-core computing. IMHO, I don't think we can consider this a next step towards 'natural language programming'

Vyas Bharghava
I wouldn't say C# 3.0 in general or LINQ are primarily about parallelism. To me, LINQ is about a declarative and consistent method of data access across data sources, to whatever extent is feasible. Being able to use a functional style is handy for *much* more than just parallelism.
Jon Skeet
Jon... I feel the FP shift in C# is more of an enabler of parallelism... Perhaps Lamda expressions make my case? :) I agree with you that functional style is much more. Why wasn't C# functional from the word go then? Why now when multi-cores are the norm? ParallelFx not builds on these features?
Vyas Bharghava
A: 

If you are looking for the next evolution in programming languages, I would look to DSLs. DSL allows for highly customized languages that enable sophisticated biz users to configure a system without having to worry about coding details such as datatypes, threads and UI widgets.

Functional languages will have their place in "highly parallel processing" space.

Kozyarchuk
A: 

Do you think subjective questions will get this here order for "Windows Internals the 5th Element" added to the database and shipped to my address? If so, natural language programming will be very close to functional programming, since I asked my question in a somewhat functional manner. If not, then natural language programming won't get my order shipped, will it? Functional programming can work because it still has nothing to do with natural languages.

Windows programmer
A: 

No. Functional programming will take us closer to proving compilers. That is compilers that prove more assertions about your code. The more compilers can prove for us, the closer software development comes to be engineering rather than art.

A NLP programming language is probably more of a "do what I mean not what I say" style language. That is probably the opposite of the direction functional languages go.

"All programming languages are converging towards LISP."

Alan Oursland
+2  A: 

Just FYI, Inform 7 is probably the closest anyone has gotten to natural-language programming. It is a language for a very specific domain: writing interactive fiction, the kind of software that began with "adventure games".

Jouni K. Seppänen