Book Image

Learning Julia

By : Anshul Joshi, Rahul Lakhanpal
Book Image

Learning Julia

By: Anshul Joshi, Rahul Lakhanpal

Overview of this book

Julia is a highly appropriate language for scientific computing, but it comes with all the required capabilities of a general-purpose language. It allows us to achieve C/Fortran-like performance while maintaining the concise syntax of a scripting language such as Python. It is perfect for building high-performance and concurrent applications. From the basics of its syntax to learning built-in object types, this book covers it all. This book shows you how to write effective functions, reduce code redundancies, and improve code reuse. It will be helpful for new programmers who are starting out with Julia to explore its wide and ever-growing package ecosystem and also for experienced developers/statisticians/data scientists who want to add Julia to their skill-set. The book presents the fundamentals of programming in Julia and in-depth informative examples, using a step-by-step approach. You will be taken through concepts and examples such as doing simple mathematical operations, creating loops, metaprogramming, functions, collections, multiple dispatch, and so on. By the end of the book, you will be able to apply your skills in Julia to create and explore applications of any domain.
Table of Contents (17 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
8
Data Visualization and Graphics

Interacting with operating systems


One of the best features of Julia is its great REPL, which provides users with a lot of flexibility while calling OS-specific commands. For this book, I have been using a Linux-based operating system, and hence, going forward, all the commands used will be purely Linux-based. For users using Windows, the system commands would be different and native to the underlying OS.

To call any operating system command from inside the Julia REPL, we just have to press a ";" key and the prompt immediately changes:

julia >;   # As soon as you press this ";"

shell >

The change in the prompt is immediate, and on the same line. To start with, Julia provides a command named  pwd(), which is synonymous with the one we used in a Linux operating system to discover a user's current directory:

shell> pwd
/home/myuser

julia> pwd()
"/home/myuser"

Notice closely, for the first command, we have used a ";" and then called the pwd command in shell mode. While for the next...