-
Greatly enhanced performance for passing and returning
Tuple
s (#4042). -
Tuple
s (ofInteger
s,Symbol
s, orBool
s) can now be used as type parameters (#5164). -
Default "inner" constructors now accept any arguments. Constructors that look like
MyType(a, b) = new(a, b)
can and should be removed (#4026). -
Expanded array type hierarchy to include an abstract
DenseArray
for in-memory arrays with standard strided storage (#987, #2345, [#6212]). -
When reloading code, types whose definitions have not changed can be ignored in some cases.
-
Binary
~
now parses as a vararg macro call to@~
. For examplex~y~z
=>@~ x y z
(#4882). -
Structure fields can now be accessed by index (#4806).
-
Unicode identifiers are normalized (NFC) so that different encodings of equivalent strings are treated as the same identifier (#5462).
-
If a module contains a function
__init__()
, it will be called when the module is first loaded, and on process startup if a pre-compiled version of the module is present (#1268). -
Multi-line comments ([#69], [#6128]):
#= .... =#
-
--bounds-check=yes|no
compiler option -
Support for a limited number of infix unicode operators (#552, #6582):
Precedence class Operators (with synonyms, if any) == ≥ (>=) ≤ (<=) ≡ (===) ≠ (!=) ≢ (!==) .≥ (.>=) .≤ (.<=) .!= (.≠) ∈ ( in
) ∉ ((x,y)->!in(x, y)
) ∋ ((x,y)->in(y, x)
) ∌ ((x,y)->!in(y, x)
) ⊆ (issubset
) ⊈ ((x,y)->!issubset(x, y)
) ⊊ ((x,y)->x⊆y && x!=y
) ⊂ ⊄+ ⊕ ⊖ ⊞ ⊟ ∪ ( union
) ∨ ⊔* ÷ ( div
) ⋅ (dot
) ∘ × (cross
) ∩ (intersect
) ∧ ⊓ ⊗ ⊘ ⊙ ⊚ ⊛ ⊠ ⊡unary √
-
isequal
now compares all numbers by value, ignoring type (#6624). -
Implement limited shared-memory parallelism with
SharedArray
s (#5380). -
Well-behaved floating-point ranges (#2333, #5636). Introduced the
FloatRange
type for floating-point ranges with a step, which will give intuitive/correct results for classically problematic ranges like0.1:0.1:0.3
,0.0:0.7:2.1
or1.0:1/49:27.0
. -
New functions
minmax
andextrema
(#5275). -
New macros
@edit
,@less
,@code_typed
,@code_lowered
,@code_llvm
and@code_native
that all function like@which
(#5832). -
consume(p)
extended toconsume(p, args...)
, allowing it to optionally passargs...
back to the producer (#4775). -
.juliarc.jl
is now loaded for both script and REPL execution (#5076). -
The
Sys
module now includes convenient functions for working with dynamic library handles;Sys.dllist
will list out all paths currently loaded viadlopen
, andSys.dlpath
will lookup a path from a handle -
readdlm
treats multiple whitespace characters as a single delimiter by default (when no delimiter is specified). This is useful for reading fixed-width or messy whitespace-delimited data (#5403). -
The Airy, Bessel, Hankel, and related functions (
airy*
,bessel*
,hankel*
) now detect errors returned by the underlying AMOS library, throwing anAmosException
in that case (#4967). -
methodswith
now returns an array ofMethod
s (#5464) rather than just printing its results. -
errno([code])
function to get or set the C library'serrno
. -
GitHub
module for interacting with the GitHub API. -
Package improvements
-
Packages are now installed into
.julia/v0.3
by default (or whatever the current Julia version is), so that different versions of Julia can co-exist with incompatible packages. Existing.julia
installations are unaffected unlessPkg.init()
is run to re-create the package directories (#3344, #5737). -
Pkg.submit(pkg[,commit])
function to automatically submit a GitHub pull request to the package author.
-
-
Collections improvements
-
Array
assignment (e.g.x[:] = y
) ignores singleton dimensions and allows the last dimension of one side to match all trailing dimensions of the other (#4048, #4383). -
Dict(kv)
constructor for any iterator on(key,value)
pairs. -
Multi-key
Dict
s:D[x,y...]
is now a synonym forD[(x,y...)]
for associationsD
(#4870). -
push!
andunshift!
can push multiple arguments (#4782). -
writedlm
andwritecsv
now accept any iterable collection of iterable rows, in addition toAbstractArray
arguments, and thewritedlm
delimiter can be any printable object (e.g. aString
) instead of just aChar
. -
isempty
now works for any iterable collection (#5827). -
unique
now accepts an optionaldim
argument for finding unique rows or columns of a matrix or regions of a multidimensional array (#5811).
-
-
Number
improvements-
The
ImaginaryUnit
type no longer exists. Instead,im
is of typeComplex{Bool}
. Making this work required changing the semantics of boolean multiplication to approximately,true * x = x
andfalse * x = zero(x)
, which can itself be considered useful (#5468). -
big
is now vectorized (#4766) -
nextpow
andprevpow
now return thea^n
values instead of the exponentn
(#4819) -
Overflow detection in
parseint
(#4874). -
rand
now supports arbitraryRanges
arguments (#5059).
-
-
String
improvements-
Triple-quoted regex strings,
r"""..."""
(#4934). -
New string type,
UTF16String
(#4930). -
CharString
is renamed toUTF32String
(#4943). -
normalize_string
function to perform Unicode normalization, case-folding, and other transformations (#5576). -
pointer(s, i=1)
forByteString
,UTF16String
,UTF32String
, andSubString
s thereof (#5703). -
bytestring
is automatically called onString
arguments for conversion toPtr{Uint8}
inccall
(#5677).
-
-
LinAlg
(linear algebra) improvements-
Balancing options for eigenvector calculations for general matrices (#5428).
-
Mutating linear algebra functions no longer promote (#5526).
-
condskeel
for Skeel condition numbers (#5726). -
norm(::Matrix)
no longer calculates a vector norm when the first dimension is one (#5545); it always uses the operator (induced) matrix norm. -
New
vecnorm(itr, p=2)
function that computes the norm of any iterable collection of numbers as if it were a vector of the same length. This generalizes and replacesnormfro
(#6057), andnorm
is now type-stable (#6056). -
+
and-
now require the sizes of the arrays to be the same: the operations no longer do broadcasting. NewUniformScaling
matrix type and identityI
constant (#5810). -
None of the concrete matrix factorization types are exported from Base by default anymore.
-
Sparse linear algebra
-
Faster sparse
kron
(#4958). -
sparse(A) \ B
now supports a matrixB
of right-hand sides (#5196). -
eigs(A, sigma)
now uses shift-and-invert for nonzero shiftssigma
and inverse iteration forwhich="SM"
. Ifsigma==nothing
(the new default), computes ordinary (forward) iterations. (#5776) -
sprand
is faster, and whether any entry is nonzero is now determined independently with the specified probability ([#6726]).
-
-
Dense linear algebra for special matrix types
-
Interconversions between the special matrix types
Diagonal
,Bidiagonal
,SymTridiagonal
,Triangular
, andTriangular
, andMatrix
are now allowed for matrices which are representable in both source and destination types. (5e3f074b) -
Allow for addition and subtraction over mixed matrix types, automatically promoting the result to the denser matrix type (a448e080)
-
new algorithms for linear solvers and eigensystems of
Bidiagonal
matrices of generic element types (#5277) -
new algorithms for linear solvers, eigensystems and singular systems of
Diagonal
matrices of generic element types (#5263) -
new algorithms for linear solvers and eigensystems of
Triangular
matrices of generic element types (#5255) -
specialized
inv
anddet
methods forTridiagonal
andSymTridiagonal
based on recurrence relations between principal minors (#5358) -
specialized
transpose
,ctranspose
,istril
,istriu
methods forTriangular
(#5255) andBidiagonal
(#5277) -
new LAPACK wrappers
- condition number estimate
cond(A::Triangular)
(#5255)
- condition number estimate
-
-
Dense linear algebra for generic matrix element types
-
-
New function
deleteat!
deletes a specified index or indices and returns the updated collection -
prevfloat
andnextfloat
now saturate at -Inf and Inf, respectively, and have otherwise been fixed to follow the IEEE-754 standard functionsnextDown
andnextUp
(#5025). -
The
setenv
function for external processes now accepts adir
keyword argument for specifying the directory to start the child process in (#4888). -
Constructors for collections (
Set
,Dict
, etc.) now generally accept a single iterable argument giving the elements of the collection (#4996, #4871) -
Ranges and arrays with the same elements are now unequal. This allows hashing and comparing ranges to be faster. (#5778)
-
New function
widen
for widening numeric types and values, andwidemul
for multiplying to a larger type (#6169) -
Broadcasting now works on arbitrary
AbstractArrays
(#5387) -
Reduction functions that accept a pre-allocated output array, including
sum!
,prod!
,maximum!
,minimum!
,all!
,any!
(#6197, #5387) -
Faster performance on
fill!
andcopy!
for array types not supporting efficient linear indexing (#5671, #5387) -
Changes to range types (#5585)
-
Range
is now the abstract range type, instead ofRanges
-
New function
range
for constructing ranges by length -
Range
is nowStepRange
, andRange1
is nowUnitRange
. Their constructors accept end points instead of lengths. Both are subtypes of a new abstract typeOrdinalRange
. -
Ranges now support
BigInt
and general ordinal types. -
Very large ranges (e.g.
0:typemax(Int)
) can now be constructed, but some operations (e.g.length
) will raise anOverflowError
.
-
-
Extended API for
cov
andcor
, which accept keyword argumentsvardim
,corrected
, andmean
(#6273) -
New functions
randsubseq
andrandsubseq!
to create a random subsequence of an array ([#6726])
-
convert(Ptr{T1}, x::Array{T2})
is now deprecated unlessT1 == T2
orT1 == None
(#6073). (You can still explicitlyconvert
one pointer type into another if needed.) -
Sys.shlib_ext
has been renamed toSys.dlext
-
dense
is deprecated in favor offull
(#4759) -
The
Stat
type is renamedStatStruct
(#4670) -
set_rounding
,get_rounding
andwith_rounding
now take an additional argument specifying the floating point type to which they apply. The old behaviour and[get/set/with]_bigfloat_rounding
functions are deprecated (#5007) -
cholpfact
andqrpfact
are deprecated in favor of keyword arguments incholfact(...,pivot=true)
andqrfact(...,pivot=true)
(#5330) -
symmetrize!
is deprecated in favor ofBase.LinAlg.copytri!
(#5427) -
myindexes
has been renamed tolocalindexes
(#5475) -
factorize!
is deprecated in favor offactorize
. (#5526) -
nnz
is removed. Usecountnz
ornfilled
instead (#5538) -
setfield
is renamedsetfield!
(#5748) -
put
andtake
are renamedput!
andtake!
(#5511) -
put!
now returns its first argument, the remote reference (#5819) -
read
methods that modify a passed array are now calledread!
(#5970) -
infs
andnans
are deprecated in favor of the more generalfill
. -
*
anddiv
are no longer supported forChar
. -
Range
is renamedStepRange
andRange1
is renamedUnitRange
.Ranges
is renamedRange
. -
bitmix
is replaced by a 2-argument form ofhash
.
The 0.2 release brings improvements to many areas of Julia. Among the most visible changes are support for 64-bit Windows, keyword arguments to functions, immutable types, a redesigned and polished package manager, a multimedia interface supporting usage of Julia in IPython, a built-in profiler, and major improvements to Julia's linear algebra, I/O, and parallel capabilities. These are accompanied by many other changes adding new features, enhancing the library's consistency, improving performance, increasing test coverage, easing installation, and expanding the documentation. While not part of Julia proper, the package ecosystem has also grown and matured considerably since the 0.1 release. See below for more information about the long list of changes that improve Julia's usability and performance.
-
Immutable types (#13).
-
Triple-quoted string literals (#70).
-
New infix operator
in
(e.g.x in S
), and corresponding functionin(x,S)
, replacingcontains(S,x)
function (#2703). -
New variable bindings on each for loop and comprehension iteration (#1571). For example, before this change:
julia> map(f->f(), { ()->i for i=1:3 }) 3-element Any Array: 3 3 3
and after:
julia> map(f->f(), { ()->i for i=1:3 }) 3-element Any Array: 1 2 3
-
Explicit relative importing (#2375).
-
Methods can be added to functions in other modules using dot syntax, as in
Foo.bar(x) = 0
. -
import module: name1, name2, ...
(#5214). -
A semicolon is now allowed after an
import
orusing
statement (#4130). -
In an interactive session (REPL), you can use
;cmd
to runcmd
via an interactive shell. For example:julia> ;ls CONTRIBUTING.md Makefile VERSION deps/ julia@ ui/ DISTRIBUTING.md NEWS.md Windows.inc doc/ src/ usr/ LICENSE.md README.md base/ etc/ test/ Make.inc README.windows.md contrib/ examples/ tmp/
-
Sampling profiler (#2597).
-
Functions for examining stages of the compiler's output:
code_lowered
,code_typed
,code_llvm
, andcode_native
. -
Multimedia I/O API (display, writemime, etcetera) (#3932).
-
MPFR-based
BigFloat
(#2814), and many newBigFloat
operations. -
New half-precision IEEE floating-point type,
Float16
(#3467). -
Support for setting floating-point rounding modes (#3149).
-
methodswith
shows all methods with an argument of specific type. -
mapslices
provides a general way to perform operations on slices of arrays (#2204). -
repeat
function for constructing Arrays with repeated elements (#3605). -
Collections.PriorityQueue
type andCollections.heap
functions (#2920). -
quadgk
1d-integration routine (#3140). -
erfinv
anderfcinv
functions (#2987). -
varm
,stdm
(#2265). -
digamma
,invdigamma
,trigamma
andpolygamma
for calculating derivatives ofgamma
function (#3233). -
logdet
(#3070). -
Names for C-compatible types:
Cchar
,Clong
, etc. (#2370). -
cglobal
to access global variables (#1815). -
unsafe_pointer_to_objref
(#2468) andpointer_from_objref
(#2515). -
readandwrite
for external processes. -
I/O functions
readbytes
andreadbytes!
(#3878). -
flush_cstdio
function (#3949). -
ClusterManager makes it possible to support different types of compute clusters (#3649, #4014).
-
rmprocs
for removing processors from a parallel computing session. The system can also tolerate to some extent processors that die unexpectedly (#3050). -
interrupt
for interrupting worker processes (#3819). -
timedwait
does a polled wait for an event till a specified timeout. -
Condition
type withwait
andnotify
functions forTask
synchronization. -
versioninfo
provides detailed version information, especially useful when reporting and diagnosing bugs. -
detach
for running child processes in a separate process group. -
setenv
for passing environment variables to child processes. -
ifelse
eagerly-evaluated conditional function, especially useful for vectorized conditionals.
-
isequal
now returnsfalse
for numbers of different types. This makes it much easier to define hashing for new numeric types. Uses ofDict
with numeric keys might need to change to account for this increased strictness. -
A redesigned and rewritten
Pkg
system is much more robust in case of problems. The basic interface to adding and removing package requirements remains the same, but great deal of additional functionality for developing packages in-place was added. See the new packages chapter in the manual for further details. -
Sorting API updates (#3665) – see sorting functions.
-
The
delete!(d::Dict, key)
function has been split into separatepop!
anddelete!
functions (#3439).pop!(d,key)
removeskey
fromd
and returns the value that was associated with it; it throws an exception ifd
does not containkey
.delete!(d,key)
removeskey
fromd
and succeeds regardless of whetherd
containedkey
or not, returningd
itself in either case. -
Linear-algebra factorization routines (
lu
,chol
, etc.) now returnFactorization
objects (andlud
,chold
, etc. are deprecated; #2212). -
A number of improvements to sparse matrix capabilities and sparse linear algebra.
-
More linear algebra fixes and eigensolver hooks for
SymTridiagonal
,Tridiagonal
andBidiagonal
matrix types (#2606, #2608, #2609, #2611, #2678, #2713, #2720, #2725). -
Change
integer_valued
,real_valued
, and so on toisinteger
,isreal
, and so on, and semantics of the later are now value-based rather than type-based, unlike MATLAB/Octave (#3071).isbool
andiscomplex
are eliminated in favor of a generaliseltype
function. -
Transitive comparison of floats with rationals (#3102).
-
Fast prime generation with
primes
and fast primality testing withisprime
. -
sum
andcumsum
now use pairwise summation for better accuracy (#4039). -
Dot operators (
.+
,.*
etc.) now broadcast singleton dimensions of array arguments. This behavior can be applied to any function usingbroadcast(f, ...)
. -
combinations
,permutations
, andpartitions
now return iterators instead of a task, andinteger_partitions
has been renamed topartitions
(#3989, #4055). -
isreadable
/iswritable
methods added for more IO types (#3872). -
Much faster and improved
readdlm
andwritedlm
(#3350, #3468, #3483). -
Faster
matchall
(#3719), and various string and regex improvements. -
Documentation of advanced linear algebra features (#2807).
-
Support optional RTLD flags in
dlopen
(#2380). -
pmap
now works with any iterable collection. -
Options in
pmap
for retrying or ignoring failed tasks. -
New
sinpi(x)
andcospi(x)
functions to compute sine and cosine ofpi*x
more accurately (#4112). -
New implementations of elementary complex functions
sqrt
,log
,asin
,acos
,atan
,tanh
,asinh
,acosh
,atanh
with correct branch cuts (#2891). -
Improved behavior of
SubArray
(#4412, #4284, #4044, #3697, #3790, #3148, #2844, #2644 and various other fixes). -
New convenience functions in graphics API.
-
Improved backtraces on Windows and OS X.
-
Methods of
min
andmax
that do reductions were renamed tominimum
andmaximum
.min(x)
is nowminimum(x)
, andmin(x,(),dim)
is nowminimum(x,dim)
. (#4235) -
ComplexPair
was renamed toComplex
and madeimmutable
, andComplex128
and so on are now aliases to the newComplex
type. -
!
was added to the name of many mutating functions, e.g.,push
was renamedpush!
(#907). -
ref
renamed togetindex
, andassign
tosetindex!
(#1484). -
writeable
renamed towritable
(#3874). -
logb
andilogb
renamed toexponent
(#2516). -
quote_string
became a method ofrepr
. -
safe_char
,check_ascii
, andcheck_utf8
replaced byis_valid_char
,is_valid_ascii
, andis_valid_utf8
, respectively. -
each_line
,each_match
,begins_with
,ends_with
,parse_float
,parse_int
, andseek_end
replaced by:eachline
,eachmatch
, and so on (_
was removed) (#1539). -
parse_bin(s)
replaced byparseint(s,2)
;parse_oct(s)
replaced byparseint(s,8)
;parse_hex(s)
replaced byparseint(s,16)
. -
findn_nzs
replaced byfindnz
(#1539). -
DivideByZeroError
replaced byDivideError
. -
addprocs_ssh
,addprocs_ssh_tunnel
, andaddprocs_local
replaced byaddprocs
(with keyword options). -
remote_call
,remote_call_fetch
, andremote_call_wait
replaced byremotecall
,remotecall_fetch
, andremotecall_wait
. -
has
replaced byin
for sets and byhaskey
for dictionaries. -
diagmm
anddiagmm!
replaced byscale
andscale!
(#2916). -
unsafe_ref
andunsafe_assign
replaced byunsafe_load
andunsafe_store!
. -
add_each!
anddel_each!
replaced byunion!
andsetdiff!
. -
isdenormal
renamed toissubnormal
(#3105). -
expr
replaced by direct call toExpr
constructor. -
|
,&
,$
,-
, and~
for sets replaced byunion
,intersect
,symdiff
,setdiff
, andcomplement
(#3272). -
square
function removed. -
pascal
function removed. -
add
andadd!
forSet
replaced bypush!
. -
ls
function deprecated in favor ofreaddir
or;ls
in the REPL. -
start_timer
now expects arguments in units of seconds, not milliseconds. -
Shell redirection operators
|
,>
, and<
eliminated in favor of a new operator|>
(#3523). -
amap
is deprecated in favor of newmapslices
functionality. -
The
Reverse
iterator was removed since it did not work in many cases. -
The
gcd
function now returns a non-negative value regardless of the argument signs, and various other sign problems withinvmod
,lcm
,gcdx
, andpowermod
were fixed (#4811).
-
julia-release-*
executables renamed tojulia-*
, andlibjulia-release
renamed tolibjulia
(#4177). -
Packages will now be installed in
.julia/vX.Y
, where X.Y is the current Julia version.
Too numerous to mention.