Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: english plz  (Read 1520 times)

waldo

  • Bay Watcher
    • View Profile
english plz
« on: July 31, 2009, 05:03:01 am »

so i was reading simple.wikipedia.com about computers, when i read "computers do not speak english but instead speak a multitude of different languages. anyways i'm probably am going to be slapped in the face by many programmers for this but why can't we teach computers english as a programming code?

i mean the diversity of the english language alone is enough to properly explain what i would believe to be most if not all of a computers action, and then there are languages like Chinese which has over 4000 characters.

so why can't we just build a terminal that can decide what code is needed to follow through with the english command? it would probably make programming a lot more easier for newbies but i would imagine trip up the more weary of us.

i guess i would just rather tell a computer to "make an emulator, now make it dual processor compatible." then actually tell it a long list of codes to first make the emulator then make it multi processor compatible. i can't wait for freaking A.I.
Logged

Rilder

  • Bay Watcher
  • Rye Elder
    • View Profile
Re: english plz
« Reply #1 on: July 31, 2009, 05:13:41 am »

Computers don't speak unless you tell them to speak.
Logged
Steam Profile
Youtube(Let's Plays), Occasional Streaming
It felt a bit like a movie in which two stoners try to steal a military helicopter

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: english plz
« Reply #2 on: July 31, 2009, 05:17:23 am »

Or more accurately, spend years of trial-and-error programing to teach them how to speak.
Logged
And here is where my beef pops up like a looming awkward boner.
Please amplify your relaxed states.
Quote from: PTTG??
The ancients built these quote pyramids to forever store vast quantities of rage.

DJ

  • Bay Watcher
    • View Profile
Re: english plz
« Reply #3 on: July 31, 2009, 05:17:41 am »

The programming languages are about as close as you can get to English while maintaining a coherent and internally consistent system.
Logged
Urist, President has immigrated to your fortress!
Urist, President mandates the Dwarven Bill of Rights.

Cue magma.
Ah, the Magma Carta...

IndonesiaWarMinister

  • Bay Watcher
    • View Profile
Re: english plz
« Reply #4 on: July 31, 2009, 05:25:59 am »

The programming languages are about as close as you can get to English while maintaining a coherent and internally consistent system.

This.
* IndonesiaWarMinister ♥ Python.
Logged

Jack_Bread

  • Bay Watcher
  • 100% FRESH ♥HIPPO♥
    • View Profile
Re: english plz
« Reply #5 on: July 31, 2009, 05:35:10 am »

I don't understand this thread.

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: english plz
« Reply #6 on: July 31, 2009, 05:46:51 am »

Assembly for the win!
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Starver

  • Bay Watcher
    • View Profile
Re: english plz
« Reply #7 on: July 31, 2009, 06:37:15 am »

I'm quite surprised about the reported wording of the Wiki regarding speaking many languages.  Sounds like bad editing of the page.  I'll have a look at that, later, and see if I think I'm up to modifying the statement for clarity.

As for using plain English, attempts have been made to allow computers to respond to understand 'natural language', but that's really only at the User Interface level ("Please open the document that I wrote yesterday"), not for writing programs.  Even the Hollywood-style depictions of computer interface where "Search the database for all even-numbered ID codes and check the owners against the list of all blue cars" is not programming, so much as natural language being parsed for sense.  A parsing which might or might fall down on such input as "A canner can can anything that he can.  Can a canner can a can, can he?", depending on sophistication.

The closest language I've encountered (and, truly, I found it a depressing language for various reasons) to one that takes plain English is Cobol.  See http://en.wikipedia.org/wiki/COBOL#Syntactic_features for the kind of thing.  It was (not checking even Wiki for this, just repeating what I remember the teacher told me, 20-odd years ago) designed for "ordinary businessmen" to be able to program it.

I suspect that it wasn't so much the writing that was supposed to be 'natural' (there were so many restraints regarding line indentation, and of course the vocabulary, while very "English", was constrained almost exactly as much as any other language, if not more so), but the ability to read it without needing a "geek's eyes" for symbols and their meanings.

Compare with the likes of LISP (see http://en.wikipedia.org/wiki/Lisp_(programming_language)#Examples) or Forth or Fortran (http://en.wikipedia.org/wiki/Fortran#Simple_Fortran_II_program).  Though my current favourite for prototyping general problems (not requiring specific language features) is Perl.

Indeed, Perl is a lot easier to write than COBOL (in my opinion) because of the multiplicity of possible methods[1], e.g. the following five (more or less) identically-functional lines:
Code: [Select]
if (@list) { print "We have a list" }
print "We have a list" if (@list);
(@list)?print "We have a list":;
print "We have a list" unless (!@list);
@list && print "We have a list";
(Doing that off the top of my head, so I've probably typoed or brainoed something.  And I've not even delved into using "$#list" or "int(@list)" variants.)

It's not really English (unless you're happy with the "if" and "unless" keywords and flexible grammar making it English, and ignore the various parenthises and other strange punctuation).  An easy language to write (when you know what you want to do, you can usually think of a way it can be done even if you don't know all the possible tricks and shortcuts that others might use) but can be hard to read (because even if you wrote it, it can be horribly obfuscated and/or untidy when you come to read it after the fact).


Truly, if you want to actually make a computer do exactly what you want, understand its internals and work at the lowest level of code that you are able to, without having to reinvent the wheel for every trick.  That could be batch file (or shell script) where you don't have to worry about much except piping file contents through a FIND/grep command and then through your favourite paging utility, or perhaps you need to peek and poke at your serial port to make your fax-modem do rather unorthodox things that were never allowed for by the deamons or drivers.

Slightly Ninjaed by Armok, here, but learn assembly-language and you can make your machine (and all compatible ones) spin on a dime.  Nevertheless, if you just want to regularly display the number of lines in a file containing the word "Mother", you might as well put FIND /C "Mother" FILENAME.EXT in a batch file, rather than waste time with DiskIO and the like at a low level.  This is what I understand about "Computers speak many languages".  And English (or virtually any other human language) is going to be second-best to a suitable computer language.

As for taking an instruction such as "make an emulator, now make it dual processor compatible", look at http://en.wikipedia.org/wiki/DWIM.  And I see that also links to http://www.catb.org/~esr/jargon/html/D/DWIM.html, which I was also going to suggest, to highlight the problem of a typo-correcting DWIM function. ;)


[1] COBOL might be more flexible than I remember.  It was a couple of decades ago when I last touched it, and I've slept since.
Logged

Chutney

  • Bay Watcher
    • View Profile
Re: english plz
« Reply #8 on: July 31, 2009, 09:48:20 am »

It's already been explained far better than me, but the problem with trying to make a computer understand "make an emulator, now make it dual processor compatible" is that while a computer can 'understand' many languages, it can only interpret basic commands. Like how a dog can be taught to sit on command in any language, but you can't tell it to run 3 laps around your house, hop on it's hind legs 5 times, and then roll it's way into your house.
I also think a direct english programming language would be very time consuming to code in.
Code: [Select]
while (1==1){
Method();}
would look like this:
Code: [Select]
Whenever 1 is equal to 1, move to the method that is named 'Method' and give it no arguments.

And let's not forget how complex English actually is, with multiple ways to say the same thing, or a single way to say multiple things. It would not be pretty to code like that.
Logged

Starver

  • Bay Watcher
    • View Profile
Re: english plz
« Reply #9 on: July 31, 2009, 10:30:02 am »

I also think a direct english programming language would be very time consuming to code in.
Code: [Select]
while (1==1){
Method();}
would look like this:
Code: [Select]
Whenever 1 is equal to 1, move to the method that is named 'Method' and give it no arguments.
It could be more simply phrased in (or from) English as "Continually run Method".

So when someone has already 'told' their computer "I want you to download the dwarf fortress main web page, at the address you already know about, and see if the latest version is newer than the one I have now.  If it is, download that package and extract to that folder" (or, "check DF home page and download any new version to here", or any other shorter version") they can then say "and that's what I mean when I say 'Method'" and then follow with the above.

(Of course, I'd suggest the user should insist it be modulated by "if you haven't checked in the last 24 hours" or some other time-limiter, if they or the developer/provider haven't already 'programmed' in a phrase such as "when I ask for a web-page check, don't bother if you did it relatively recently", and the computer understands the appropriate magnitude of "relative recentness" to apply to forums, daily lottery draw result pages and various software development pages.)

The above was not written to support the idea of easy natural language control.  As already pointed out, it isn't trivial to implement...  probably as the inverse square (or worse!) to the apparent triviality at the user-end of the process.  But like the fact that the abreviation "doubleyou doubleyou doubleyou" has more syllables than "world wide web", with a library of background knowledge a simple phrase could translate into a complicated program.  It's the library (combined from both user and developer input) that would overwhelmingly count.  And if you have no idea how to do things (like translating from Romanian to Navaho) then you need to have had someone else already let the computer know how to do that for you to say "Translate that document from Romanian to Navaho"...  And if you do, but have to input the resources into the system, you have to spend a lot of time talking about noun-subject-verb orders, tenses and plurals, actual 1:1 translations of words, mutations, symbolic and/or alphabetic equivalences, etc, before you can utter the above phrase and get something useful out.

Not that this example task is easy without the reliance upon natural language, and there may even be some advantage when a computer already 'thinks' it understands the complexities of human language, and thus has the groundings in potential ambiguities, florid phrasing and even humour, in order to recognise, deconstruct, and reinstate such occurances in an equivalent (or best-effort) manner in the destination language...  Swings...  Meet roundabouts!
Logged

waldo

  • Bay Watcher
    • View Profile
Re: english plz
« Reply #10 on: July 31, 2009, 01:28:39 pm »

you see though it might be easier for you to type up a simple two lined code, but, for a beginner like me not only will it take me a while to figure out what it does and how but even typing it up will seem unnatural and alien using all the punctuation marks to work as different on off codes. while it may be longer, typing "continually run method" would be easier for me to use.

and if the English language isn't as compatible with programming language then how is it that you guys can so easily interpret most code as an English sentence and/or command. it may be far off in the future but when i was wishing for a.i., i was wishing for an easy way around this. by letting the robot decide what code is necessary to follow through with the command given it can do a process that employed programmers, to my knowledge at least, do when the boss comes down and asks them to build a shiny new game/program that does this, that, and at a location that looks like this.

the english language isn't without it's downfalls and misunderstandings, but that hasn't stopped a lot of people from understanding it just fine it also has room for accidents, if you accidentally leave a word out of a sentance because you were talking fast the other person can still know what your saying based partly on the actual words, your facial expressions, the mood of the sentence, and your hand gestures.
Logged

SniHjen

  • Bay Watcher
    • View Profile
    • http://www.youtube.com/user/Hacenten
Re: english plz
« Reply #11 on: July 31, 2009, 02:00:19 pm »

A computer computes, it's a  (in the most literal way in can be understood.) logic machine.

The only way I can explain this is that a computer doesn't understand, know can it realize what a word is, because it thinks in numbers.

Code: [Select]
WORD
word
Code: [Select]
W=01010111
O=01001111
R=01010010
D=01000100
↵=00001010
w=01110111
o=01101111
r=01110010
d=01100100

Notice how while we "r" and "R" the same letter, the can't reconize that, I treats them as two completely different symbols.

Notice how the "newline" is a symbol too!
Logged
That [Magma] is a bit deep down there, don't you think?
You really aren't thinking like a dwarf.

If you think it is down too far, you move it up until it reaches an acceptable elevation.

waldo

  • Bay Watcher
    • View Profile
Re: english plz
« Reply #12 on: August 01, 2009, 12:32:30 am »

but why limit a computer to being simply a logic machine, for instance i am extremely analytical, to the point where i had trouble learning to drive my car because of it. and no r and R aRe not in fact the same symbol, they have the same RepResentation to a degRee, i mean how faR would you get wRiting a book if every loweRcase R you put down an uppeRcase R, but stating that they are both the same is like comparing a river to a brook or a stream, one is small and allows for people to easily cross it while the other is big and most likely has the dreaded carp.

you can be logic driven and still understand something, it's just a different point of view, i'm going to be nerdy here for a minute but data from star treck was logic driven, he was more advanced of an a.i. that we will probably have for a while but he still understood.

and now it brings to mind how we as humans understand the world around us, we see in colors and in 3-d. put a ball in front of us and we know it's a ball, we know how much it's going to hurt if we kick it and it's made out of concrete just by looking at it, most of the time. but how do we know how much it's going to way just by looking at it? simply by how it acts can we deduce that the ball is hallow? and if the ball is bounced don't you think you would be able to tell what it was made out of without even touching it based on prior knowledge and experience? how is that any different then what a computer would/could do?
Logged

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: english plz
« Reply #13 on: August 01, 2009, 12:57:07 am »

Because your brain is about a billion times more complicated than any computer.  "Thinking logically" is nothing close to what a computer does, which is literally just loads and loads of complicated math.  There's no analytical reasoning involved whatsoever - the programmer does all the thinking for the computer, and writes a big list for it to follow as an emulation of thinking.  Computers have no sense of deduction, they have to be told everything.

Yes, you can give a computer a good enough comprehension of physics and enough sensory input that maybe, just maybe, it can produce inductive reasoning about things.  That's basically what a graphing program does.  Processing enough variables and drawing enough extrapolations to even approaching human thought is a task so huge programmers are only just now wrapping their heads around it.  Even then, a computer will still only be able to handle input that it was programmed to handle.
Logged
And here is where my beef pops up like a looming awkward boner.
Please amplify your relaxed states.
Quote from: PTTG??
The ancients built these quote pyramids to forever store vast quantities of rage.