Programming Languages Dan Grossman 2013

Slides:



Advertisements
Similar presentations
Lecture 2 - Introduction Objective C is used primarily for application development on Apple's Mac OS X and iPhone. On the Apple it is used together with.
Advertisements

Programming Languages Xiaojuan Cai
CSE341: Programming Languages Lecture 19 Introduction To Ruby; Dynamic OOP; "Duck Typing" Dan Grossman Fall 2011.
Scripting Languages CS351 – Programming Paradigms.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
CSE341: Programming Languages Introduction To Ruby; Dynamic OOP; "Duck Typing" Alan Borning Autumn 2012 (slides borrowed from Dan Grossman)
Introduction to Ruby CSE 413 Autumn 2008 Credit: Dan Grossman, CSE341.
ITM352 PHP and Dynamic Web Pages: Server Side Processing.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
CSE 341 Programming Languages Introduction to Ruby Zach Tatlock Spring 2014.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and web applications Very rich GUI libraries Portability (machine independence) A real Object.
CSE 413 Programming Languages & Implementation Hal Perkins Autumn 2012 Introduction to Ruby (adapted from CSE 341, Dan Grossman) 1.
CS162 Week 1 Kyle Dewey. Overview Basic Introduction CS Accounts Scala survival guide.
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
Programming Languages Dan Grossman 2013 ML Expressions and Variable Bindings.
Programming Languages Dan Grossman 2013 Everything is an Object.
Presented By P.SRIVIDYA 085D1A0552 Programming Language.
Introduction CMSC 202 Fall Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.
CSE341: Programming Languages Lecture 26 Course Victory Lap
Programming Languages Dan Grossman 2013
JQuery Fundamentals Introduction Tutorial Videos
CSE341: Programming Languages Lecture 21 Dynamic Dispatch Precisely, and Manually in Racket Dan Grossman Spring 2016.
The language focusses on ease of use
ITM352 PHP and Dynamic Web Pages: Server Side Processing 1.
INTERMEDIATE PROGRAMMING WITH JAVA
CSE 341 Section 1 (9/28) With thanks to Dan Grossman, et. al. from previous versions of these slides.
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
Programming Languages Dan Grossman 2013
CSE341: Programming Languages Lecture 19 Introduction to Ruby and OOP
CSE 341 Section 1 (9/28) With thanks to Dan Grossman, et. al. from previous versions of these slides.
Programming Language Design Concepts
CSE341: Programming Languages Lecture 21 Dynamic Dispatch Precisely, and Manually in Racket Dan Grossman Spring 2017.
CSE 341 Section 9 Nick Mooney Spring 2017
JavaScript Syntax and Semantics
PHP Training at GoLogica in Bangalore
CSE341: Programming Languages Lecture 4 Records, Datatypes, Case Expressions Dan Grossman Spring 2017.
Implementing Chares in a High-Level Scripting Language
CSE341: Programming Languages Lecture 16 Datatype-Style Programming With Lists or Structs Dan Grossman Spring 2013.
PHP / MySQL Introduction
PHP Introduction.
CSE 341: Programming Languages Section 1
CSE341: Programming Languages Lecture 16 Datatype-Style Programming With Lists or Structs Dan Grossman Spring 2017.
Alan Borning Spring 2018 (slides borrowed from Dan Grossman)
JavaScript an introduction.
What to do today: Brief history of Ruby General qualities/info
CSE341: Programming Languages Section 1
CSE341: Programming Languages Lecture 26 Course Victory Lap
CSE341: Programming Languages Section 1
CSE 341 Section 9 Winter 2018 Adapted from slides by Eric Mullen, Nick Mooney, Nicholas Shahan, Cody Schroeder, and Dan Grossman.
More Object-Oriented Programming
CSE 341: Programming Languages Section 1
CSE341: Programming Languages Lecture 26 Course Victory Lap
CSE341: Programming Languages Lecture 4 Records, Datatypes, Case Expressions Dan Grossman Spring 2016.
Nicholas Shahan Spring 2016
CSE341: Programming Languages Lecture 26 Course Victory Lap
Unit 6 part 5 Test Javascript Test.
CSE341: Programming Languages Lecture 16 Datatype-Style Programming With Lists or Structs Dan Grossman Spring 2016.
Tutorial 10: Programming with javascript
CSE 341 Section 9 Fall 2017 Adapted from slides by Nick Mooney, Nicholas Shahan, Cody Schroeder, and Dan Grossman.
CSE341: Programming Languages Lecture 4 Records, Datatypes, Case Expressions Dan Grossman Spring 2019.
Introduction to JavaScript
Web Application Development Using PHP
CSE341: Programming Languages Lecture 21 Dynamic Dispatch Precisely, and Manually in Racket Dan Grossman Spring 2019.
CSE341: Programming Languages Lecture 26 Course Victory Lap
CSE341: Programming Languages Lecture 16 Datatype-Style Programming With Lists or Structs Dan Grossman Spring 2019.
Presentation transcript:

Programming Languages Dan Grossman 2013 Introduction to Ruby

Dan Grossman, Programming Languages Ruby logistics Next two sections use the Ruby language http://www.ruby-lang.org/ Installation / basic usage instructions on course website Emacs in lectures, but many editors support Ruby well Version 1.9.x required, but differences not so relevant Excellent documentation available, much of it free So may not cover every language detail in course materials http://ruby-doc.org/ http://www.ruby-lang.org/en/documentation/ Particularly recommend “Programming Ruby 1.9, The Pragmatic Programmers’ Guide” Not required and not free Jan-Mar 2013 Dan Grossman, Programming Languages

Dan Grossman, Programming Languages Ruby: Our focus Pure object-oriented: all values are objects (even numbers) Class-based: Every object has a class that determines behavior Like Java, unlike Javascript Mixins (neither Java interfaces nor C++ multiple inheritance) Dynamically typed Convenient reflection: Run-time inspection of objects Very dynamic: Can change classes during execution Blocks and libraries encourage lots of closure idioms Syntax, scoping rules, semantics of a "scripting language" Variables "spring to life" on use Very flexible arrays Jan-Mar 2013 Dan Grossman, Programming Languages

Dan Grossman, Programming Languages Ruby: Not our focus Lots of support for string manipulation and regular expressions Popular for server-side web applications Ruby on Rails Often many ways to do the same thing More of a “why not add that too?” approach Jan-Mar 2013 Dan Grossman, Programming Languages

Dan Grossman, Programming Languages Where Ruby fits dynamically typed statically typed functional Racket SML object-oriented (OOP) Ruby Java, etc. Note: Racket also has classes and objects when you want them In Ruby everything uses them (at least implicitly) Historical note: Smalltalk also a dynamically typed, class-based, pure OOP language with blocks and convenient reflection Smaller just-as-powerful language Ruby less simple, more “modern and useful” Dynamically typed OOP helps identify OOP's essence by not having to discuss types Jan-Mar 2013 Dan Grossman, Programming Languages

Dan Grossman, Programming Languages A note on the homework Next homework is about understanding and extending an existing program in an unfamiliar language Good practice Quite different feel than previous homeworks Read code: determine what you do and do not (!) need to understand Homework requires the Tk graphics library to be installed such that the provided Ruby code can use it Jan-Mar 2013 Dan Grossman, Programming Languages

Dan Grossman, Programming Languages Getting started See .rb file for our first program (There are much shorter ways to write the same thing) Can run file foo.rb at the command-line with ruby foo.rb Or can use irb, which is a REPL Run file foo.rb with load "foo.rb" Jan-Mar 2013 Dan Grossman, Programming Languages