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

Calling C and Python!


Julia, as we know it from our very first introduction, takes the best from both worlds. It matches Python in terms of ease of code and maintenance, while it targets to achieve the speeds of C.

But what if we really need to make outside calls to code or functions written in these two languages? We then require the ability to import the code directly into Julia, and be able to make use of it. Let's see, one by one, how Julia manages to make external calls to these two programming languages.

Calling C from Julia

C can be called as the mother of modern-day programming languages, and most of the languages today use C somewhere in their source codes to either make their code run quicker or just to add a wrapper over an existing C function or library.

Julia also makes use of C in some of its libraries, although most of the core libs are written in Julia itself. There are some things that make Julia stand apart from the crowd when it comes to calling C. They are as follows:

  • Make...