Look at all these toys!

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

Frege. purely functional programming on the JVM. GOTO Berlin 2015

Scala, Your Next Programming Language

CPS506 - Comparative Programming Languages Elixir

Die funktionale Zukunft

Frege. purely functional programming on the JVM. JUG Luzern 2016

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


Metaprogramming. Concepts of Programming Languages. Alexander Schramm. 2. November Institut für Softwaretechnik und Programmiersprachen

Crystal for Rubyists

Writing code that I'm not smart enough to write. A funny thing happened at Lambda Jam

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

Rust for high level applications. Lise Henry

Clojure Lisp for the Real #clojure

Ruby on Rails. SITC Workshop Series American University of Nigeria FALL 2017

.consulting.solutions.partnership. Clojure by Example. A practical introduction to Clojure on the JVM

MY GOOD FRIEND RUST. Matthias Endler trivago

Functional Programming and the Web

Elixir and Phoenix fast, concurrent and explicit Tobias pragtob.info

Concepts of Programming Languages

Functional Programming Patterns And Their Role Instructions

First Programming Language in CS Education The Arguments for Scala

Introduction to Functional Programming and Haskell. Aden Seaman

! Broaden your language horizons. ! Study how languages are implemented. ! Study how languages are described / specified

Haskell in the corporate environment. Jeff Polakow October 17, 2008

Week 2: The Clojure Language. Background Basic structure A few of the most useful facilities. A modernized Lisp. An insider's opinion

Reverse Sort. array = (1..1_000).to_a. array.sort do item, other other <=> item end

Clojure Lisp for the Real clojure.com

How Rust views tradeoffs. Steve Klabnik

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

CPL 2016, week 10. Clojure functional core. Oleg Batrashev. April 11, Institute of Computer Science, Tartu, Estonia

Ruby-like Syntax. defmodule MyMap do def map([], _func), do: [] def map([head tail], func) do [func.(head) map(tail, func)] end end

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

Elixir and Phoenix. fast, concurrent and explicit. Tobias pragtob.info

CSCI Test 1.Spring 2004 Student Id: Grading: Undergrads, you are responsible for 110 points. Grads: you are responsible for 120 points

Swift, functional programming, and does it matter? Alexis

MEAP Edition Manning Early Access Program Phoenix in Action Version 7

Lecture 8: Summary of Haskell course + Type Level Programming

MTAT Agile Software Development

CSE 341, Autumn 2015, Ruby Introduction Summary

Scalable Performance for Scala Message-Passing Concurrency

The Actor Model. CSCI 5828: Foundations of Software Engineering Lecture 13 10/04/2016

Ruby assign variable if nil. Ruby assign variable if nil.zip

Computer Science Seminar. Whats the next big thing? Ruby? Python? Neither?

Structure and Interpretation of Computer Programs

Introduction Basics Concurrency Conclusion. Clojure. Marcel Klinzing. December 13, M. Klinzing Clojure 1/18

Overview. Rationale Division of labour between script and C++ Choice of language(s) Interfacing to C++ Performance, memory

and the only thing missing is u Integrating Lua and Erlang with an overview of scripting options

CSE : Python Programming

Stuart

Dynamic Languages Strike Back. Steve Yegge Stanford EE Dept Computer Systems Colloquium May 7, 2008

PyPy - How to not write Virtual Machines for Dynamic Languages

CS Exam #1-100 points Spring 2011

CONTROL AND HIGHER ORDER FUNCTIONS 1

Learning Scala: Practical Functional Programming For The JVM By Jason Swartz

How Rust is Tilde s Competitive Advantage

Type Inference. Prof. Clarkson Fall Today s music: Cool, Calm, and Collected by The Rolling Stones

Hi! My name is Sorin. Programming Languages. Why study PL? (discussion) Why study PL? Course Goals. CSE : Fall 2017

Programming Paradigms

JVM ByteCode Interpreter

1.3.4 case and case* macro since 1.2. Listing Conditional Branching, Fast Switch. Listing Contract

YEAH 2: Simple Java! Avery Wang Jared Bitz 7/6/2018

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

CP122 CS I. Iteration

Macros, and protocols, and metaprogramming - Oh My!

The Actor Model, Part Two. CSCI 5828: Foundations of Software Engineering Lecture 18 10/23/2014

Kickstart Intro to Java Part I

Declarative concurrency. March 3, 2014

Program generation for schema-based, typed data access

CSE373: Data Structure & Algorithms Lecture 23: Programming Languages. Aaron Bauer Winter 2014

iex(1)> defmodule RepeatN do def repeat_n(function, count) do ...(1)> end repeat_n(function, count - 1) {:module, RepeatN,...}

Clojure Concurrency Constructs. CSCI 5828: Foundations of Software Engineering Lecture 12 10/02/2014

Key components of a lang. Deconstructing OCaml. In OCaml. Units of computation. In Java/Python. In OCaml. Units of computation.

The Go Programming Language. Frank Roberts

Outline. Introduction Concepts and terminology The case for static typing. Implementing a static type system Basic typing relations Adding context

Lisp to Ruby to Rubinius

! Broaden your language horizons! Different programming languages! Different language features and tradeoffs. ! Study how languages are implemented

Programming Languages

CS152 Programming Language Paradigms Prof. Tom Austin, Fall Syntax & Semantics, and Language Design Criteria

Scala : an LLVM-targeted Scala compiler

MF#K - Introduction to F# GroupM Mødegruppe for Ƒunktionelle Københavnere (MF#K)

Persistent Data Structures and Managed References

Elixir and Phoenix fast, concurrent and explicit Tobias pragtob.info

Structure and Interpretation of Computer Programs

Programming Languages 2nd edition Tucker and Noonan"

Erlang and Go (CS262a, Berkeley Fall 2016) Philipp Moritz


General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

Topic 9: Type Checking

Topic 9: Type Checking

Haskell Functional Programming

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

From the event loop to the distributed system. Martyn 3rd November, 2011

Why I still develop synchronous web in the asyncio era. April 7th, 2017 Giovanni Barillari - pycon otto - Firenze, Italy

A polyglot day: learning from language paradigms. Benson Joeris Kathleen Dollard

A Pragmatic Case For. Static Typing

Organized by Jean-François Cloutier Held at Big Room Studios, Portland, ME. Holy Elixir, Batman! Meetup June 16, 2015

The Curious Clojureist

Introduction to Clojure Concurrency (and data structures)

CS457/557 Functional Languages

Transcription:

Look at all these toys!

Help it s Ruby!

All alone

Is Ruby dying?

Where do Rubyists go?

Where do Rubyists go? Tobias Pfeiffer @PragTob pragtob.info

673 Responses

First Rails Release

Rails 1.0

Why did you learn Ruby? I had written half of Rails in PHP. Then Rails was announced and it was like a cheat code to a working framework.

First Rails Girls Workshop

First Rails Girls Berlin Workshop

Surveys and Bias

Like some bias?

Like to do Ruby in 5 years?

Omissions

Tools

Disclaimer

Meet & Greet

1990 1995 2000 2005 2010 2015

Name: Ruby Popular Rubyists: All of them Known for: Metaprogramming, dynamic, Scripting, web Self-assessment: A dynamic, open source programming language with a focus on simplicity and productivity.

FizzBuzz!

1 2

1 2 Fizz

1 2 Fizz 4 Buzz

1 2 Fizz 4 Buzz Fizz

1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14

1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz

1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16

def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n end end (1..100).each { n puts fizzbuzz(n)}

def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n end end (1..100).each { n puts fizzbuzz(n)}

def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n end end (1..100).each { n puts fizzbuzz(n)}

def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n end end (1..100).each { n puts fizzbuzz(n)}

def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n end end (1..100).each { n puts fizzbuzz(n)}

def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n end end (1..100).each { n puts fizzbuzz(n)}

def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n end end (1..100).each { n puts fizzbuzz(n)}

Name: Crystal Popular Rubyists: Erik Berlin, Piotr Szotkowski, Fabio Akita Known for: Ruby-like, Performance, Type Inference Self-assessment: Fast as C, slick as Ruby

def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n end end (1..100).each { n puts fizzbuzz(n)}

cp fizzbuzz.rb fizzbuzz.cr def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n end end (1..100).each { n puts fizzbuzz(n)}

Elixir Name: Popular Rubyists: José Valim, Dave Thomas, Xavier Noria Erlang VM, Actors, Functional, Known for: Phoenix Self-assessment: dynamic, functional language designed for building scalable and maintainable applications.

defmodule FizzBuzz do def fizzbuzz(n) when def fizzbuzz(n) when def fizzbuzz(n) when def fizzbuzz(n), do: end rem(n, 15) == 0, do: "FizzBuzz" rem(n, 5) == 0, do: "Buzz" rem(n, 3) == 0, do: "Fizz" n Enum.each(1..100, fn i -> IO.puts(FizzBuzz.fizzbuzz(i)) end)

defmodule FizzBuzz do def fizzbuzz(n) when def fizzbuzz(n) when def fizzbuzz(n) when def fizzbuzz(n), do: end rem(n, 15) == 0, do: "FizzBuzz" rem(n, 5) == 0, do: "Buzz" rem(n, 3) == 0, do: "Fizz" n Enum.each(1..100, fn i -> IO.puts(FizzBuzz.fizzbuzz(i)) end)

Name: Popular Rubyists: Known for: Self-assessment: Haskell Chad Fowler Type System, Monads, Pure An advanced, purely functional programming language.

main = mapm_ (putstrln. fizzbuzz) [1..100] fizzbuzz x x `mod` 15 == 0 = "FizzBuzz" x `mod` 3 == 0 = "Fizz" x `mod` 5 == 0 = "Buzz" otherwise = show x

main = mapm_ (putstrln. fizzbuzz) [1..100] fizzbuzz x x `mod` 15 == 0 = "FizzBuzz" x `mod` 3 == 0 = "Fizz" x `mod` 5 == 0 = "Buzz" otherwise = show x

main = mapm_ (putstrln. fizzbuzz) [1..100] fizzbuzz x x `mod` 15 == 0 = "FizzBuzz" x `mod` 3 == 0 = "Fizz" x `mod` 5 == 0 = "Buzz" otherwise = show x

Go Name: Popular Rubyists: Katrina Owen, Evan Phoenix Goroutines, Simple, No Known for: Exceptions, No Generics Self-assessment: open source programming language that makes it easy to build simple, reliable, and efficient software.

package main import "fmt" import "strconv" func FizzBuzz(i int) string { switch { case i%15 == 0: return "FizzBuzz" case i%3 == 0: return "Fizz" case i%5 == 0: return "Buzz" default: return strconv.itoa(i) } } func main() { for i := 1; i <= 100; i++ { fmt.println(fizzbuzz(i)) } }

package main import "fmt" import "strconv" func FizzBuzz(i int) string { switch { case i%15 == 0: return "FizzBuzz" case i%3 == 0: return "Fizz" case i%5 == 0: return "Buzz" default: return strconv.itoa(i) } } func main() { for i := 1; i <= 100; i++ { fmt.println(fizzbuzz(i)) } }

package main import "fmt" import "strconv" func FizzBuzz(i int) string { switch { case i%15 == 0: return "FizzBuzz" case i%3 == 0: return "Fizz" case i%5 == 0: return "Buzz" default: return strconv.itoa(i) } } func main() { for i := 1; i <= 100; i++ { fmt.println(fizzbuzz(i)) } }

Rust Name: Popular Rubyists: Steve Klabnik, Yehuda Katz, Sean Griffin Memory Management, Known for: Compiler, Firefox Quantum Self-assessment: a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.

fn main() { (1..101).for_each( n println!("{}", fizzbuzz(n))) } fn fizzbuzz(n: i32) -> String { match (n % 3, n % 5) { (0, 0) => "FizzBuzz".to_string(), (0, _) => "Fizz".to_string(), (_, 0) => "Buzz".to_string(), _ => n.to_string(), } }

fn main() { (1..101).for_each( n println!("{}", fizzbuzz(n))) } fn fizzbuzz(n: i32) -> String { match (n % 3, n % 5) { (0, 0) => "FizzBuzz".to_string(), (0, _) => "Fizz".to_string(), (_, 0) => "Buzz".to_string(), _ => n.to_string(), } }

fn main() { (1..101).for_each( n println!("{}", fizzbuzz(n))) } fn fizzbuzz(n: i32) -> String { match (n % 3, n % 5) { (0, 0) => "FizzBuzz".to_string(), (0, _) => "Fizz".to_string(), (_, 0) => "Buzz".to_string(), _ => n.to_string(), } }

Name: Popular Rubyists: Known for: Self-assessment: JavaScript Yehuda Katz, Jeremy Ashkenas Quirks, Async, Compile to a lightweight interpreted or JITcompiled programming language with first-class functions.

const fizzbuzz = n => { if (n % 15 === 0) { return "FizzBuzz"; } else if (n % 3 === 0) { return "Fizz"; } else if (n % 5 === 0) { return "Buzz"; } else { return n; } }; for (let n = 1; n <= 100; n += 1) { console.log(fizzbuzz(n)); }

const fizzbuzz = n => { if (n % 15 === 0) { return "FizzBuzz"; } else if (n % 3 === 0) { return "Fizz"; } else if (n % 5 === 0) { return "Buzz"; } else { return n; } }; for (let n = 1; n <= 100; n += 1) { console.log(fizzbuzz(n)); }

const fizzbuzz = n => { if (n % 15 === 0) { return "FizzBuzz"; } else if (n % 3 === 0) { return "Fizz"; } else if (n % 5 === 0) { return "Buzz"; } else { return n; } }; for (let n = 1; n <= 100; n += 1) { console.log(fizzbuzz(n)); }

Clojure Name: Popular Rubyists: Russ Olsen, Bozhidar Batsov, Arne Brasseur Rich Hickey, Lisp, JVM, () Known for: Self-assessment: a robust, practical, and fast programming language with a set of useful features that together form a simple, coherent, and powerful tool.

(defn fizzbuzz [n] (cond (zero? (mod n 15)) "FizzBuzz" (zero? (mod n 3)) "Fizz" (zero? (mod n 5)) "Buzz" :else n)) (run! println (map fizzbuzz (range 1 101)))

(defn fizzbuzz [n] (cond (zero? (mod n 15)) "FizzBuzz" (zero? (mod n 3)) "Fizz" (zero? (mod n 5)) "Buzz" :else n)) (run! println (map fizzbuzz (range 1 101)))

(defn fizzbuzz [n] (cond (zero? (mod n 15)) "FizzBuzz" (zero? (mod n 3)) "Fizz" (zero? (mod n 5)) "Buzz" :else n)) (run! println (map fizzbuzz (range 1 101)))

What you got?

Paradigm

Object Object Functional Functional Procedural Procedural Functional Functional Functional Procedural

Parallelism

Parallelism vs Concurrency

Concurrent Concurrent Yes Goroutines + channels Yes Agnostic Yes Actors Yes/No Webworkers+ Yes Mvar, par, STM Yes STM, pmap, Transducers

Performance!

Type System

Dynamic Static Inferred Static Inferred++ Static Inferred Dynamic Optional Inferred++ Static Inferred++ Dynamic Dynamic Optional Optional Inferred++ Inferred++

Compiled vs Interpreted

Interpreted Compiled Compiled Compiled Compiled Compiled Interpreted Compiled

Self-hosted

Show me your code

No Yes Yes Yes Yes Yes No No

GarbageCollection

Yes Yes Yes Yes Yes No Yes Yes

Single File Distribution

No Yes Yes Yes Yes Yes No No

Ruby-like Syntax

Yes Yes Yes No No No No No

Parallel

Parallel Typing

Parallel Typing Fast

So, what?

Expand Your Mind

Why did you learn a new language? Ruby's OO model was brain-expanding, and I was seeking more brain-expanding paradigms that would let me think entirely new thoughts.

Joy

Domain

Tools

Where does Ruby go?

Rails is strangling Ruby. In the same way that you don't quit because of a bad company, you quit because of a bad boss.

Where does Ruby go?

Parallel Typing Fast

Ruby is the best language I have used over my 30 years programming. I hope Ruby 3 puts an end to the Ruby is slow meme once and for all.

I really like Ruby for what it is, and don't think 'adding a type system' or something is the best way to keep Ruby relevant. Don't morph Ruby in to something it's not.

We re all great!

Explore some new lands!

Enjoy Coding & Learning in whatever language... Tobias Pfeiffer @PragTob pragtob.info