AnatomyOf

Anatomy of a Julia file

example.jl
1# A minimal Julia script -- may or may not be as fast as C, results vary
2
3struct Greeting
4 text::String
5end
6
7shout(g::Greeting) = uppercase(g.text) * "!!!"
8
9function main()
10 g = Greeting("compiling on the first call is a feature")
11 for i in 1:3
12 println("Take $i: $(shout(g))")
13 end
14end
15
16if abspath(PROGRAM_FILE) == @__FILE__
17 main()
18end
Julia is a high-performance, dynamic programming language specifically designed for scientific computing and technical applications.