170 likes | 276 Views
CSE115: Introduction to Computer Science I. Dr. Carl Alphonce 219 Bell Hall 645-4739 alphonce@buffalo.edu. Announcements. Cell phones off Name signs out. Last class. Instructions are encoded as bit strings Machine languages Fetch-Decode-Execute cycle Assembly languages.
E N D
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 alphonce@buffalo.edu
Announcements • Cell phones off • Name signs out
Last class • Instructions are encoded as bit strings • Machine languages • Fetch-Decode-Execute cycle • Assembly languages
Today’s lessons • High-level languages • Requirements for a programming language
Low-level languages • Machine language • 1101000001000010 • Assembly language • ADD R1 R2
High level languages • Java • We can write “x + y” instead of “ADD R1 R2” (in addition to with several MOV instructions) • Others: C#, Erlang, Python, ML, Prolog, Lisp, etc.
Translation • LLL LLL is called assembly • there is a 1:1 translation from assembly to machine language • fairly simple process • HLL LLL is called compilation • there is no 1:1 translation • translation is quite complex • optimizations can be applied to make low level code more efficient
Requirements of a PL • Sequencing • Selection • Repetition
Equivalences • Computation models • Turing Machine • Lambda calculus • Programming languages • Java • C# • Prolog • Python
High-level languages • Easier syntax than • Machine language (bit strings) • Assembly language (mnemonic) • Must be translated (compiled) to machine language
Java • A modern high-level language • Object-oriented • Large libraries • (Relatively) simple core language
Moving on… • We will return to low-level issues later in the semester, and also in later courses. • This brief low-level discussion gives context for upcoming topics. • Now we turn to some higher-level issues.
I have a question for you! • What did you have for breakfast today?
Activity The goal of this short activity is to demonstrate two things: • objects have behaviors • sending message to objects can trigger those behaviors
Activity Review • Why did we do this activity? • To introduce the idea of an object. • What is an object? • It is a representation of something in our problem domain • It has both: • CAPABILITIES • PROPERTIES / STATE