liveBook · Manning

What you will learn in Julia as a Second Language

General purpose programming with a taste of data science

by Erik Engheim

Chapter by chapter

Chapter 1: Why Julia?

1.1 What is Julia? · 1.1.1 Pros and cons of statically and dynamically typed languages · 1.2 Julia combines elegance, productivity, and performance · 1.3 Why Julia was created · 1.3.1 Scientists need the interactive programming that dynamically typed languages offer · 1.3.2 Developers in other fields also need the interactivity a dynamically typed language offers · 1.4 Julia’s higher performance solves the two-language problem · 1.5 Julia is for everyone · 1.6 What can I build with Julia? · 1.6.1 Julia in the sciences · 1.6.2 Nonscience uses of Julia · 1.7 Where Julia is less ideal · 1.8 What you will learn in this book · 1.9 Summary

What you learn in chapter 1 →

Chapter 2: Julia as a calculator

2.1 The Julia command line · 2.2 Using constants and variables · 2.2.1 Assigning and binding values to variables · 2.2.2 Using the ans variable · 2.2.3 What is a literal coefficient? · 2.3 Different number types and their bit length in Julia · 2.3.1 Writing numbers using different number formats · 2.4 Floating-point numbers · 2.4.1 Performing operations on integers and floating-point numbers · 2.5 Defining functions · 2.5.1 Storing function definitions in a file · 2.5.2 Working with functions in the REPL · 2.5.3 Functions everywhere · 2.5.4 Functions to work with numbers · 2.6 How to use numbers in practice · 2.7 Summary

What you learn in chapter 2 →

Chapter 3: Control flow

3.1 Navigation and trigonometry · 3.2 Boolean expressions · 3.2.1 Compound statements · 3.3 Looping · 3.3.1 Flowchart · 3.3.2 Making a mathematical table for the sine function · 3.3.3 Range objects · 3.3.4 For loops · 3.4 Multiline functions · 3.4.1 Implementing the sine trigonometric function · 3.5 Implementing factorial · 3.6 Factorial with recursion · 3.7 If statements · 3.7.1 If-else statements · 3.7.2 Elseif clause · 3.8 Throwing exceptions to handle errors · 3.9 Control flow vs. data flow · 3.10 Counting rabbits · 3.10.1 Base case · 3.10.2 Iteration vs. recursion · 3.10.3 To return or not return · 3.11 Summary

What you learn in chapter 3 →

Chapter 4: Julia as a spreadsheet

4.1 Analyzing pizza sales · 4.2 Different types of arrays · 4.3 Performing operations on arrays · 4.4 Working with the statistics module · 4.5 Accessing elements · 4.6 Creating arrays · 4.7 Mapping values in an array · 4.8 Introducing characters and strings · 4.9 Storing pizza data in tuples · 4.10 Filtering pizzas based on predicates · 4.10.1 Combining higher-order functions · 4.11 Mapping and reducing an array · 4.11.1 Sine table with map and reduce · 4.12 Counting matches with Boolean arrays · 4.13 Summary

What you learn in chapter 4 →

Chapter 5: Working with text

5.1 Making a pretty pizza sales table · 5.1.1 Print, println, and printstyled · 5.1.2 Printing multiple elements · 5.1.3 Printing multiple pizzas · 5.1.4 Align with lpad and rpad · 5.1.5 Adding lines · 5.2 Printing a trigonometric table · 5.3 Reading and writing pizza sales to CSV files · 5.3.1 Writing pizza sales to a file · 5.3.2 Reading pizza sales from a file · 5.4 Interacting with the user · 5.5 Summary

What you learn in chapter 5 →

Chapter 6: Storing data in dictionaries

6.1 Parsing Roman numerals · 6.2 Using the Dict type · 6.3 Looping over characters · 6.4 Enumerating values and indices · 6.5 Explaining the conversion process · 6.6 Using dictionaries · 6.6.1 Creating dictionaries · 6.6.2 Element access · 6.7 Why use a dictionary? · 6.8 Using named tuples as dictionaries · 6.8.1 When do you use a named tuple? · 6.8.2 Tying it all together · 6.9 Summary

What you learn in chapter 6 →

Chapter 7: Understanding types

7.1 Creating composite types from primitive types · 7.2 Exploring type hierarchies · 7.3 Creating a battle simulator · 7.3.1 Defining warrior types · 7.3.2 Adding behavior to warriors · 7.3.3 Using multiple dispatch to invoke methods · 7.4 How Julia selects method to call · 7.4.1 Contrasting Julia’s multiple dispatch with object-oriented languages · 7.4.2 How is multiple dispatch different from function overloading? · 7.5 Summary

What you learn in chapter 7 →

Chapter 8: Building a rocket

8.1 Building a simple rocket · 8.2 Maintaining invariants in your code · 8.3 Making objects with constructor functions · 8.4 Differences between outer and inner constructors · 8.5 Modeling rocket engines and payloads · 8.6 Assembling a simple rocket · 8.7 Creating a rocket with multiple stages and engines · 8.8 Launching a rocket into space · 8.9 Summary

What you learn in chapter 8 →

Chapter 9: Conversion and promotion

9.1 Exploring Julia’s number promotion system · 9.2 Understanding number conversion · 9.3 Defining custom units for angles · 9.3.1 Defining angle constructors · 9.3.2 Defining arithmetic operations on angles · 9.3.3 Defining accessors to extract degrees, minutes, and seconds · 9.3.4 Displaying DMS angles · 9.3.5 Defining type conversions · 9.3.6 Making pretty literals · 9.3.7 Type promotions · 9.4 Summary

What you learn in chapter 9 →

Chapter 10: Representing unknown values

10.1 The nothing object · 10.2 Using nothing in data structures · 10.2.1 What is a parametric type? · 10.2.2 Using union types to end the wagon train · 10.3 Missing values · 10.4 Not a number · 10.5 Undefined data · 10.6 Putting it all together · 10.7 Summary

What you learn in chapter 10 →

Chapter 11: Working with strings

11.1 UTF-8 and Unicode · 11.1.1 Understanding the relation between code points and code units · 11.2 String operations · 11.2.1 Converting from camel case to snake case · 11.2.2 Converting between numbers and strings · 11.2.3 String interpolation and concatenation · 11.2.4 sprintf formatting · 11.3 Using string interpolation to generate code · 11.4 Working with nonstandard string literals · 11.4.1 DateFormat strings · 11.4.2 Raw strings · 11.4.3 Using regular expressions to match text · 11.4.4 Making large integers with BigInt · 11.4.5 MIME types · 11.5 Summary

What you learn in chapter 11 →

Chapter 12: Understanding Julia collections

12.1 Defining interfaces · 12.2 Propellant tank interface example · 12.3 Interfaces by convention · 12.4 Implementing engine cluster iteration · 12.4.1 Making clusters iterable · 12.5 Implementing rocket stage iteration · 12.5.1 Adding support for map and collect · 12.6 Comparison of linked lists and arrays · 12.6.1 Adding and removing elements · 12.7 Utility of custom types · 12.8 Summary

What you learn in chapter 12 →

Chapter 13: Working with sets

13.1 What kind of problems can sets help solve? · 13.2 What is a set? · 13.2.1 Comparing properties of sets and arrays · 13.3 How to use set operations · 13.4 How to use sets in your code · 13.5 Searching for products using set operations · 13.5.1 Defining and using enumerations · 13.5.2 Creating test data to perform queries on · 13.5.3 Searching for screws · 13.5.4 Putting screw objects into sets · 13.5.5 Looking up screws using dictionaries · 13.6 Search in bug tracker using sets · 13.7 Relational databases and sets · 13.8 Summary

What you learn in chapter 13 →

Chapter 14: Working with vectors and matrices

14.1 Vectors and matrices in mathematics · 14.2 Constructing a matrix from rows and columns · 14.3 The size, length, and norm of an array · 14.4 Slicing and dicing an array · 14.5 Combining matrices and vectors · 14.6 Creating matrices · 14.7 Summary

What you learn in chapter 14 →

Chapter 15: Functional programming in Julia

15.1 How does functional programming differ from object-oriented programming? · 15.2 How and why you should learn to think functionally · 15.3 Avoid deeply nested calls with function chaining · 15.3.1 Understanding anonymous functions and closures · 15.3.2 Using the pipe operator |> · 15.3.3 Conveniently produce new functions using partial application · 15.4 Implementing Caesar and substitution ciphers · 15.4.1 Implementing the Caesar cipher · 15.4.2 Implementing substitution ciphers · 15.5 Creating a cipher-algorithm-agnostic service · 15.6 Building an encryption service using object-oriented programming · 15.7 Building an encryption service using functional programming · 15.7.1 Defining a functional Caesar cipher · 15.7.2 Defining a functional substitution cipher · 15.7.3 Implementing a functional password-keeper service · 15.8 Summary

What you learn in chapter 15 →

Chapter 16: Organizing and modularizing your code

16.1 Setting up a work environment · 16.1.1 Using a package in the REPL · 16.1.2 How modules relate to packages · 16.2 Creating your own package and module · 16.2.1 Generating a package · 16.2.2 Adding code to your package · 16.3 Modifying and developing a package · 16.4 Tackling common misconceptions about modules · 16.5 Testing your package · 16.6 Summary

What you learn in chapter 16 →

Chapter 17: Input and output

17.1 Introducing Julia’s I/O system · 17.2 Reading data from a process · 17.3 Reading and writing to a socket · 17.4 Parsing a CSV file · 17.4.1 Loading rocket engine data · 17.4.2 Saving rocket engine data · 17.5 Summary

What you learn in chapter 17 →

Chapter 18: Defining parametric types

18.1 Defining parametric methods · 18.2 Defining parametric types · 18.3 Type safety benefits from parametric types · 18.4 Performance benefits from parametric types · 18.5 Memory benefits of parametric types · 18.6 Summary

What you learn in chapter 18 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.