Julia’s Most Awesome Features
Five of my favorite features in the Julia programming language.

Within the bounds of programming languages are programming concepts and paradigms. Many languages take advantage of both their paradigm, as well as interesting generic programming concepts to create features to differentiate themselves from other languages. However, these features are often limited in scope, and sometimes aren’t used frequently enough to even justify being around.
The Julia programming language is an interesting case because unlike most languages, Julia has some killer defining features that make it capable of various different things that you might not expect to go together. Though there is certainly an enormous list of fantastic features that the Julia language utilizes, these are five of those features that I find the most useful and engaging.
№1: Macros

Although macros are certainly not a new concept to programming, their implementation in Julia is rather unique and in my subjective opinion rather well done. Macros are “ shortcuts” that can be used to quickly and effectively access functions, and are incredibly useful when working with functional applications of the Julia language. In Julia, you can define a macro by simply using “ macro.”
macro add(num1,num2)
num1 + num2
endAnd we can use the macro by adding the @ symbol before the name of the macro. The parameters can be added with white-space, no parenthesis or commas necessary!

№2: Dispatch
If you are familiar with the Julia language and have used it even relatively, chances are you are familiar with Julia’s high-performance dispatch. Using a syntactical expression in Julia, we can create different functions that handle different types with the same methods using parametric polymorphism. To do this, we just use the equal operator.
exampledispatch(x::Int64) = _int(x)
exampledispatch(x::Float64) = _float(x)
An amazing side-effect you might not have noticed about Julia’s dispatch is that all Julia functions can be universally used on any type. Consider this example:
I want to make a type that uses the push function to add data to an array that is contained within a struct.
The push!() function is part of Julia’s Base, and in most other languages we would instead need to write an entirely new identifier specific to our module in order to avoid conflicts. This is especially true with using the standard library included with that language. However, in Julia we can just dispatch push!() to handle our type:
push!(data,x::Type{ihavedatainme}) = _pushdata(data,x)№3: Syntactical Expressions
Even some Julia programmers might not realize this, but syntactical expressions are responsible for the entire methodology behind how we write Julia code. In essence, using a syntactical expression we can set any expression or variable equal to any expression or variable. This is how dispatch works, as well, as all we are doing is setting a method with specific parameter types equal to a corresponding method.
Aside from dispatch, however, there are several ways that we can use syntactical expressions. For example, we could set a method equal to an expression:

If you’d like to learn more about syntactical expressions, and learn about some cool ways to do them, I have an article all about them here:
№4: Metaprogramming
Julia handles concepts like metaprogramming in a really interesting way. The packages for metaprogramming, and similar concepts are typically segmented while still being included with Julia’s base. This makes Julia’s base take far less time to pre-compile while still being loaded with awesome features. In order to metaprogram in Julia, the two functions you should start with are Meta.parse() and eval(). Eval is contained within the Julia core, and will not need to be imported, whereas Meta is a module contained within Base.
using Base.MetaThe first step to evaluating a meta expression is to parse it. This will turn a regular string into an expression type that eval() is able to handle.
meta_code = "1 + 1"
expression = Meta.parse(meta_code)

№5: Parallel Computing

Okay, I get it… Parallel computing is not necessarily a “ feature,” per se, but what is impressive about Julia’s parallel computing is just how amazing of a job Julia Computing has done with it. Unlike many other languages, Julia comes with a ridiculous amount of GPU support out of the box. The core Julia language supports graphics arrays and processing that you simply cannot get anywhere else. Having parallel computing tightly integrated into Julia with types and functions specifically designed to handle it is far more powerful than in most languages where this is an afterthought. Additionally, Julia has all kinds of neat packages for parallel computing alongside industry standards like CUDA and OpenCL.
Conclusion
The Julia programming language has a whole host of incredible features that definitely make using the language worth-while. With all of the unique ways to approach problems, there is rarely a time where you can’t be creative to get something done in the language. On top of that, Julia comes with all of the advantages that it normally boasts, as well. These are some of my favorites, but I would be interested in knowing what other programmers love in the language, as well. (Leave a comment if you’d like to share!)






