WE ARE ALL BLESSED. Bruce Tate

Similar documents
Macros, and protocols, and metaprogramming - Oh My!

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

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

Phoenix Is Not Your Application. Lance Halvorsen ElixirConf EU 2016

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

S AMPLE CHAPTER. Erlang AND OTP IN ACTION. Martin Logan Eric Merritt Richard Carlsson FOREWORD BY ULF WIGER MANNING

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

Erlang: distributed programming

The. Pragmatic Bookshelf. PragPub. The Second Iteration IN THIS ISSUE. * José Valim on Swift, Ruby, & Elixir

CPS506 - Comparative Programming Languages Elixir

Building a video conference (WebRTC) controller with Elixir. Or how Elixir was introduced into VoiSmart

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

Erlang 101. Google Doc

porcelain Documentation

It s good to be here... I almost wasn t. Beautiful Tests by Bruce A. Tate icanmakeitbe*er

Look at all these toys!

QuickCheck Mini for Elixir. Thomas Arts Quviq AB

A programming example. A Ray Tracer. ray tracing. Architecture

Versioned APIs with Phoenix. Elvio Vicosa

Chapter 4 Defining Classes I

Learn Functional Programming with Elixir

Closures. Mooly Sagiv. Michael Clarkson, Cornell CS 3110 Data Structures and Functional Programming

Macro #clojureconj

functional ErlangVM Parallelism

Static Semantics. Lecture 15. (Notes by P. N. Hilfinger and R. Bodik) 2/29/08 Prof. Hilfinger, CS164 Lecture 15 1

An introduction to Erlang & Elixir. Meetup October 28, Organized by Jean-François Cloutier Held at The Casco Bay Technology Hub, Portland, ME

Code Generation. The Safety Scissors Of Metaprogramming

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

Closures. Mooly Sagiv. Michael Clarkson, Cornell CS 3110 Data Structures and Functional Programming

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

CMSC 621 Case Study on Programming Languages

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

Topic I. Introduction and motivation References: Chapter 1 of Concepts in programming languages by J. C. Mitchell. CUP, 2003.

Lecture 21: The Many Hats of Scala: OOP 10:00 AM, Mar 14, 2018

Swift, functional programming, and does it matter? Alexis

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

Preface. WELCOME to Filthy Rich Clients. This book is about building better, more. Organization

CS 11 Haskell track: lecture 1

Chapter 5 Names, Binding, Type Checking and Scopes

Outline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples

Scope. Chapter Ten Modern Programming Languages 1

Template Haskell based implementation of printf

Lecture 16: Static Semantics Overview 1

CSE341: Programming Languages Lecture 9 Function-Closure Idioms. Dan Grossman Winter 2013

Intro. Scheme Basics. scm> 5 5. scm>

Clojure. A (not-so-pure) functional approach to concurrency. Paolo Baldan Linguaggi per il Global Computing AA 2016/2017

A Small Web Server. Programming II - Elixir Version. Johan Montelius. Spring Term 2018

RubyConf China. Why Ruby? Yukihiro "Matz" Matsumoto. Copyright (c) 2008 Yukihiro "Matz" Matsumoto, No rights reserved

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

Concepts in Programming Languages

Beyond Blocks: Python Session #1

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Custom Specializers in Object-Oriented Lisp

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

They are a block of code plus the bindings to the environment they came from (Ragusa Idiom / function object).

Delegate.Sandbox: I/O side-effects safe computations in Prosa F#unctional Copenhageners Meetup Group (MF#K)

Programming Languages

Mobile Computing Professor Pushpedra Singh Indraprasth Institute of Information Technology Delhi Activity Logging Lecture 16

Author: Paul Zenden. Hot-or-Not Elixir with José Valim

of making things look better with CSS, and you have a much better platform for interface development.

Next: What s in a name? Programming Languages. Data model in functional PL. What s in a name? CSE 130 : Fall Lecture 13: What s in a Name?

Programmiersprachen (Programming Languages)

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

Use Case Level Pointcuts ECOOP 2004 Jonathan Sillito, Christopher Dutchyn, Andrew David Eisenberg and Kris De Volder

Mainframe Tutorials Cobol Db2 Jcl Cics Tutorials

Nano-Lisp The Tutorial Handbook

Module 10: Imperative Programming, Modularization, and The Future

Alan J. Perlis - Epigrams on Programming

CS558 Programming Languages

Thanks! Review. Course Goals. General Themes in this Course. There are many programming languages. Teaching Assistants. John Mitchell.

CSE 341 Section 7. Ethan Shea Autumn Adapted from slides by Nicholas Shahan, Dan Grossman, Tam Dang, and Eric Mullen

The Future of the Realtime Web BETTER APIS WITH GRAPHQL. Josh

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

Monkeybars Tools-enabled Swing development with JRuby

More Examples. Lecture 24: More Scala. Higher-Order Functions. Control Structures

Getting Started with Web Services

Real Time Rack. Konstantin Haase

Beyond JavaScript Frameworks: Writing Reliable Web Apps With. Elm. Erik Wendel DevDays Vilnius 2018

1 A question of semantics

CSE 341, Spring 2011, Final Examination 9 June Please do not turn the page until everyone is ready.

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to

Programming Languages

Mavrig. a Tcl application construction kit. Jean-Claude Wippler Equi 4 Software, NL. EuroTcl 2008, Strasbourg, FR

Designing API: 20 API Paradoxes. Jaroslav Tulach NetBeans Platform Architect

Beautiful Concurrency with Erlang

Getting Started with Web Services

Modeling pilot project at Ericsson Expert Analytics

Java Object Oriented Design. CSC207 Fall 2014

Lesson 13 Transcript: User-Defined Functions

CS 314 Principles of Programming Languages

Frustrated by all the hype?

Chapter 1 Introduction

CS 345. Functions. Vitaly Shmatikov. slide 1

CSC207H: Software Design. Java + OOP. CSC207 Winter 2018

Concepts of programming languages

Chapter 3:: Names, Scopes, and Bindings (cont.)

Ruby: Introduction, Basics

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

Software Project Seminar VII: Tools of the Craft. 23 march 2006 Jevgeni Kabanov

Topic 6: Exceptions. Exceptions are a Java mechanism for dealing with errors & unusual situations

Transcription:

WE ARE ALL BLESSED Bruce Tate Dave Thomas @redrapids @pragdave 1

DAVE'S STORY 2

3

4

https://upload.wikimedia.org/wikipedia/commons/0/0b/hand-operated_card_punch-2.jpg 5

https://upload.wikimedia.org/wikipedia/commons/e/e8/ibm_card_punch_029.jpg 6

ALWAYS LOVED LANGUAGES Algol, APL, APT, Basic, BCP, C, C++, COBOL, Delphi, TECO, TCL, TeX, XSLT 7

comp.lang.misc 8

BRUCE'S STORY 9

http://home.arcor.de/andreas.pernau/images/tandy_radio_shack_trs-80_color_computer_full.jpg 10

http://www.trs-80.com/images/hwimage-model-ii-rsc03-[26-4001]-(rs).png 11

I REALLY LOVED BASIC. 12

13

MOSTLY PASCAL; C, LISP... 14

I LIKED PASCAL. 15

16

C, C++, JAVA. 17

I TOLERATED JAVA. 18

SOLO 19

LOVE / HATE RELATIONSHIP 20

https://upload.wikimedia.org/wikipedia/commons/c/c3/cq311_switching_tracks.jpg

21 SHUT UP AND DO SOMETHING NONTRIVIAL IN RUBY, AND THEN WE CAN TALK. - Dave Thomas

22

Pragmatic Bookshelf 23

Pragmatic Bookshelf 24

25

26

There is a central quality which is the root criterion of life and spirit in a man, a town, a building, or a wilderness. This quality is objective and precise, but it cannot be named. Christopher Alexander The Timeless Way of Building http://alchetron.com/christopher-alexander-127022-w

27 QUALITY WITHOUT A NAME 28

QWAN 29

QWAN COMPLETENESS 30

It seems there is a positive correlation between the simplicity of the rules and the quality of the algebra as a description tool. Peter Henderson https://github.com/shashi/escher-demo

31 SOUL 32

I KNOW IT WHEN I SEE IT https://prezi.com/ly46uhwu9vrj/apple-history/ http://www.sandyflat.net/digerati/ibmps1/index.htm 33

I KNOW IT WHEN I SEE IT Angus L. Macdonald Bridge, Halifax, Nova Scotia, Canada Salim Virji 34

I KNOW IT WHEN I SEE IT int sum = 0; for (int i = 0; i < sizeof(arr)/sizeof(arr[0]), i++) { sum += arr[i]; } return sum; list > Enum.reduce(&+/2) 35

QWAN IN RUBY 36

RUN CODE DURING "COMPILATION" class Dictionary end WORDS = File.readlines("/usr/dict/words") def size WORDS.size end 37

METAPROGRAMMING AND DSLS get '/' do "Hello, World!. It's #{Time.now}" end 38

METAPROGRAMMING AND DSLS set(:probability) { value condition { rand <= value } } get '/win_a_car', :probability => 0.1 do "You won!" end get '/win_a_car' do "Sorry, you lost." end http://www.sinatrarb.com/intro.html 39

DUCKTYPING AND THE OBJECT MODEL test "'not found' is handled" do mock_server = "xxx" def mock_server.query(*) { status: 404, message: "not found" } end response = @my_app.send_query(mock_server) end assert_equal :not_found, response 40

(YOUR AESTHETICS MAY VARY ) 41

QWAN IN ELIXIR 42

signature = join(sort(to_list(word))))

43 signature = word > to_list > sort > join More than a convenience it reflects and reinforces a key facet of functional programming.

44 signature = word > to_list > sort > join FUNCTIONS TRANSFORM DATA

45 SPEAKING OF FUNCTIONS case File.open("somedata.csv") do {:ok, file} -> process(file) {:error, reason} -> report(reason) end 46

SPEAKING OF FUNCTIONS "somedata.csv" > File.open > case({:ok, file} -> process(file) {:error, reason} -> report(reason)) It's all transformations 47

defmodule LogWriter do def log(msg) do if Application.get_env(:app, :debug) do IO.puts msg end end end How many reserved words?

48 %C %R %S %W %c %r %s %w &&! >.. :: <> = @ ^ CALLER DIR ENV MODULE aliases block alias! alias and binding callback case cond def defdelegate defexception defimpl defmodule defoverridable defp defprotocol defstruct destructure for get_and_update_in if import in is_nil match? or put_in quote raise receive require reraise super to_char_list to_string try unless unquote update_in use var! with 49

THE LANGUAGE IS THE LANGUAGE %C %R %S %W %c %r %s %w &&! >.. :: <> = @ ^ CALLER DIR ENV MODULE aliases block alias! alias and binding callback case cond def defdelegate defexception defimpl defmodule defoverridable defp defprotocol defstruct destructure for get_and_update_in if import in is_nil match? or put_in quote raise receive require reraise super to_char_list to_string try unless unquote update_in use var! with 50

EMPATHY 51 52 53 54

%%%------------------------------------------------------------------- %%% @author some name me@hostname.local %%% @copyright (C) 2013, some name %%% @doc %%% %%% @end %%% Created : 26 May 2013 by some name me@hostname.local %%%------------------------------------------------------------------- -module(). -behaviour(gen_server). %% API -export([start_link/0]). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). -define(server,?module). -record(state, {}). %%%=================================================================== %%% API %%%=================================================================== %%-------------------------------------------------------------------- %% @doc %% Starts the server %% %% @spec start_link() -> {ok, Pid} ignore {error, Error} %% @end %%-------------------------------------------------------------------- start_link() -> gen_server:start_link({local,?server},?module, [], []). %%%=================================================================== %%% gen_server callbacks %%%=================================================================== %%-------------------------------------------------------------------- %% @private %% @doc %% Initializes the server %% %% @spec init(args) -> {ok, State} 128 lines 22 lines of code

55 defmodule MyServer do use GenServer #... end

56 defmodule Agent.Server do use GenServer def init(fun) do initial_call(fun) {:ok, run(fun, [])} end def handle_call({:get, fun}, _from, state) do {:reply, run(fun, [state]), state} end def handle_call({:get_and_update, fun}, _from, state) do case run(fun, [state]) do {reply, state} -> {:reply, reply, state} end end other -> {:stop, {:bad_return_value, other}, state}

57 THE QWAN GOES ON Testing Protocols Rationalized library APIs Mix Hex exrm People... 58

David Merrett. CCA. https://www.flickr.com/photos/davehamster/364659502/in/pool-cathedralphoto/

59 QWAN IS TWO WAY WE ARE INSPIRED IN THE PRESENCE OF QUALITY 60

PIPELINES AND PROTOCOLS INSPIRE US TO CODE IN TERMS OF TRANSFORMATIONS 61

BEHAVIOURS AND MACROS INSPIRE US TO CODE IN THE DOMAIN, NOT THE IMPLEMENTATION 62

GREAT DOCUMENTATION INSPIRES US TO WRITE MORE THAN CODE (WHICH MAKES US THINK ABOUT OUR WORK DIFFERENTLY) 63

MODULARITY AND EXRM INSPIRE US TO WRITE TINY APPS AND DEPLOY OFTEN 64

GREAT LEADERS INSPIRE US TO EMULATE THEM 65

BUT THIS IS DIFFICULT... http://www.mountainsoftravelphotos.com/everest/best/slides/gokyo%205%20scoundrels%20view%208-2%20everest%20close%20up.jpg 66

LANGUAGE MAKING IS SEEKING QWAN 67 68

LANGUAGE MAKING IS SOMETIMES HARD 69

LANGUAGE MAKING IS SOMETIMES MESSY 70

HOW TO REACH THE TOP? 71

SHERPA SHR - pə A people living on the border of Nepal and Tibet. Sherpas live at a high altitude. They are capable of functioning at a much higher level at the high elevations found on Everest. 72

(http://www.nbcnews.com/storyline/nepal-earthquake/nobukazu-kuriki-aims-summit-everest-summit-5th-attempt-n415341)

73 SHERPAS MAKE CAMP 74

THE ERLANG TEAM 75

JOSÉ'S GREAT DECISION 76

http://1of7.org/blog/13983880 (1 of 7 blog)

77 SHERPAS TAKE THE HEAVIEST LOADS 78

PLUG 79

https://2012everestbasecamp.files.wordpress.com/2012/01/everest-l110-869.jpg

80 SHERPAS PREPARE THE WAY 81

ELIXIR AND ELM 82

A DARK HISTORY National Geographic http://ngs-remote-video-import.s3.amazonaws.com/ng_video/00000149-1a04-d937-afdb-da3e5ff60000-why-sherpas-climb.jpeg 83

WE ARE ALL SHERPAS 84

85

86

87

88

89

90

91

92

93

94

WHAT YOU DO... WILL AFFECT WHAT THEY WILL DO 95

WE CAN SHARE THE LOAD 96

NOT BECAUSE WE HAVE TO 97

BUT BECAUSE WE ARE BLESSED. 98

BUT BECAUSE WE ARE BLESSED! 99