Book Image

Getting Started with Julia

By : Ivo Balbaert
Book Image

Getting Started with Julia

By: Ivo Balbaert

Overview of this book

Table of Contents (19 chapters)
Getting Started with Julia
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
The Rationale for Julia
Index

Preface

Julia is a new programming language that was developed at MIT in the Applied Computing Group under the supervision of Prof. Alan Edelman. Its development started in 2009, and it was first presented publicly in February 2012. It is still a fairly young language when you look at the current Version number (0.3), but its foundation is stable; the core language has had no backwards incompatible changes since Version 0.1. It is based on clear and solid principles, and its popularity is steadily increasing in the technical, data scientist, and high-performance computing arenas. In the section The Rationale for Julia, we present an overview of the principles on which Julia is based and compare them to other languages.

What this book covers

Chapter 1, Installing the Julia Platform, guides you with the installation of all the necessary components required for a Julia environment. It teaches you how to work with Julia's console (the REPL) and discusses some of the more elaborate development editors you can use.

Chapter 2, Variables, Types, and Operations, discusses the elementary built-in types in Julia, and the operations that can be performed on them, so that you are prepared to start writing the code with them.

Chapter 3, Functions, explains why functions are the basic building blocks of Julia, and how to effectively use them.

Chapter 4, Control Flow, shows Julia's elegant control constructs, how to perform error handling, and how to use coroutines (called Tasks in Julia) to structure the execution of your code.

Chapter 5, Collection Types, explores the different types that group individual values, such as arrays and matrices, tuples, dictionaries, and sets.

Chapter 6, More on Types, Methods, and Modules, digs deeper into the type concept and explains how this is used in multiple dispatch to get C-like performance. Modules, a higher code organizing concept, are discussed as well.

Chapter 7, Metaprogramming in Julia, touches on the deeper layers of Julia, such as expressions and reflection capabilities, and demonstrates the power of macros.

Chapter 8, I/O, Networking, and Parallel Computing, shows how to work with data in files and databases using DataFrames. We can explore the networking capabilities, and shows how to set up a parallel computing environment with Julia.

Chapter 9, Running External Programs, looks at how Julia interacts with the command line and other languages and also discusses performance tips.

Chapter 10, The Standard Library and Packages, digs deeper into the standard library and demonstrates the important packages for visualization of data.

Appendix, List of Macros and Packages, provides you with handy reference lists of the macros and packages used in this book.

What you need for this book

To run the code examples in the book, you will need the Julia platform for your computer, which can be downloaded from http://julialang.org/downloads/. To work more comfortably with Julia scripts, a development environment such as IJulia, Sublime Text, or LightTable is advisable. Chapter 1, Installing the Julia Platform, contains detailed instructions to set up your Julia environment.

Who this book is for

This book is intended for the data scientist and for all those who work in technical and scientific computation projects. It will get you up and running quickly with Julia to start simplifying your projects applications. The book assumes that you already have some basic working knowledge of high-level dynamic languages such as MATLAB, R, Python, or Ruby.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "As an example, we use the data-file winequality.csv that contains 1599 sample measurements, 12 data columns."

A block of code is set as follows:

using DataFrames
fname = "winequality.csv"
data = readtable(fname, separator = ';')

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

using DataFrames
fname = "winequality.csv"
data = readtable(fname, separator = ';')

Any command-line input or output is written as follows:

julia main.jl

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Navigate to Configuration | System Administration | ODBC Data Sources."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.