for Fun and Profit Why - Strong Community Incredibly Fast Expressive and Terse Type System Easy to transition from R But first… Let’s walk through a machine installation. Windows Machine Installation http://julialang.org/downloads/ Ubuntu Installation ’s Creators and Community The Fab Four • A grad student with a great idea • An wisened industry heavy hitter • A mathematics professor • A physical sciences researcher Jeff Bezanson • Recent PhD, MIT • Thesis: “Abstractions in Technical Computing” • Translation: “Julia, My New Lang” Stefan Karpinski • Language Co-Creator • Industry Heavy-Hitter • Work Experience • Akamai • Citrix Online • Etsy Alan Edelman • Professor of Applied Mathematics, MIT • Jeff’s thesis advisor • Specializes in “Random Matrix Theory” • Julia’s Linear Algebra libraries bear his mark Viral Shah • PhD Computer Science • Co-inventor of Julia • Researcher in Biological / Physical Sciences It’s all open source! (and very active) (and interactive) Next Topic: Language Speed • We’ll evaluate the claim that “Julia is Fast” • Particularly in comparison to R Speed Case Study – Conditional Probability • You are a Commodity Trader • Let’s say you know that a certain fruit will be profitable • Given that fruit is profitable, what is the probability some other fruit will be profitable? • Example: • “I know Apples will be profitable tomorrow. Historically, Bananas are profitable 90% of the days that Apples are profitable. Therefore, I will also trade Bananas.” Input Data Fruits Historical Days Input Data Fruits Days March 5th, 2012 Desired Output Fruits Fruits P(Guava|Bananas) = 0.325 Julia Implementation (No BLAS) Julia Implementation (BLAS) R Implementation Benchmarked Comparison Published Benchmarks: http://julialang.org/ http://julialang.org/benchmarks/ Next Topic: Type System Type System Features Comparison Julia C++ Java C# Python Dynamic Typing X X Static Typing X X X X Abstract Types X X X X Parametric Types X X X X X X Covariance / Contravariance Multiple Inheritance Union Types X X Totals 6 X X X X X X X X Haskell X X Tuples Interfaces / Traits / Contracts X R X X X X X X 7 5 6 X 4 2 6 How to evaluate a Type System? • Terseness • Case Study: Generic Binary Trees • Languages Compared: Julia vs. C# • Expressiveness • Case Study: SKI Combinator Calculus • Languages Compared: Haskell vs. Julia vs. C# Type System Case Study: Terseness • Problem Space: OOP • Generic Binary Trees • Julia vs. C# • Criteria: Which can be done in less lines of code? C# Implementation Total: 32 lines of code Julia Implementation Total: 10 lines of code Type System Case Study 2: Expressiveness • Problem Space: Logic / Computer Science • The SKI Combinators are an alternative basis for computation, like the lambda calculus • Julia vs. Haskell • Criteria: Can it even be done? • If you’re interested: Julia Implementation Haskell Implementation I’m an R guy. Will I be comfortable with Julia? Which one is R? Thank you! kyle.pena@nlplogix.com https://github.com/kyle-pena-nlp Time Permitting https://www.juliabox.org/ Language Basics • Control Flow • Functions • Types • Parametric Types (Generics) Control Flow – If/ElseIf Control Flow – For Loop Control Flow – While Loop Control Flow – Try/Catch Composite Types Parametric aka Generic Types C# Equivalent: