Book Image

Julia Programming Projects

By : Adrian Salceanu
Book Image

Julia Programming Projects

By: Adrian Salceanu

Overview of this book

Julia is a new programming language that offers a unique combination of performance and productivity. Its powerful features, friendly syntax, and speed are attracting a growing number of adopters from Python, R, and Matlab, effectively raising the bar for modern general and scientific computing. After six years in the making, Julia has reached version 1.0. Now is the perfect time to learn it, due to its large-scale adoption across a wide range of domains, including fintech, biotech, education, and AI. Beginning with an introduction to the language, Julia Programming Projects goes on to illustrate how to analyze the Iris dataset using DataFrames. You will explore functions and the type system, methods, and multiple dispatch while building a web scraper and a web app. Next, you'll delve into machine learning, where you'll build a books recommender system. You will also see how to apply unsupervised machine learning to perform clustering on the San Francisco business database. After metaprogramming, the final chapters will discuss dates and time, time series analysis, visualization, and forecasting. We'll close with package development, documenting, testing and benchmarking. By the end of the book, you will have gained the practical knowledge to build real-world applications in Julia.
Table of Contents (19 chapters)
Title Page
Copyright and Credits
About Packt

Chapter 1. Getting Started with Julia Programming

Julia is a high-level, high-performancedynamic programming language, focusing on numerical computing and general programming. It is relatively new—the four creators, Jeff Bezanson, Stefan Karpinski, Viral Shah, and Alan Edelman, set out to create it in 2009, with the first public reference to the language in 2012, when they published a blog post explaining their vision and their goals. 2012 is considered the official birth year of Julia, making it only six years old. Since its initial public release, Julia has received code contributions from hundreds of scientists, programmers, and engineers across the world. It is developed in the open, with the source code available on GitHub, and is one of the most popular repositories with almost 20,000 stars (at the time of writing, and counting). Julia v1.0, the much anticipated first stable release, came in August 2018 during the Julia conference in London, as the brilliant outcome of the collaboration between over 700 open source contributors and thousands of package creators and early users. By that time, the language had been downloaded over two million times already!

Julia came out as a fresh alternative to traditional scientific computing languages, which were either productive or fast, but not both. This is known as the two language problem, where the initial prototyping code is written in a dynamic, highly productive language (such as R or Python), which allows exploratory coding and quick iterations, skipping taxing build and compile times. But later on, the developers would be forced to rewrite their programs (or at least the performance critical parts of their programs), using a compiled language that would satisfy the high-performance requirements of scientific computing.

The creators of Julia thought that software development technology has evolved enough that it can support a language that combines both high productivity and high performance. This was their manifesto, underlying their goals for Julia:

"We want a language that's open source, with a liberal license. We want the speed of C with the dynamism of Ruby. We want a language that's homoiconic, with true macros like Lisp, but with obvious, familiar mathematical notation like MATLAB. We want something as usable for general programming as Python, as easy for statistics as R, as natural for string processing as Perl, as powerful for linear algebra as MATLAB, as good at gluing programs together as the shell. Something that is dirt simple to learn, yet keeps the most serious hackers happy. We want it interactive and we want it compiled.""(Did we mention it should be as fast as C?)"

As incredible as it may seem, Julia has managed to satisfy all these demands, making for a unique language that is easy to learn, intuitive, friendly, productive, and fast. Let's take a closer look at all these features.

The topics we will cover in this chapter are:

  • A quick look at Julia—what is it, the main features and strengths, and why it could be the best choice for your next project
  • How to set up and interact with the Julia language on your local machine
  • The best IDEs and editors for productive Julia development
  • Getting starting with Julia by learning about its powerful REPL
  • How to use the built-in package manager, Pkg, to extend the language with third-party libraries