First Programming Language in CS Education The Arguments for Scala

Similar documents
Scala, Your Next Programming Language

Notes from a Short Introductory Lecture on Scala (Based on Programming in Scala, 2nd Ed.)

Programming in Scala Second Edition

Scala : an LLVM-targeted Scala compiler

Concepts of Programming Languages

Programming Languages 2nd edition Tucker and Noonan"

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309

G Programming Languages - Fall 2012

CS558 Programming Languages

CS 349 / SE 382 Scripting. Professor Michael Terry March 18, 2009

CSCI-GA Scripting Languages

Who am I? Harlan Iverson. Programming enthusiast. Seeker of truth. Imperfect. I'll be wrong about some things. Please correct me if you can.

CSE 413 Languages & Implementation. Hal Perkins Winter 2019 Structs, Implementing Languages (credits: Dan Grossman, CSE 341)

CS162 Week 1. Kyle Dewey. Friday, January 10, 14

Programming Kotlin. Familiarize yourself with all of Kotlin s features with this in-depth guide. Stephen Samuel Stefan Bocutiu BIRMINGHAM - MUMBAI

Ruby: Introduction, Basics

CS558 Programming Languages

Values (a.k.a. data) representation. Advanced Compiler Construction Michel Schinz

Values (a.k.a. data) representation. The problem. Values representation. The problem. Advanced Compiler Construction Michel Schinz

CMSC 330: Organization of Programming Languages

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

CS558 Programming Languages

CS 140 Programming with Objects

Apache Spark and Scala Certification Training

Ruby: Introduction, Basics

CSE 341, Autumn 2015, Ruby Introduction Summary

Programming Languages, Summary CSC419; Odelia Schwartz

G Programming Languages - Fall 2012

C++ for Python Programmers

CS 11 Haskell track: lecture 1

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

Control Structures. Christopher Simpkins CS 3693, Fall Chris Simpkins (Georgia Tech) CS 3693 Scala / 1

Using Scala for building DSL s

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Seminar on Languages for Scientific Computing Aachen, 6 Feb Navid Abbaszadeh.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Haskell Programming

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department

Introducing Wybe a language for everyone

Introduction to Programming Using Java (98-388)

Big Java Late Objects

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

CS383 PROGRAMMING LANGUAGES. Kenny Q. Zhu Dept. of Computer Science Shanghai Jiao Tong University

CS 445: Data Structures Final Examination: Study Guide

CS506 Web Programming and Development Solved Subjective Questions With Reference For Final Term Lecture No 1

(CC)A-NC 2.5 by Randall Munroe Python

CS 360 Programming Languages Interpreters

Object-oriented programming in...

PYTHON CONTENT NOTE: Almost every task is explained with an example

Programming Languages and Techniques (CIS120)

Short Notes of CS201

[Course Overview] After completing this module you are ready to: Develop Desktop applications, Networking & Multi-threaded programs in java.

Ruby: Introduction, Basics

JAVA An overview for C++ programmers

VALLIAMMAI ENGINEERING COLLEGE

Object-Oriented Programming and Data Structures

CS201 - Introduction to Programming Glossary By

CS252 Advanced Programming Language Principles. Prof. Tom Austin San José State University Fall 2013

Closing the Case for Groovy (and Ruby, and Python)

COSE212: Programming Languages. Lecture 3 Functional Programming in OCaml

Lecture Overview. [Scott, chapter 7] [Sebesta, chapter 6]

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

MARS AREA SCHOOL DISTRICT Curriculum TECHNOLOGY EDUCATION

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

SYLLABUS JAVA COURSE DETAILS. DURATION: 60 Hours. With Live Hands-on Sessions J P I N F O T E C H

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

Scala. Fernando Medeiros Tomás Paim

CS205: Scalable Software Systems

Executive Summary. It is important for a Java Programmer to understand the power and limitations of concurrent programming in Java using threads.

Beyond CSE143. What s Left To Do? Templates. Using Templates. A Template Class. A Problem with Reusing Code CSE 143

Core JAVA Training Syllabus FEE: RS. 8000/-

Functional Programming

This page intentionally left blank

CS321 Languages and Compiler Design I Winter 2012 Lecture 13

Java Overview An introduction to the Java Programming Language

JVA-103. Java Programming

AP Computer Science A Course Syllabus

Smalltalk: developed at Xerox Palo Alto Research Center by the Learning Research Group in the 1970 s (Smalltalk-72, Smalltalk-76, Smalltalk-80)

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction

Clojure. The Revenge of Data. by Vjeran Marcinko Kapsch CarrierCom

Chapter 11 :: Functional Languages

Software Development & Education Center. Java Platform, Standard Edition 7 (JSE 7)

5/23/2015. Core Java Syllabus. VikRam ShaRma

Lecture content. Course goals. Course Introduction. TDDA69 Data and Program Structure Introduction

The Script Bowl Featuring Groovy, JRuby, Jython and Scala. Raghavan Rags N. Srinivas CTO, Technology Evangelism

LTBP INDUSTRIAL TRAINING INSTITUTE

Java 8 Programming for OO Experienced Developers

1320 Principles Of Computer Science I

Fast Track to Core Java 8 Programming for OO Developers (TT2101-J8) Day(s): 3. Course Code: GK1965. Overview

Using Scala in CS241

Lecture 23: Priority Queues 10:00 AM, Mar 19, 2018

Scala, Lift and the Real Time Web

Intro: Your brain on Java Who is this book for? What your brain is thinking. Bend your brain into submission What you need for this book

Design and implement a program to solve a real-world problem using the language idioms, data structures,, and standard library.

...something useful to do with the JVM.

CSE 5317 Midterm Examination 4 March Solutions

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

College Board. AP CS A Labs Magpie, Elevens, and Picture Lab. New York: College Entrance Examination Board, 2013.

Fundamentals of Computer Science II

Java Programming Training for Experienced Programmers (5 Days)

Transcription:

First Programming Language in CS Education The Arguments for Scala WORLDCOMP 2011 By Dr. Mark C. Lewis Trinity University

Disclaimer I am writing a Scala textbook that is under contract with CRC Press. I would do this tutorial anyway, just because I like Scala that much.

Compiled Links http://www.cs.trinity.edu/~mlewis/scalalinks.html This is a collection of links for those who want more information on Scala.

Scala and Me Grad schools and type systems Functional Programming and ML Interest in X10 and Fortress Trinity curriculum update Was C Java CS1 not object-early CS1 & CS2 use same language

Basics of Scala Scalable Language Multi-Paradigm Productivity of scripting languages Expressivity of functional languages Scalability of standard OO languages Speed of compiled, statically-typed languages All OO Highly Functional Static-typing with local type inference

Too Complex? Reasons for perception Scala is different Functional isn't broadly known Scalability power Bloggers show cool examples Simpler in many ways Uniform syntax

Shorter Language Specification Static Typed Language Spec Length (pages) Dynamic Typed Language Spec Length (pages) C 552 Common LISP 1153 C++ 1325 Ruby 341 C# 553 PHP 244 Java 684 JavaScript 252 VB.NET 597 Python 3.1 119 Scala 191 Scheme 50 F# 250

Fewer Keywords http://carlosqt.blogspot.com/2011/01/how-many-keywords-in-your-source-code.html

Jobs

Benefits in CS 1 Programming in the small REPL Scripting Environment Libraries allow for interesting code (JVM) Static type checking Uniform syntax Everything is a method call Powerful collections

Starting Off Hello, World and such REPL Types - lack of primitives tuples Statements/expressions Semicolon inference Simple input Variables val var Scripts

Conditions and Functions Functional expressions if expression Boolean logic Blocks of code Functions def (would make method in class) Function literals n => n+1 _+1

Recursion for Iteration This is my style, even in C. Works well with functional Cements previous topics Further with Scala Passing function argument early abstraction Matching idiom Introduce patterns

Collections (Array/List) Just for Scala Doesn't make sense before loops in most languages. One mutable, one immutable Many standard methods Many higher-order methods Syntax Use () for indexing List also have ML style operations Creation, pass-by-name

Loops While loop Not an expression For loop Really for-each yield Ranges Many options Multiple generators If guards Variables Patterns

Files Can use Scanner scala.io.source Scala Iterator[Char] getlines : Iterator[String] Use with higher-order methods Write with PrintWriter Introduce APIs?

Case Classes Immutable struct in simplest usage Simple syntax for grouping data Works as a pattern Copy method

GUIs scala.swing wraps javax.swing Cleaner beginner syntax No explicit inheritance Reactions use partial functions Drawbacks Currently no JTree Tables complex Button syntax uses companion object

Graphics Full Java2D Really using Java Override paint method Use BufferedImage Events for animations Keyboard Mouse Timer

Sorting & Searching Monomorphic at this point Can write your own visualization There are methods in collections

Other Stuff XML Organizes data better than flat files Serious recursion Problems with high branching factor Object-Orientation Normal classes Including methods

Benefits in CS 2 Pure OO Fewer quirks than Java Traits Rich collections Libraries again Can make things interesting/relevant Eclipse Scalable language Libraries as language

OO for Larger Programs Review and extend from CS1 Visibility/Private Special methods Symbolic Property assignment apply update Object declarations

Eclipse Full apps need an IDE Automatic error checks Name completion Needs memory

Polymorphism Inheritance/Subtyping Traits Protected visibility Parametric Polymorphism Type bounds Parametric methods polymorphic sorts

Other Collections Sets Include expected methods Maps (key,value) key value Buffers Mutable Variable sized Many options mutable and immutable

Multithreading Many approaches java.lang.thread java.util.concurrent Parallel collections Added in 2.9 Actors Simplified by functional

Networking Use java.net and java.io Streams Sockets Serialization

ADTs I cover these Stack/Queue Linked List Priority Queue Sorted LL Heap Trees BST Spatial Manifests Inheriting traits!!!

Grammars RegEx.r method on String Triple quote strings Patterns Combinatorial Parsers CF grammar parser Arithmetic example

Beyond CS 1&2 Akka Non-JVM implementations GPGPU libraries

Conclusions Good early on REPL Scripting Grows well OO & static types IDE support Complete libraries Complexity not required