Skip to content
Snippets Groups Projects
Commit 906a2557 authored by Jan Siwiec's avatar Jan Siwiec
Browse files

Update julialang.md

parent 76a55e15
No related branches found
No related tags found
4 merge requests!368Update prace.md to document the change from qprace to qprod as the default...,!367Update prace.md to document the change from qprace to qprod as the default...,!366Update prace.md to document the change from qprace to qprod as the default...,!323extended-acls-storage-section
# JuliaLang # JuliaLang
Set of unofficial examples of Julia the high-level, high-performance dynamic programming language for technical computing. A set of unofficial examples of Julia the high-level, high-performance dynamic programming language for technical computing.
Below are a series of examples of common operations in Julia. They assume you already have Julia installed and working Below are examples of common operations in Julia. They assume you already have Julia installed and working
## Hello World ## Hello World
The simplest possible script. The simplest possible script:
```c ```c
println("hello world") println("hello world")
...@@ -14,7 +14,7 @@ println("hello world") ...@@ -14,7 +14,7 @@ println("hello world")
With Julia [installed and added to your path](http://julialang.org/downloads/) With Julia [installed and added to your path](http://julialang.org/downloads/)
this script can be run by `julia hello_world.jl`, it can also be run from REPL by typing this script can be run by `julia hello_world.jl`, it can also be run from REPL by typing
`include("hello_world.jl")`, that will evaluate all valid expressions in that file and return the last output. `include("hello_world.jl")`, which will evaluate all valid expressions in that file and return the last output.
## Simple Functions ## Simple Functions
...@@ -58,7 +58,7 @@ println("result 2: ", quad2) ...@@ -58,7 +58,7 @@ println("result 2: ", quad2)
## Strings Basics ## Strings Basics
Collection of different string examples (string indexing is the same as array indexing: see below). Collection of different string examples (string indexing is the same as array indexing, see below):
```c ```c
# strings are defined with double quotes # strings are defined with double quotes
...@@ -347,7 +347,7 @@ println("Continuing after error") ...@@ -347,7 +347,7 @@ println("Continuing after error")
## Multidimensional Arrays ## Multidimensional Arrays
Julia has very good multidimensional array capabilities. Julia has very good multidimensional array capabilities.
Check out [the manual](http://julia.readthedocs.org/en/latest/manual/arrays/). See [the manual](http://julia.readthedocs.org/en/latest/manual/arrays/).
```c ```c
# repeat can be useful to expand a grid # repeat can be useful to expand a grid
...@@ -449,7 +449,7 @@ end ...@@ -449,7 +449,7 @@ end
## Dictionaries ## Dictionaries
Julia uses [Dicts](http://docs.julialang.org/en/latest/stdlib/base/#associative-collections) as Julia uses [Dicts](http://docs.julialang.org/en/latest/stdlib/base/#associative-collections) as
associative collections. Usage is very like python except for the rather odd `=>` definition syntax. associative collections. Usage is similar to Python except for the `=>` definition syntax.
```c ```c
# <hide> # <hide>
...@@ -618,7 +618,7 @@ println(fam2) ...@@ -618,7 +618,7 @@ println(fam2)
## Input & Output ## Input & Output
The basic syntax for reading and writing files in Julia is quite similar to python. The basic syntax for reading and writing files in Julia is quite similar to Python.
The `simple.dat` file used in this example is available The `simple.dat` file used in this example is available
[from github](https://github.com/samuelcolvin/JuliaByExample/blob/master/src/simple.dat). [from github](https://github.com/samuelcolvin/JuliaByExample/blob/master/src/simple.dat).
...@@ -674,7 +674,7 @@ println(repr(outfile_content)) ...@@ -674,7 +674,7 @@ println(repr(outfile_content))
## Packages and Including of Files ## Packages and Including of Files
[Packages](http://docs.julialang.org/en/latest/packages/packagelist/) [Packages](http://docs.julialang.org/en/latest/packages/packagelist/)
extend the functionality of Julia's standard library. extend the functionality of the Julia's standard library.
```c ```c
# You might not want to run this file completely, as the Pkg-commands can take a # You might not want to run this file completely, as the Pkg-commands can take a
...@@ -711,7 +711,7 @@ Calculus.derivative(x -> cos(x), 1.0) ...@@ -711,7 +711,7 @@ Calculus.derivative(x -> cos(x), 1.0)
[Winston Package Page](https://github.com/nolta/Winston.jl) [Winston Package Page](https://github.com/nolta/Winston.jl)
Matlab-like plotting. Installed via `Pkg.add("Winston")` MATLAB-like plotting. Installed via `Pkg.add("Winston")`
```c ```c
using Winston using Winston
...@@ -731,7 +731,7 @@ savefig("winston.svg") ...@@ -731,7 +731,7 @@ savefig("winston.svg")
## DataFrames ## DataFrames
The [DataFrames.jl package](https://github.com/JuliaStats/DataFrames.jl) provides tool for working with tabular data. The [DataFrames.jl package](https://github.com/JuliaStats/DataFrames.jl) provides a tool for working with tabular data.
The `iris.csv` file used in this example is available The `iris.csv` file used in this example is available
[from github](https://github.com/samuelcolvin/JuliaByExample/blob/master/common_usage/iris.csv). [from github](https://github.com/samuelcolvin/JuliaByExample/blob/master/common_usage/iris.csv).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment