Jython. An introduction by Thinh Le

Similar documents
Objective-C ICT/7421ICTNathan. René Hexel. School of Information and Communication Technology Griffith University.

An overview of Java, Data types and variables

The Awesomeness of Go. Igor Lankin DevFest Karlsruhe, Nov 2016

Principles of Programming Languages. Objective-C. Joris Kluivers

Assumptions. History

C and C++ I. Spring 2014 Carola Wenk

Lectures 5-6: Introduction to C

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries

VALLIAMMAI ENGINEERING COLLEGE


Procedures, Parameters, Values and Variables. Steven R. Bagley

developed ~2007 by Robert Griesemer, Rob Pike, Ken Thompson open source

Introduction to Java

CSCI-243 Exam 1 Review February 22, 2015 Presented by the RIT Computer Science Community

More Programming Languages. Spring 2014 Carola Wenk

Go Forth and Code. Jonathan Gertig. CSC 415: Programing Languages. Dr. Lyle

Announcements. CSCI 334: Principles of Programming Languages. Lecture 18: C/C++ Announcements. Announcements. Instructor: Dan Barowy

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor

The Compiler So Far. CSC 4181 Compiler Construction. Semantic Analysis. Beyond Syntax. Goals of a Semantic Analyzer.

CS558 Programming Languages

Introduction to Programming Using Java (98-388)

CS 61C: Great Ideas in Computer Architecture Introduction to C

Kurt Schmidt. October 30, 2018

Introduction to Java Written by John Bell for CS 342, Spring 2018

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

Rheinisch-Westfälische Technische Hochschule Aachen. Lehrstuhl für Datenmanagement und -exploration Prof. Dr. T. Seidl. Proseminar.

The Go Programming Language. Frank Roberts

IPHONE DEVELOPMENT. Getting Started with the iphone SDK

Pointers and scanf() Steven R. Bagley

Outline. Lecture 1 C primer What we will cover. If-statements and blocks in Python and C. Operators in Python and C

Motivations History Principles Language Gommunity Success stories Conclusion. Let s Go! A brief introduction to Google s new language.

Lecture 3: C Programm

SWIFT BASICS

CS240: Programming in C

C Introduction. Comparison w/ Java, Memory Model, and Pointers

Brief Summary of Java

Let s Go! Akim D le, Etienne Renault, Roland Levillain. June 8, TYLA Let s Go! June 8, / 58

C - Basics, Bitwise Operator. Zhaoguo Wang

Ruby: Introduction, Basics

Go for Java Developers

Questions. Exams: no. Get by without own Mac? Why ios? ios vs Android restrictions. Selling in App store how hard to publish? Future of Objective-C?

From C++ to Java. Duke CPS

CS 330 Lecture 18. Symbol table. C scope rules. Declarations. Chapter 5 Louden Outline

Lecture 03 Bits, Bytes and Data Types

Programming Language Basics

Programming in C. What is C?... What is C?

Programming in C UVic SEng 265

Object Oriented Programming with Java. Unit-1

C Programming Review CSC 4320/6320

Programming in C. What is C?... What is C?

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING CS6456 OBJECT ORIENTED PROGRAMMING

A Tour of the C++ Programming Language

Short Notes of CS201

Lecture Overview Methods and Interfaces Methods review Interfaces Example: using the sort interface Anonymous fields in structs

Java: introduction to object-oriented features

Introduce C# as Object Oriented programming language. Explain, tokens,

Chapter 1 INTRODUCTION SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC.

Scala : an LLVM-targeted Scala compiler

Object-Oriented Programming (OOP) Fundamental Principles of OOP

CS201 - Introduction to Programming Glossary By

Java Overview An introduction to the Java Programming Language

Language Design COMS W4115. Prof. Stephen A. Edwards Spring 2003 Columbia University Department of Computer Science

Beyond this course. Machine code. Readings: CP:AMA 2.1, 15.4

CS 371L - Mobile Computing (ios) Dr. William C. Bulko. CS 371L Mobile Computing (ios) Introduction

C BOOTCAMP DAY 2. CS3600, Northeastern University. Alan Mislove. Slides adapted from Anandha Gopalan s CS132 course at Univ.

Working with Shell Scripting. Daniel Balagué

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

Go vs. Swift: The Languages of The Modern Tech Giants

Java Basic Syntax. Java vs C++ Wojciech Frohmberg / OOP Laboratory. Poznan University of Technology

1) What is the first step of the system development life cycle (SDLC)? A) Design B) Analysis C) Problem and Opportunity Identification D) Development

Objective-C and COCOA Applications

Packages & Random and Math Classes

Java language. Part 1. Java fundamentals. Yevhen Berkunskyi, NUoS

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

STRUCTURING OF PROGRAM

Ruby: Introduction, Basics

Pierce Ch. 3, 8, 11, 15. Type Systems

Xcode and Swift CS 4720 Mobile Application Development

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

A Fast Review of C Essentials Part I

Lecture 2: C Programm

MATLAB to iphone Made Easy

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring

Special Topics: Programming Languages

Lectures 5-6: Introduction to C

Java Training JAVA. Introduction of Java

CS558 Programming Languages

OBJECTIVE QUESTIONS: Choose the correct alternative:

CS5015 Object-oriented Software Development. Lecture: Overview of Java Platform. A. O Riordan, 2010 Most recent revision, 2014 updated for Java 8

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary

Topics Covered Thus Far CMSC 330: Organization of Programming Languages

CS 220: Introduction to Parallel Computing. Beginning C. Lecture 2

1d: tests knowing about bitwise fields and union/struct differences.

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

Topics Covered Thus Far. CMSC 330: Organization of Programming Languages. Language Features Covered Thus Far. Programming Languages Revisited

Introduction to Java

Array. Prepared By - Rifat Shahriyar

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

Jython. secondary. memory

A Tour of the C++ Programming Language

Transcription:

Jython An introduction by Thinh Le

precursor_python! Google App Engine! Dropbox! PyGTK (Gnome)! Vim (embedded)! BitTorrent/Morpheus! Civilization/Battlefield

Jython! Interpretation of Python (1997)! Jim Hugunin & Frank Wierzbicki! Python written in C! Rewrite in Java! Runs on JVM! Interpreted Language! Object-Oriented

Scripting Language! Easy to learn and code! Expressive! Minimal structure (less lines of code)! Does not require compilation! Supports functional programming! Runs external programs

Hello World! print Hello, world!! does not need to be enclosed in class or func! Jython does it behind the scenes

File I/O! file = open( filename.txt, r ) for line in file.readlines(): print line file.close()

Event Handling! from javax.swing import * def hello(event): print Hello, world! frame = JFrame( Hello There ) button = JButton( Hello, actionperformed = hello) frame.add(button)

Method Overloading! from java.lang import Float, Double foo(float(9.5)) foo(double(9.5))

Classes! class Hello: def _init_(self, name= John Smith ): self.name = name def greeting(self): print Hello, %s % self.name jane = Hello( Jane Smith ) joe = Hello( Joe ) default = Hello() jane.greeting() joe.greeting() default.greeting()

Advantages/Disadvantages! Readability! Increase programmer efficiency! Code is dynamically converted to Java byte code! eliminate performance issues! Cross-platform compatible! Slow! cannot detect undefined variable (caught at runtime)

Implementation! IBM WebSphere (App server)! IBM Rational (SDLC)! WebLogic Server! Sikuli Demo

Questions?

An introduction by Thinh Le Objective-C

Objective-C! Developed in the 1980s by Stepstone! Superset of C! Any C program compilable as Obj-C! Object syntax derived from Smalltalk! Dynamic typing, message based

Objective-C 2.0! Introduced with Mac OS 10.5! Only supports runtime systems! GNUStep, Cocoa, Cocoa Touch! Supports garbage collectors, properties, dot notations, fast enumerations! ios devices (iphone, ipad)

Classes / Types! Class (methods, instance variables)! Inheritance (can have super class)! No single root class like Java! Object Types:! id, nil, self ( this in Java), super! All C-Types can be used (int, float, short)

Methods / Messaging! Methods on object called via messaging! Sends msg w/message name to receiver! Msg can have return value (0 or nil)! Nested messagess: [[receiver msg1] msg2]! Parameters: [rectangle setx: 5 y: 10]! Dot Syntax: rectangle.width = 15;

Memory / Protocols! Objects created are allocated memory! Must be released when scope ends! Protocols similar to Java interfaces! List of methods independent from class

Protocol - Example

Exception Handling! Similar to Java! @throw myexception @try { }@catch (NSException *e) { NSLog(@ Caught %@: %@, [exception name], [exception reason]); } @finally{ }

Hello World! #import <stdio.h> int main (int argc, const char *argv[]) { printf ( hello world\n ); return 0; }

! http://ideone.com DEMO

GO An introduction by Thinh Le

What is Go?! Experimental! Tools & packages still in development! Concurrent and Garbage-collected! Systems programming (compilers, web server)! Created by Robert Griesemer, Ken Thompson, Rob Pike of Google (2009)

Purpose of Creation! Resource demands by applications! Bigger libraries! More dependencies! Growth of clusters in Client/Server systems! Main stream multi-core processors! Internet and networking becoming pervasive

Goals of Go! Efficiency and ease of use! Performance within 10-20% of C! Type safe and Memory safe! Concurrency ( http://langalot.com/ )! Garbage Collected! High-Speed Builds! Fast compilation & linking

Example! package main import fmt //package for Printf func func main() { //functions have func keyword fmt.printf( Hello World! ) }

Loop! func main() { sum := 1 i := 1 for i <= 5 { sum += i; i++ } fmt.printf( Sum is %d, sum) }! for loop is only loop supported in Go

Functions as Objects! func for_all(arr []int, foo func(int)) { for i := 0; i<len(arr); i++ { foo(arr[i]) } } func print(i int) {fmt.printf( %d, i) } func main() { for_all([] int {1,2,3}, print); }! Similar to functional language. ie. Closjure

Structures! type Point struct { } x, y int func main() { p := Point {10, 20} fmt.printf( p value is = %v, p) }

Methods! type Point struct { x, y int } func (p Point) Print() { fmt.printf( p value is = %v, p) } func main() { p := Point {10, 20} fmt.print() }

! http://ideone.com Demo