Why I love Julia

Why I love Julia

Data is everywhere and continues to grow. That means we need more efficient tools to handle the huge volume of data available. This dataset has the potential to change the world for good. But to realize that potential, we need to analyze the data. There are a lot of good tools to do that currently like Python, R and Matlab, and many others. But there is yet another tool that will change everything. Not to sound dramatic and all, I think Julia is an awesome new tool that will forever alter the Data World. Let me tell you why I think so.

My Story

Allow me to tell you why Julia is worth a shot. But before I do so, let me tell you how I found Julia. I had the opportunity to analyze data for a pension company. The dataset had about 51,000 rows and at the time, my laptop was not the kind that could handle that kind of data. I tried first with R and then Pandas for Python and my machine just won’t stop screaming.

The job had to be done and I didn’t know how, so I called on the Oracle(Google) for help. The Oracle never disappoints and I discovered Julia. First, I thought “Julia” is a cool name. I remember having a girlfriend in High school called Julia. So I went deep dive into Julia, just to make sure Julia(the language) is like the Julia(the person) I know and I was blown away. She is everything I expected and more.

I spent some time reading their easy-to-understand documentation for a while. I learned a lot from that doc and realized just how cool Julia is. I was able to analyze my data with R inside Julia(Yes, you can do that too! I will tell you more later). I then created a Dashboard with my cleaned data. I and my laptop were very happy with Julia. And that, my friend, is how our love story begins. Now let me help you fall in love with Julia as well. You can thank me later 😃.

What is Julia?

Julia is not the girlfriend I spoke about, just to be clear. Julia is a fast, high-level, high performance(like C), general-purpose, dynamically typed programming language from MIT. The language is used for scientific computing, data analysis, and software development.

The creators of Julia describe it in the following way;

❝We are greedy: we want more. We want an open-source language, 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 dead simple to learn yet keeps the most serious hackers happy. We want it interactive and we want it compiled.❞ ~ Julia Development Team

and I agree. I think they created something more than they had envisioned and we are grateful for it. To appreciate Julia fully, we need to break it down and examine it fully.

Julia is General Purpose

Yes, bro, Julia can do just about anything all general-purpose languages can do. That means you can do Data Science and visualize data with it. You can build a website and create APIs with it. You can create a dashboard with it and even create a game with It. Did I mention you can write a book with Julia? Yes! you can. How cool is that? There is way more where that came from.

Julia is Dynamically Typed

Julia is a dynamic programming language like Python and yet has strong type support. You can use it for scripting and yet has strong support for the command line. Julia is Open Source

Julia is open source and free to use and modify. You can also contribute to making it a great language for all. Don’t miss that opportunity! Julia is Easy to Use

Even though it’s as fast as C, it is also as easy to write as Python and R. In fact, Julia reminds me of R. It has all the cool features of R like its ability to easily document projects and share findings with stakeholders. This in my opinion is one of the selling points of R and hence Julia.

It is as easy for statistics as R. Let’s see this in action with a simple linear model;

using DataFrames, GLM, Random

Random.seed!(1); # set the seed for reproducibility

# create the data
data = DataFrame(y = rand(100), x = categorical(repeat([1, 2, 3, 4], 25)));

# Now we can create the model like this:

lm(@formula(y ~ x), data) # and baam! you have a linear model

Cool right? I know!

Julia Solves Two Language Problem

Data scientists usually had to use two languages in their work. This is because they use one language, usually Python or R to prototype their ideas and use something like C or Fortran to build a production-ready version of the idea. Fortunately, with Julia, you don’t have to do that. Julia is easy enough for rapid prototyping yet performant enough for production.

Julia is Used By Big Companies

Julia is used by BlackRock, Google, Intel, Microsoft, Moderna, Pfizer, as well as NASA, the Federal Aviation Administration, and the Federal Reserve Bank of New York.

Yes, everybody likes Julia! Why won’t they?

Julia is Performant(Fast)

I guess you already know about this. It is true though, I test it myself on 51,000 rows of data. I know that it’s not enough proof, so check their benchmarks or try it out yourself.

You can Use your Favorite Language in Julia

Yes, you head right! You can use R, Python, C, Java, and Fortran, right in Julia. Julia is as accommodating as a public bench. Everybody can sit on it. So, you don’t have to throw away your favorite language because you met Julia. You can use them all, enjoying all the strengths of different languages. Julia is truly cosmopolitan and multicultural like Google and Microsoft.

Remember, my story, well, I did my analysis with R using the tidyverse in Julia and I love it!

With Julia you can do something like the following:

using RCall

x = randn(10)

R"t.test($x)"

Conclusion

There is a lot more to Julia than I presented in this article. That is why Data scientists, Mathematicians, Physicist, and Software Engineers love Julia. I hope the few points raised will motivate you to at least try Julia out. You can thank me later for it and maybe buy me coffee ☕.

Did you find this article valuable?

Support Boadzie Daniel by becoming a sponsor. Any amount is appreciated!