$30 off During Our Annual Pro Sale. View Details »

Ruby Alternatives in 2017

ASoft
June 22, 2017

Ruby Alternatives in 2017

Dmitry Halai, Minsk.rb, 2017
https://blog.asoft.co/ruby-alternatives-in-2017-a737e2cf93d

ASoft (https://asoft.co/) is a software company with a strong focus on the quality of code and products.
Our main activities are chatbots and e-commerce apps.
Do you want to be a part of a great team? Join us https://asoft.co/join-us!

ASoft

June 22, 2017
Tweet

More Decks by ASoft

Other Decks in Programming

Transcript

  1. Ruby Alternatives
    in 2017
    Dmitry Halai ASoft.co

    View Slide

  2. WHOAMI
    @dm_halai
    dmitry.halai
    d-halai.com

    View Slide

  3. WHOAMI
    ASOFT.CO

    View Slide

  4. WHOAMI

    View Slide

  5. View Slide

  6. WHAT’S THE CHOICE?

    View Slide

  7. REALITY (GT)

    View Slide

  8. REALITY (SOT)

    View Slide

  9. REAL REALITY

    View Slide

  10. View Slide

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

    View Slide

  12. 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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  17. – 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.”

    View Slide

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

    View Slide

  19. View Slide

  20. 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)

    View Slide

  21. 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)

    View Slide

  22. 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)

    View Slide

  23. 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)

    View Slide

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

    View Slide

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

    View Slide

  26. View Slide

  27. CLOJURE

    View Slide

  28. CLOJURE

    View Slide

  29. 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

    View Slide

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

    View Slide

  31. 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

    View Slide

  32. CLOJURE
    MACRO SYSTEM & PROTOCOLS

    View Slide

  33. CLOJURE
    LAZY EVALUATION

    View Slide

  34. CLOJURE
    STM

    View Slide

  35. CLOJURE
    TOOLS
    ClojureScript
    https://github.com/razum2um/awesome-clojure
    Datomic
    Leiningen
    Ring

    Core.async
    Luminus

    View Slide

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

    View Slide

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

    View Slide

  38. CLOJURE

    View Slide

  39. CLOJURE
    http://clojurecourse.by

    View Slide

  40. GO

    View Slide

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

    View Slide

  42. GO
    PACKAGE SYSTEM

    View Slide

  43. GO
    STRUCTS

    View Slide

  44. GO
    POINTERS

    View Slide

  45. GO
    DEFER

    View Slide

  46. GO
    INTERFACES & TYPE SWITCHES

    View Slide

  47. GO
    GOROUTINES & CHANNELS

    View Slide

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

    Gin

    View Slide

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

    View Slide

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

    View Slide

  51. GO

    View Slide

  52. GO
    https://tour.golang.org

    View Slide

  53. ELIXIR
    CLEAR CODE IS BETTER THAN CONCISE CODE

    View Slide

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

    View Slide

  55. ELIXIR
    |>, PATTERN MATCHING, DESTRUCTURING

    View Slide

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

    View Slide

  57. ELIXIR
    POLYMORPHISM VIA PROTOCOLS

    View Slide

  58. ELIXIR
    ACTORS & AGENTS

    View Slide

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

    View Slide

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

    Edeliver
    Plug

    View Slide

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

    View Slide

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

    View Slide

  63. ELIXIR

    View Slide

  64. ELIXIR

    View Slide

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

    View Slide

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

    View Slide

  67. ALREADY BUT NOT YET

    View Slide

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

    View Slide

  69. BOOK

    View Slide

  70. REAL REALITY

    View Slide

  71. FIN
    ASOFT.CO

    View Slide