Questions tagged [julia]

The Julia programming language is fast, expressive and dynamic. By aggressively targeting technical computing it has become a robust general purpose language. It addresses the two-language problem by combining the ease of use of high-level languages such as R and Python with the performance of C and Fortran.

Julia is a high-level, high-performance dynamic programming language for technical computing. It addresses the two-language problem by combining the ease of use of languages such as R and Python with the performance of C and Fortran. Julia provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library. Environments such as Julia for VS Code, Jupyter, and Pluto provide a rich development environment with interactive graphics.

Community-contributed libraries continue to be added at a rapid pace. Programs written in Julia are organized around multiple dispatch - by defining and overloading functions with different combinations of argument types. Part of what makes Julia so expressive is that argument types can be user-defined, and user-defined types live in the same type hierarchy and have the same status as built-in types.

The Julia compiler includes a parser written in Scheme (femtolisp), some compiler passes and the runtime in C, code generation through LLVM using C++, and other compiler passes (type inference, inlining, etc.) as well as much of the Base library in Julia itself. For just-in-time generation of 64-bit or 32-bit optimized machine code the LLVM compiler framework is used.

Julia has foreign function interfaces for C, C++, Python, R, and Java, to name a few. Julia can also be embedded in any other software through its C API. Many of these interfaces are high performance and avoid copying data to the extent possible.

Resources for Julia:

Books

Publications

12250 questions
199
votes
2 answers

What is a "symbol" in Julia?

Specifically: I am trying to use Julia's DataFrames package, specifically the readtable() function with the names option, but that requires a vector of symbols. what is a symbol? why would they choose that over a vector of strings? So far I have…
Mageek
  • 4,691
  • 3
  • 26
  • 42
164
votes
8 answers

Linking R and Julia?

Julia looks very promising for fast and syntax-sane computation (e.g. here), but I suspect it will not be anywhere near R in terms of overall statistics workflow for some time yet. So I'd like to use it where C++ is mainly used in R programs: to…
Ari B. Friedman
  • 71,271
  • 35
  • 175
  • 235
105
votes
3 answers

Is Julia dynamically typed?

A lot of blogs, and the manual itself, say that Julia is dynamically typed. But from my reading of the manual, it sounds to me more like it is statically typed with type inference, like F#. Is Julia statically typed with type inference? Is it…
Frames Catherine White
  • 27,368
  • 21
  • 87
  • 137
101
votes
2 answers

How to make user defined function descriptions ("docstrings") available to julia REPL?

How can user defined functions (say f) have meaningful printouts when inspected via the REPL using ?for help(f) For example imagine I write the following funciton function f(x::Float64, y::Float64) return 2x - y^2 end If I load this into a…
spencerlyon2
  • 9,476
  • 4
  • 30
  • 39
95
votes
7 answers

Running Julia .jl files

I'm new to julia and just finished my first program. I wrote the code in julia-studio and have been testing it within that program. It gives me all of the correct output, but the shell separates the output as if it is two different executions. I'm…
user1748681
  • 1,127
  • 1
  • 8
  • 9
90
votes
1 answer

How can I dispatch on traits relating two types, where the second type that co-satisfies the trait is uniquely determined by the first?

Say I have a Julia trait that relates to two types: one type is a sort of "base" type that may satisfy a sort of partial trait, and the other is an associated type that is uniquely determined by the base type. (That is, the relation from BaseType ->…
Philip
  • 7,253
  • 3
  • 23
  • 31
84
votes
3 answers

What is the difference between `using` and `import` in Julia when building a module?

Question: What is the difference between using and import in Julia when I'm building my own module? My guess based on reading the docs: using is used to bring another module into the name-space of the current module. import is used to bring specific…
Colin T Bowers
  • 18,106
  • 8
  • 61
  • 89
82
votes
2 answers

Speeding up Julia's poorly written R examples

The Julia examples to compare performance against R seem particularly convoluted. https://github.com/JuliaLang/julia/blob/master/test/perf/perf.R What is the fastest performance you can eke out of the two algorithms below (preferably with an…
Ari B. Friedman
  • 71,271
  • 35
  • 175
  • 235
73
votes
5 answers

Get a list of current variables in Julia Lang

I am new to Julia Lang. I am coming from the background of Matlab. In Matlab, when pressing whos command I will get all variables in the current scope; and also, I can store them in another variable like x=whos; Is there such commands exists in…
vinu k n
  • 861
  • 1
  • 6
  • 14
73
votes
2 answers

In Julia, why is @printf a macro instead of a function?

In Julia, the syntax to print a formatted string is as follows: @printf("Hello %d\n", 5) Why is @printf a macro instead of a function? Is it so that it can accept a varying number of arguments?
Ben Hamner
  • 4,575
  • 4
  • 30
  • 50
69
votes
6 answers

How do I reload a module in an active Julia session after an edit?

2018 Update: Be sure to check all the responses, as the answer to this question has changed multiple times over the years. At the time of this update, the Revise.jl answer is probably the best solution. I have a file…
Colin T Bowers
  • 18,106
  • 8
  • 61
  • 89
69
votes
2 answers

Julia compiles the script every time?

Julia language compiles the script every time, can't we compile binaries with julia instead? I tried a small helloworld script with println function it took 2 to 3 seconds for julia to show the output! It would be better if we can make binaries…
pahnin
  • 5,367
  • 12
  • 40
  • 57
68
votes
7 answers

How to upgrade Julia to a new release?

I'm using v"0.3.8" on Windows. I found from http://julialang.org/downloads/ Current Release (v0.3.9) I know I could download the prebuild version and install again. Is there a way to upgrade (from current installed version) to the new…
Nick
  • 8,451
  • 13
  • 57
  • 106
66
votes
8 answers

Julia: OOP or not

I'm working on Juno with Julia. I don't know if Julia supports OOP or not. For example, is there something like class or struct of c++? How to declare it with members such as a data or a function?
Yves
  • 11,597
  • 17
  • 83
  • 180
61
votes
7 answers

How to import custom module in julia

I have a module I wrote here: # Hello.jl module Hello function foo return 1 end end and # Main.jl using Hello foo() When I run the Main module: $ julia ./Main.jl I get this error: ERROR: LoadError: ArgumentError: Hello not found…
dopatraman
  • 13,416
  • 29
  • 90
  • 154
1
2 3
99 100