Slide 1

Slide 1 text

Ruby Alternatives in 2017 Dmitry Halai ASoft.co

Slide 2

Slide 2 text

WHOAMI @dm_halai dmitry.halai d-halai.com

Slide 3

Slide 3 text

WHOAMI ASOFT.CO

Slide 4

Slide 4 text

WHOAMI

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

WHAT’S THE CHOICE?

Slide 7

Slide 7 text

REALITY (GT)

Slide 8

Slide 8 text

REALITY (SOT)

Slide 9

Slide 9 text

REAL REALITY

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

TIOBE* * https://www.tiobe.com/tiobe-index/ The Importance Of Being Earnest Search engines: Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu Keyword: " programming"

Slide 12

Slide 12 text

PYPL* * http://pypl.github.io/PYPL.html Keyword: " tutorial" Share – linear regression over the last 12 Summary: Java is the most popular language, Python grew the most in the last 5 years (8.7%) and PHP lost the most (-5.0%) Source: Google Trends

Slide 13

Slide 13 text

PYPL* * http://pypl.github.io/PYPL.html

Slide 14

Slide 14 text

SO SURVEY 2017* * https://insights.stackoverflow.com/survey/2017 Most Popular Most Popular (Web Devs)

Slide 15

Slide 15 text

SO SURVEY 2017* * https://insights.stackoverflow.com/survey/2017

Slide 16

Slide 16 text

SO SURVEY 2017* * https://insights.stackoverflow.com/survey/2017 Most Loved Top Paying

Slide 17

Slide 17 text

– Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship “It is not the language that makes programs appear simple. It is the programmer that make the language appear simple.”

Slide 18

Slide 18 text

WHY SHOULD WE LEARN? — Have more opportunities — Make right decisions — Just for fun — Grow up as engineers

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

HISTORY OF LANGUAGES . 1822 Charles Babbage’s difference engine (mechanical computation of polynomial functions) . 1942 ENIAC (electrical signals) . 1945 John Von Neumann (shared-program technique & conditional control transfer) . 1957 FORTRAN (FORmula TRANslating system. Procedural programming. IF, DO, GOTO, basic types, alternative to assembly language)

Slide 21

Slide 21 text

HISTORY OF LANGUAGES . 1958 LISP (LISt Processing. The first dynamically typed functional programming language. Designed for AI, tree data structures, automatic storage management) . 1959 COBOL (Common Business-Oriented Language. numbers, strings, arrays, records) . 1964 BASIC (Beginner’s All-purpose Symbolic Instruction Code. GC) . 1968 Pascal (teaching purpose, structured programming, improved the “pointer” data type CASE)

Slide 22

Slide 22 text

HISTORY OF LANGUAGES . 1972 C (Dynamic variables, multitasking, interrupt handling, forking, and strong, low-level, input-output) . 1980 Smalltalk (OOP. MVC, reflection) . 1983 C++ (C With Classes. Virtual functions and templates) . 1983 Objective-C (Message-passing functionality based on Smalltalk language) . 1986 Erlang (concurrent programming)

Slide 23

Slide 23 text

HISTORY OF LANGUAGES . 1987 Perl (Practical Extraction and Reporting Language, report processing, improved version of sed and awk tools) . 1990 Haskell (purely functional programming) . 1993 Ruby (Designed for productive and enjoyable programming) . 1995 Java (Cross-platform functionality) . 1995 JavaScript (prototyping model)

Slide 24

Slide 24 text

HISTORY OF LANGUAGES . 2001 C# . 2003 Scala . Clojure 2007 . 2009 Go . Rust 2010 . 2012 Elixir

Slide 25

Slide 25 text

HISTORY OF LANGUAGES . 2001 C# . 2003 Scala . Clojure 2007 . 2009 Go . Rust 2010 . 2012 Elixir Most Loved Top Paying

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

CLOJURE

Slide 28

Slide 28 text

CLOJURE

Slide 29

Slide 29 text

CLOJURE 1. “Cambridge Polish” syntax (S-expressions) 2. “Data as code” strategy 4. Lazy Evaluation 5. STM (software transactional memory) 3. Macro system and protocols KEY FEATURES

Slide 30

Slide 30 text

CLOJURE “S-EXPRESSIONS” SYNTAX OR(x, y) vs x OR y

Slide 31

Slide 31 text

CLOJURE “DATA AS CODE” STRATEGY Homoiconicity* Language text has the same structure as its abstract syntax tree (AST) * https://en.wikipedia.org/wiki/Homoiconicity Clojure code is just nested lists of symbols that can be evaluated

Slide 32

Slide 32 text

CLOJURE MACRO SYSTEM & PROTOCOLS

Slide 33

Slide 33 text

CLOJURE LAZY EVALUATION

Slide 34

Slide 34 text

CLOJURE STM

Slide 35

Slide 35 text

CLOJURE TOOLS ClojureScript https://github.com/razum2um/awesome-clojure Datomic Leiningen Ring … Core.async Luminus

Slide 36

Slide 36 text

CLOJURE REAL EXAMPLES https://clojure.org/community/companies

Slide 37

Slide 37 text

CLOJURE CONS PROS + the ecosystem (JVM) + concurrency + data is code - prefix notation - readability - learning curve

Slide 38

Slide 38 text

CLOJURE

Slide 39

Slide 39 text

CLOJURE http://clojurecourse.by

Slide 40

Slide 40 text

GO

Slide 41

Slide 41 text

GO KEY FEATURES 1. Package system 2. Structs 5. Interfaces & type switches 6. Goroutines & channels 3. Pointers 4. Defer

Slide 42

Slide 42 text

GO PACKAGE SYSTEM

Slide 43

Slide 43 text

GO STRUCTS

Slide 44

Slide 44 text

GO POINTERS

Slide 45

Slide 45 text

GO DEFER

Slide 46

Slide 46 text

GO INTERFACES & TYPE SWITCHES

Slide 47

Slide 47 text

GO GOROUTINES & CHANNELS

Slide 48

Slide 48 text

GO TOOLS Bigcache https://github.com/avelino/awesome-go CockroachDB Godoc Testing … Gin

Slide 49

Slide 49 text

GO REAL EXAMPLES https://github.com/golang/go/wiki/GoUsers Need some more?

Slide 50

Slide 50 text

GO CONS PROS + learning curve, simplicity + GC + no VM - no REPL - no generics - size of binaries + infrastructure + concurrency - pointers

Slide 51

Slide 51 text

GO

Slide 52

Slide 52 text

GO https://tour.golang.org

Slide 53

Slide 53 text

ELIXIR CLEAR CODE IS BETTER THAN CONCISE CODE

Slide 54

Slide 54 text

ELIXIR 1. Pipeline operator, pattern matching, destructuring 2. Metaprogramming & macroses 4. Actors & Agents 5. Erlang/OTP 3. Polymorphism via protocols KEY FEATURES

Slide 55

Slide 55 text

ELIXIR |>, PATTERN MATCHING, DESTRUCTURING

Slide 56

Slide 56 text

ELIXIR METAPROGRAMMING & MACROSES AST -> MACROS -> AST https://qed.elixir.pm/

Slide 57

Slide 57 text

ELIXIR POLYMORPHISM VIA PROTOCOLS

Slide 58

Slide 58 text

ELIXIR ACTORS & AGENTS

Slide 59

Slide 59 text

ELIXIR ERLANG/OTP http://learnyousomeerlang.com/what-is-otp

Slide 60

Slide 60 text

ELIXIR TOOLS Ecto https://github.com/h4cc/awesome-elixir Phoenix Mix Cowboy … Edeliver Plug

Slide 61

Slide 61 text

ELIXIR REAL EXAMPLES https://github.com/doomspork/elixir-companies

Slide 62

Slide 62 text

ELIXIR CONS PROS + the ecosystem (Erlang, Phoenix, Ecto) + concurrency + syntax, readability - small amount of libraries - deployment process + learning curve

Slide 63

Slide 63 text

ELIXIR

Slide 64

Slide 64 text

ELIXIR

Slide 65

Slide 65 text

RUBY? https://stackshare.io/stackups/ruby-vs-clojure-vs-go-vs-elixir

Slide 66

Slide 66 text

RUBY? — Mature — Great for an MVPs — Ruby 3x3? — Still works for the most cases — Community — Lots of work

Slide 67

Slide 67 text

ALREADY BUT NOT YET

Slide 68

Slide 68 text

WHAT’S NEXT? RUST SCHEME ELM F# HASKELL ERLANG CRYSTAL TYPESCRIPT SCALA

Slide 69

Slide 69 text

BOOK

Slide 70

Slide 70 text

REAL REALITY

Slide 71

Slide 71 text

FIN ASOFT.CO