2012 - Julia
###Language History
Julia was developed in 2012 by Jeff Bezanson, Stefan Karpinski, and Viral Shah while they were students at the Massachussets Institute of Technology (MIT), as well as Alan Edelman, a professor at MIT. They were motivated by a desire for a programming language that was open source, fast, and dynamic (among many other things) while maintaining ease of use in a variety of applications. The product was Julia, a fresh approach to high performance scientific computing.
###"Hello, World!" Variant
println("Julia was made in 2012!")
Printing to stdout in Julia is quite simple!
###ASCII Art N
function asciin(n)
# Create an nxn matrix of spaces
m = fill(" ", (n, n))
# Fill the first and last columns with "N"
m[:,1] = m[:,n] = "N"
# Fill the diagonal elements with "N"
setindex!(m, "N", diagind(m))
# Print each row of the matrix as a joined string
for i = 1:n
println(join(m[i,:]))
end
end
The code is indented for readability, but Julia imposes no restrictions on whitespace.
###GCD
function g(a, b)
b == 0 ? a : g(b, a % b)
end
The last thing listed in the function is implicitly returned.