getbetterat.work
TOPIC: JULIA

Meet
Julia.

The programming language that thinks like a human but runs as fast as a machine. It is built for big math and big data.

The Old Problem

For a long time, coders had a big problem. We call it the "Two Language Problem". You had to pick between two choices, and both choices had a downside.

Choice A: Easy but Slow

Languages like Python are very easy to read. A 10-year-old can understand the code. But, when you ask it to do a billion math problems, it is very slow. You have to wait a long time.

Choice B: Fast but Hard

Languages like C are crazy fast. They talk directly to the computer. But, the code is very hard to write. It takes months to learn, and it is easy to make bad mistakes.

People used to write tests in Choice A, and then rewrite the real program in Choice B. This wasted a lot of time.

The Julia Solution

The makers of Julia asked a simple question: "Why can't we have both?"

Julia was built from the start to fix the Two Language Problem. When you type in Julia, it feels like you are writing in an easy, friendly language. But when you press "Run," the computer reads it as if it was written in a super-fast, hard language.

  • Write once: You do not need to rewrite your code.
  • Run fast: It finishes big jobs in seconds, not hours.
  • Happy coders: It saves time and brain power.

The Speed Test

Let's look at how fast languages run. Shorter bars are better. If the bar is long, the language is slow.

Python (Easy) Very Slow
100x Time Taken
C Language (Hard) Very Fast
1x Time Taken
Julia (Easy & Fast) Very Fast
1.1x Time Taken

How Does It Work?

Julia uses a trick called JIT. JIT stands for "Just-In-Time". Here is a simple way to picture it:

1

You write simple code.

2

The JIT factory changes your code into machine math, right as you hit "Go".

3

The computer runs it at top speed because it is already machine math.

Built for Big Math

Normal apps let you chat with friends or buy shoes. Julia is built for "Scientific Computing". This means doing giant math problems. Here is what Julia likes to do:

Weather Math

Guessing if it will rain tomorrow requires looking at millions of numbers about the wind, sun, and sea. Julia reads these numbers fast.

Space Math

Sending a rocket to Mars means you can not make a single math mistake. Julia is trusted by space teams to get the math exactly right.

Money Math

Big banks use Julia to look at the stock market. They need to make choices in one second. Julia is fast enough to help them.

Body Math

Doctors use Julia to study our DNA. DNA is like a giant book with billions of letters. Julia reads the book super fast.

Eating Big Data

When you have a spreadsheet with 100 rows, any program can read it. But what if your spreadsheet has 10 billion rows?

Most basic tools will freeze or crash. The computer will run out of memory. It will stop working.

Julia is built for "Data Processing". It knows how to bite off small pieces of data, chew them, and then take another bite. It never chokes. It just keeps working until all 10 billion rows are done.

ROW 1,000,000
ROW 2,000,000
ROW 3,000,000
... NO CRASHING

Doing Many Things at Once

Julia is great at Parallel Computing. Let's explain what that big word means with a simple story.

Normal Way

Imagine one chef trying to cook 100 burgers. The chef works hard, but he can only flip one burger at a time. It takes all day.

C

Parallel Way (Julia)

Now imagine 100 chefs cooking 100 burgers at the exact same time. It is done in five minutes. Julia talks to all the parts of your computer (the chefs) and tells them to work together.

C
C
C
C

Who Uses Julia?

Scientists

They use it to mix chemicals safely on a computer before trying it in a real room.

Airlines

They use it to map out the best paths for airplanes so they do not crash and save gas.

Machine Learning

They use it to teach robots how to see pictures and understand words.

Code_Example.jl

# Look how easy this is to read!

function count_big_numbers()

total = 0

# Julia can count to a billion very fast

for number in 1:1000000000

total = total + number

end

println("The total is: ", total)

end

# Run the job

count_big_numbers()

The App Store for Code

Imagine you want to draw a beautiful graph. You do not want to build a graph-drawing tool from scratch. That takes too many hours.

Julia has a built-in "App Store" called the Package Manager. If you need a tool, you just type a name, and Julia goes to the internet, gets it, and plugs it into your project in seconds.

] add Plots

Just like that, you can now draw graphs. There are thousands of these free tools made by other smart people ready for you to use.

The Smart Toolbox

Julia has a secret weapon called Multiple Dispatch.

Imagine you have a tool called "Smash". If you use "Smash" on a potato, it makes mashed potatoes. If you use "Smash" on a bug, it squishes it. The tool changes how it works depending on what you hit with it.

In Julia, you write one word like "Add". If you give it numbers, it does math. If you give it words, it glues them together. The computer instantly picks the fastest way to do it based on what you are holding. It is very smart.

Tool: Smash()
Smash(Potato) = Food
Smash(Bug) = Mess

It Costs Zero Dollars

Julia is Open Source. That means nobody owns it, and everybody owns it. You do not have to pay a big company to use it. A giant team of people all over the world build it together for free. It is like a big, friendly park where everyone shares their toys.

Code That Writes Code

Sometimes, coding is boring. You have to type the exact same thing over and over again. Julia has a helper robot called a Macro.

Instead of writing out a huge chunk of code, you can just put an `@` symbol in front of a word. This tells the robot to wake up and type the rest of the boring stuff for you before the program even starts.

It saves you from typing, and it stops you from making silly spelling mistakes.

@time do_big_math()
# The robot wakes up, starts a stopwatch, runs your math, and tells you how fast it was!

Math Looks Like Math

In older computer languages, math looks like a broken typewriter. It is hard to read. Julia lets you use actual math symbols. If you see a math formula in a textbook, you can type it exactly the same way in Julia.

Old Way

alpha = 0.5
beta = 0.8
result = sum(alpha * x + beta)

Julia Way

α = 0.5
β = 0.8
result = Σ(α * x + β)

Playing Nice With Others

What if your boss gives you code written in Python or C? Do you have to throw it away and start over? No!

Julia is very friendly. It can call out to Python code, run it, and take the answer back, all without leaving your Julia window. It acts like a master controller that can talk to any other language.

Julia
Python
C++

The Super Boost (GPU)

Inside your computer, there is a normal brain (the CPU) and a brain meant for drawing video games (the GPU). The game brain is crazy fast at doing thousands of tiny math problems at once.

Normally, it is very hard to tell the game brain to do science math instead of drawing video games. Julia makes it as easy as flipping a switch. You just tell Julia to "use the GPU," and suddenly your code runs 100 times faster.

Sorting Everything Into Boxes

Computers run faster when they know exactly what they are looking at. Julia uses something called a Type System. Think of it like sorting toys into the right boxes.

12

Whole Numbers

If Julia knows a box only has whole numbers, it will use a super-fast math trick just for them.

3.14

Decimals

Decimals take up more space. Julia puts them in a special box so they don't get mixed up.

"A"

Words & Letters

Letters cannot be added together like math. Julia keeps them safe in their own word box.

The Test Kitchen

Julia comes with a REPL. This stands for Read-Eval-Print Loop. But you can just call it the Test Kitchen.

Instead of writing a giant book of code and hoping it works, you can type one single line into the kitchen, press Enter, and see the answer instantly. It is the best way to play around, test an idea, or check your math before you put it in the final project.

julia> 2 + 2
4
julia> "Hello " * "World"
"Hello World"

How To Start

Ready to try it? It is very easy to get going. You don't need a fancy supercomputer.

1
Go to julialang.org
2
Click the big Download button
3
Open it and type 2 + 2

To Wrap It Up

Julia is a special tool. It is as easy to use as a basic toy, but packs the punch of a heavy machine. If you need to do heavy math or look at huge piles of data, Julia is your best friend.