computer languages computershumans 00101010110010 011000101110101 010111001001 10 0011 how can...
TRANSCRIPT
![Page 1: Computer Languages ComputersHumans 00101010110010 011000101110101 010111001001 10 0011 How can humans “talk to” (instruct) computers? Answer: Computer](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649e9e5503460f94b9f25d/html5/thumbnails/1.jpg)
Computer Languages
ComputersHumans 00101010110010011000101110101 010111001001 10 0011
How can humans “talk to”(instruct) computers?
Answer: Computer languages (e.g., Java, C,Python, FORTRAN, Basic, C++, Lisp, Ruby, …)
![Page 2: Computer Languages ComputersHumans 00101010110010 011000101110101 010111001001 10 0011 How can humans “talk to” (instruct) computers? Answer: Computer](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649e9e5503460f94b9f25d/html5/thumbnails/2.jpg)
Computer Languages
Alice Alice & BettyBetty
Consider: “Alice and Betty had on the same dress.”Natural languages are often ambiguous.
YES NO
![Page 3: Computer Languages ComputersHumans 00101010110010 011000101110101 010111001001 10 0011 How can humans “talk to” (instruct) computers? Answer: Computer](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649e9e5503460f94b9f25d/html5/thumbnails/3.jpg)
Computer LanguagesConsider: “Alice and Betty ran from the same building.”
Alice Betty BettyAlice
YESNO
![Page 4: Computer Languages ComputersHumans 00101010110010 011000101110101 010111001001 10 0011 How can humans “talk to” (instruct) computers? Answer: Computer](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649e9e5503460f94b9f25d/html5/thumbnails/4.jpg)
Computer Languages
It deosn't mttaer in waht oredr the ltteers in aword are, the iprmoatnt tihng is taht the fristand lsat ltteer are in the rghit pcale.
Natural languages contain a great deal of redundantinformation, making them quite “fault tolerant.”
Easy for a human to make sense of this despite13 of the 27 words being misspelled.
![Page 5: Computer Languages ComputersHumans 00101010110010 011000101110101 010111001001 10 0011 How can humans “talk to” (instruct) computers? Answer: Computer](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649e9e5503460f94b9f25d/html5/thumbnails/5.jpg)
Computer Languages• Computers typically can’t tolerate ambiguity or
mistakes.• Statements (instructions) must be unambiguous
and without mistakes.• Computer languages provide framework for
humans to communicate to computers in a waythat is almost natural to humans.
![Page 6: Computer Languages ComputersHumans 00101010110010 011000101110101 010111001001 10 0011 How can humans “talk to” (instruct) computers? Answer: Computer](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649e9e5503460f94b9f25d/html5/thumbnails/6.jpg)
Computer Languages
int main() { printf(”Hi\n”); return 0;}
Source FileCompiler Executable
File100101000111010111010011010000110010100
ExecutableFile
100101000111010111010011010000110010100
Processor
Output/Results
Two-step process toexecute source code.
![Page 7: Computer Languages ComputersHumans 00101010110010 011000101110101 010111001001 10 0011 How can humans “talk to” (instruct) computers? Answer: Computer](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649e9e5503460f94b9f25d/html5/thumbnails/7.jpg)
Computer LanguagesSource File
Interpreter
Output/Results
Source code isexecuted directly.
• We will use Python interpreter.• Compilers better at catching errors and
producing faster code.• Interpreters better for developing code
and learning to use a language.
print(”Hi”)
Interactive Environment