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
43
votes
3 answers

how to find version number of Julia? Is there a ver() command?

I installed Julia studio 0.4.4, and found it does not support multi-line comments #=...=# so I wanted to find what version of Julia it is running. In Matlab one types the command ver which not only shows the version number of matlab, but also the…
Steve H
  • 879
  • 4
  • 13
  • 18
43
votes
2 answers

Julia (Julia-lang) Performance Compared to Fortran and Python

I adapted a simple program to compute and plot the movement vortices of to Julia to test the language, I also wrote it in Python for no particular reason. (Disclaimer: 1. Every performance comparison on stackoverflow I read gets slammed for not…
SColvin
  • 11,584
  • 6
  • 57
  • 71
42
votes
4 answers

How to make a GUI in Julia?

I'm new at programming in Julia and I need to create a GUI. I've been looking for information and I can't find anything useful. I tried to search information in the Julia official web page, but it seems to be down. I wonder if any of you guys knows…
Daniel Hernandez
  • 439
  • 1
  • 4
  • 3
40
votes
2 answers

How to write "good" Julia code when dealing with multiple types and arrays (multiple dispatch)

OP UPDATE: Note that in the latest version of Julia (v0.5), the idiomatic approach to answering this question is to just define mysquare(x::Number) = x^2. The vectorised case is covered using automatic broadcasting, i.e. x = randn(5) ; mysquare.(x).…
Colin T Bowers
  • 18,106
  • 8
  • 61
  • 89
39
votes
1 answer

What on earth is an inner constructor?

TL;DR: what's the accurate definition of inner constructors? In Julia-v0.6+, is it right to say "any constructor that can be called with the signature typename{...}(...)(note the {} part) is an inner constructor"? As discussed in the comment below,…
Gnimuc
  • 8,098
  • 2
  • 36
  • 50
39
votes
1 answer

What is the difference between @code_native, @code_typed and @code_llvm in Julia?

While going through julia, I wanted to have a functionality similar to python's dis module. Going through over the net, I found out that the Julia community have worked over this issue and given these…
Rahul
  • 2,580
  • 1
  • 20
  • 24
39
votes
3 answers

Does a Python-like virtualenv exist in Julia?

Is there a Python-like virtualenv environment simulator for Julia where one can do development in a local, virtual environment?
Dawny33
  • 10,543
  • 21
  • 82
  • 134
39
votes
6 answers

How does one clear or remove a global in julia?

Is there any syntax that does something similar to MATLAB's "clear" i.e. if I have a global variable "a". How do I get rid of it? How do I do the analog of clear a
Mateo
  • 1,494
  • 1
  • 18
  • 27
38
votes
2 answers

Why is operating on Float64 faster than Float16?

I wonder why operating on Float64 values is faster than operating on Float16: julia> rnd64 = rand(Float64, 1000); julia> rnd16 = rand(Float16, 1000); julia> @benchmark rnd64.^2 BenchmarkTools.Trial: 10000 samples with 10 evaluations. Range (min ……
Shayan
  • 5,165
  • 4
  • 16
  • 45
38
votes
3 answers

Julia: Convert numeric string to float or int

I am trying to write numeric data pulled from a database into a Float64[]. The original data is in ::ASCIIString format, so trying to push it to the array gives the following error: julia> push!(a, "1") ERROR: MethodError: `convert` has no method…
peter-b
  • 4,073
  • 6
  • 31
  • 43
38
votes
4 answers

Julia: How to copy data to another processor in Julia

How do you move data from one processor to another in julia? Say I have an array a = [1:10] Or some other data structure. What is the proper way to put it on all other available processors so that it will be available on those processors as the…
bdeonovic
  • 4,130
  • 7
  • 40
  • 70
38
votes
3 answers

set the random seed in julia generator of random numbers

I would like to do a couple of checkings using the random generator for normal distributed numbers in julia. So what I would like is to obtain the same sequence of pseudo-random numbers. Actually, I do random matrices, so I would like that both of…
user2820579
  • 3,261
  • 7
  • 30
  • 45
38
votes
3 answers

Julia DataFrame: remove column by name

The DataFrame type in Julia allows you to access it as an array, so it is possible to remove columns via indexing: df = df[:,[1:2,4:end]] # remove column 3 The problem with this approach is that I often only know the column's name, not its column…
Mageek
  • 4,691
  • 3
  • 26
  • 42
36
votes
2 answers

I have a high-performant function written in Julia, how can I use it from Python?

I have a found a Julia function that nicely does the job I need. How can I quickly integrate it to be able to call it from Python? Suppose the function is f(x,y) = 2x.+y What is the best and most elegent way to use it from Python?
Przemyslaw Szufel
  • 40,002
  • 3
  • 32
  • 62
36
votes
2 answers

How do I select a random item from a weighted array in Julia?

Consider two 1-dim arrays, one with items to select from and one containing the probabilities of drawing the item of the other list. items = ["a", 2, 5, "h", "hello", 3] weights = [0.1, 0.1, 0.2, 0.2, 0.1, 0.3] In Julia, how can one randomly select…
Remi.b
  • 17,389
  • 28
  • 87
  • 168