-
Function call overloading: for arbitrary objects
x(not of typeFunction),x(...)is transformed intocall(x, ...), andBase.callcan be overloaded as desired. Constructors are now a special case of this mechanism, which allows e.g. constructors for abstract types.T(...)falls back toconvert(T, x), so allconvertmethods implicitly define a constructor (#8712, #2403). -
Unicode version 7 is now supported for identifiers etcetera (#7917).
-
Type parameters now permit any arbitrary
isbitstype, not justIntandBool(#6081). -
Keyword argument names can be computed, using syntax such as
f(; symbol => val)(#7704). -
(TODO pending final syntax) staged functions (#7311).
-
(Also with syntax todo) Documentation system for functions, methods, types and macros in packages and user code (#8791). Type
?@docat the repl to see the current syntax and more information.
-
Significant improvements to
ccallandcfunction-
As a safer alternative to creating pointers (
Ptr), the managed reference typeRefhas been added. ARefpoints to the data contained by a value in an abstract sense, and in a way that is GC-safe. For example,Ref(2)points to a storage location that contains the integer2, andRef(array,3)points to the third element of an array. ARefcan be automatically converted to a native pointer when passed to accall. -
When passing a by-reference argument to
ccall, you can now writeRef(x)instead of&x. Alternatively, you can declare the argument type to beRef{T}instead ofT, and just passx. -
ccallis now lowered to callunsafe_convert(T, cconvert(T, x))on each argument.cconvertfalls back toconvert, but can be used to convert an argument to an arbitrarily-different representation more suitable for passing to C.unsafe_convertthen handles conversions toPtr. -
ccallandcfunctionnow support correctly passing and returning structs, following the platform ABI. It is essential to declare argument and return types accurately. For example, a Cintmust be passed as a 32-bit integer type (e.g.Int32, or another 32-bitbitstype). AFloat32or animmutablestruct with a size of 32 bits is not equivalent. -
cfunctionarguments of struct-like Julia types are now passed by value. IfRef{T}is used as acfunctionargument type, it will look up the method applicable toT, but pass the argument by reference (as Julia functions usually do). However, this should only be used for objects allocated by Julia, and forisbitstypes.
-
-
convert(Ptr,x)is deprecated for most types, replaced byunsafe_convert. You can stillconvertbetween pointer types, and between pointers andIntorUInt. -
[x,y]constructs a vector ofxandyinstead of concatenating them (#3737, #2488, #8599). -
error(::Exception)anderror(::Type{Exception})have been deprecated in favor of using an explicitthrow(#9690). -
Uintet al. are now spelledUInt(#8905). -
Stringhas been renamed toAbstractString(#8872). -
Noneis deprecated; useUnion()instead (#8423). -
Nothing(the type ofnothing) is renamed toVoid(#8423). -
Arrays can be constructed with the syntax
Array{T}(m,n)(#3214, #10075) -
Dictliteral syntax[a=>b,c=>d]is replaced withDict(a=>b,c=>d).{a=>b}is replaced withDict{Any,Any}(a=>b).(K=>V)[...]is replaced withDict{K,V}(...). The new syntax has many advantages: all of its components are first-class, it generalizes to other types of containers, it is easier to guess how to specify key and value types, and the syntaxes for empty and pre-populated dicts are synchronized. As part of this change,=>is parsed as a normal operator, andBasedefines it to constructPairobjects (#6739). -
Charis no longer a subtype ofInteger. (#8816) Char now supports a more limited set of operations withIntegertypes:- comparison / equality
Char+Int=CharChar-Char=Int
-
roundrounds to the nearest integer using the default rounding mode, which is ties to even by default (#8750). -
A custom triple-quoted string like
x"""..."""no longer invokes anx_mstrmacro. Instead, the string is first unindented and thenx_stris invoked, as if the string had been single-quoted (#10228).
-
Functions may be annotated with metadata (
:metaexpressions) to be used by the compiler (#8297). -
@inlinebefore a function definition forces the compiler to inline the function (#8297). -
Loads from heap-allocated immutables are hoisted out of loops in more cases (#8867).
-
Accessing fields that are always initialized no longer produces undefined checks (#8827).
-
--depwarn={yes|no}command line flag added to enable / disable syntax and method deprecation warnings (#9294).
-
New multidimensional iterators and index types for efficient iteration over general AbstractArrays
-
Enums are now supported through the
@enum EnumName EnumValue1 EnumValue2syntax. Enum member values also support abitrary value assignment by the@enum EnumName EnumValue1=1 EnumValue2=10 EnumValue3=20syntax. -
LinAlgimprovements-
The
LinAlgmodule is now exported. -
sparse(A)now takes anyAbstractMatrixA as an argument. (#10031) -
Factorization api is now type-stable, functions dispatch on
Val{false}orVal{true}instead of a boolean value (#9575). -
Added generic Cholesky factorization, and the Cholesky factorization is now parametrized on the matrix type (#7236).
-
Add
svdsfor sparse truncated SVD. (#9425) -
Symmetric and Hermitian immutables are now parametrized on matrix type (#7992).
-
New
ordschurandordschur!functions for sorting a schur factorization by the eigenvalues. (#8467,#9701) -
Givens type doesn't have a size anymore and is no longer a subtype of AbstractMatrix (#8660)
-
Large speedup in sparse
\and splitting of Cholesky and LDLt factorizations intocholfactandldltfact(#10117) -
Add sparse least squares to
\by addingqrfactfor sparse matrices based on the SPQR library. (#10180)
-
-
Other improvements
-
gc_enable,gc_disablereturns previous GC state. -
assert,@assertnow throws anAssertionErrorexception type (#9734). -
convertnow checks for overflow when truncating integers or converting between signed and unsigned (#5413). -
Arithmetic is type-preserving for more types; e.g.
(x::Int8) + (y::Int8)now yields anInt8(#3759). -
Reductions (e.g.
reduce,sum) widen small types (integers smaller thanInt, andFloat16). -
New
Datesmodule for calendar dates and other time-interval calculations (#7654). -
New implementation of SubArrays with substantial performance and functionality improvements (#8501).
-
OpenBLAS 64-bit (ILP64) interface is now compiled with a
64_suffix (#8734) to avoid conflicts with external libraries using a 32-bit BLAS (#4923). -
New
sortperm!function for pre-allocated index arrays (#8792). -
Switch from
O(N)toO(logN)algorithm fordequeue!(pq, key)withPriorityQueue. This provides major speedups for large queues (#8011). -
PriorityQueuenow includes the order type among its parameters,PriorityQueue{KeyType,ValueType,OrderType}. An empty queue can be constructed aspq = PriorityQueue(KeyType,ValueType), if you intend to use the defaultForwardorder, orpq = PriorityQueue(KeyType, ValueType, OrderType)otherwise (#8011). -
Efficient
meanandmedianfor ranges (#8089). -
graphemes(s)returns an iterator over grapheme substrings ofs(#9261). -
Character predicates such as
islower(),isspace(), etc. use utf8proc/libmojibake to provide uniform cross-platform behavior and up-to-date, locale-independent support for Unicode standards (#5939). -
reverseindfunction to convert indices in reversed strings (e.g. from reversed regex searches) to indices in the original string (#9249). -
New
Nullabletype for missing data (#8152). -
deepcopyrecurses through immutable types and makes copies of their mutable fields (#8560). -
@simdnow rejects invalid control flow (@goto/ break / continue) in the inner loop body at compile time (#8624). -
The
machinefilenow supports a host count (#7616). -
Added optional rounding argument to floating-point constructors (#8845).
-
code_nativenow outputs branch labels (#8897). -
Streamlined random number generation APIs #8246. The default
randno longer uses global state in the underlying C library, dSFMT, making it closer to being thread-safe (#8399, #8832). All APIs can now take anAbstractRNGargument (#8854, #9065). The APIs accepting a range argument are extended to accept an arbitraryAbstractArray(#9049). Passing a range ofBigInttorandorrand!is now supported (#9122). There are speed improvements across the board (#8808, #8941, #8958, #9083). -
The
randexpandrandexp!functions are exported (#9144) -
A new
Val{T}type allows one to dispatch on bits-type values (#9452) -
Added
recvfromto get source address of UDP packets (#9418) -
copy(DArray) will now make a copy of the DArray (#9745)
-
Split
Triangulartype intoUpperTriangular,LowerTriangular,UnitUpperTriagularandUnitLowerTriangular(#9779) -
ClusterManager - Performance improvements(#9309) and support for changing transports(#9434)
-
Equality (
==) and inequality (</<=) comparisons are now correct across all numeric types (#9133, #9198). -
Rational arithmetic throws errors on overflow (#8672).
-
Added Base.get_process_title / Base.set_process_title. (#9957)
-
readavailablereturns a byte vector instead of a string.
-
-
indexing with Reals that are not subtypes of Integers (Rationals, FloatingPoint, etc.) has been deprecated (#10458).
-
push!(A)has been deprecated, useappend!instead of splatting arguments topush!(#10400). -
namesfor composite datatypes has been deprecated and renamed tofieldnames(#10332). -
DArrayfunctionality has been removed fromBaseand is now a standalone package under the JuliaParallel umbrella organization (#10333). -
The
Graphicsmodule has been removed fromBaseand is now a standalone package (#10150, #9862). -
Woodbury special matrix type has been removed from LinAlg (#10024).
-
medianandmedian!no longer accept achecknankeyword argument (#8605). -
infandnanare now deprecated in favor ofT(Inf)andT(NaN), respectively (#8776). -
oftype(T::Type, x)is deprecated in favor ofconvert(T,x)(orT(x)). -
{...}syntax is deprecated in favor ofAny[...](#8578). -
itrunc,ifloor,iceilandiroundare deprecated in favour oftrunc{T<:Integer}(T,x),floor{T<:Integer}(T,x), etc..truncis now always bound-checked;Base.unsafe_truncprovides the old uncheckeditruncbehaviour (#9133). -
squeezenow requires that passed dimension(s) are anIntor tuple ofInts; callingsqueezewith an arbitrary iterator is deprecated (#9271). Additionally, passed dimensions must be unique and correspond to extant dimensions of the input array. -
randboolis deprecated. Userand(Bool)to produce a random boolean value, andbitrandto produce a random BitArray (#9105, #9569). -
beginswithis renamed tostartswith(#9578). -
nullis renamed tonullspace. -
The operators
|>,.>,>>, and.>>as used for process I/O redirection are replaced with thepipefunction (#5349). -
flipud(A)andfliplr(A)have been deprecated in favor offlipdim(A, 1)andflipdim(A, 2), respectively (#10446). -
Numeric conversion functions whose names are lower-case versions of type names have been removed. To convert a scalar, use the type name, e.g.
Int32(x). To convert an array to a different element type, useArray{T}(x),map(T,x), orround(T,x). To parse a string as an integer or floating-point number, useparse(#1470, #6211). -
Low-level functions from the C library and dynamic linker have been moved to modules
LibcandLibdl, respectively (#10328). -
The functions
parseint,parsefloat,float32_isvalid, andfloat64_isvalidhave been replaced byparseandtryparsewith a type argument (#3631, #5704, #9487, #10543).
-
Greatly enhanced performance for passing and returning
Tuples (#4042). -
Tuples (ofIntegers,Symbols, orBools) can now be used as type parameters (#5164). -
An additional default "inner" constructor accepting any arguments is now generated. Constructors that look like
MyType(a, b) = new(a, b)do not need to be added manually (#4026, #7071). -
Expanded array type hierarchy to include an abstract
DenseArrayfor 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).
-
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). -
--check-bounds=yes|nocompiler option -
Unicode identifiers are normalized (NFC) so that different encodings of equivalent strings are treated as the same identifier (#5462).
-
The set of characters permitted in identifiers has been restricted based on Unicode categories. Generally, punctuation, formatting and control characters, and operator symbols are not allowed in identifiers. Number-like characters cannot begin identifiers (#5936).
-
Define 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 √ ∛ In addition to these, many of the Unicode operator symbols are parsed as infix operators and are available for user-defined methods (#6929).
-
Improved reporting of syntax errors (#6179)
-
breakinside aforloop with multiple ranges now exits the entire loop nest (#5154) -
Local goto statements using the
@gotoand@labelmacros. (#101)
-
New native-Julia REPL implementation, eliminating many problems stemming from the old GNU Readline-based REPL (#6270).
-
Tab-substitution of LaTeX math symbols (e.g.
\alphabyα) (#6911). This also works in IJulia and in Emacs (#6920). -
workspace()function for obtaining a fresh workspace (#1195).
-
isequalnow compares all numbers by value, ignoring type (#6624). -
Implement limited shared-memory parallelism with
SharedArrays (#5380). -
Well-behaved floating-point ranges (#2333, #5636). Introduced the
FloatRangetype 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.1or1.0:1/49:27.0. -
New functions
minmaxandextrema(#5275). -
New macros
@edit,@less,@code_typed,@code_lowered,@code_llvmand@code_nativethat all function like@which(#5832). -
consume(p)extended toconsume(p, args...), allowing it to optionally passargs...back to the producer (#4775). -
.juliarc.jlis now loaded for both script and REPL execution (#5076). -
The
Sysmodule now includes convenient functions for working with dynamic library handles;Sys.dllistwill list out all paths currently loaded viadlopen, andSys.dlpathwill lookup a path from a handle -
readdlmtreats 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 anAmosExceptionin that case (#4967). -
methodswithnow returns an array ofMethods (#5464) rather than just printing its results. -
errno([code])function to get or set the C library'serrno. -
GitHubmodule for interacting with the GitHub API. -
Package improvements
-
Packages are now installed into
.julia/v0.3by default (or whatever the current Julia version is), so that different versions of Julia can co-exist with incompatible packages. Existing.juliainstallations 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
-
Arrayassignment (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
Dicts:D[x,y...]is now a synonym forD[(x,y...)]for associationsD(#4870). -
push!andunshift!can push multiple arguments (#4782). -
writedlmandwritecsvnow accept any iterable collection of iterable rows, in addition toAbstractArrayarguments, and thewritedlmdelimiter can be any printable object (e.g. aString) instead of just aChar. -
isemptynow works for any iterable collection (#5827). -
uniquenow accepts an optionaldimargument for finding unique rows or columns of a matrix or regions of a multidimensional array (#5811).
-
-
Numberimprovements-
The
ImaginaryUnittype no longer exists. Instead,imis of typeComplex{Bool}. Making this work required changing the semantics of boolean multiplication to approximately,true * x = xandfalse * x = zero(x), which can itself be considered useful (#5468). -
bigis now vectorized (#4766) -
nextpowandprevpownow return thea^nvalues instead of the exponentn(#4819) -
Overflow detection in
parseint(#4874). -
randnow supports arbitraryRangesarguments (#5059). -
expm1andlog1pnow support complex arguments (#3141). -
Broadcasting
.//is now included (#7094). -
prevfloatandnextfloatnow saturate at -Inf and Inf, respectively, and have otherwise been fixed to follow the IEEE-754 standard functionsnextDownandnextUp(#5025). -
New function
widenfor widening numeric types and values, andwidemulfor multiplying to a larger type (#6169). -
polygamma,digamma, andtrigammanow accept complex arguments, andzeta(s, z)now provides the Hurwitz zeta (#7125). -
Narrow integer types (< 32 bits) are promoted to
Float64rather than toFloat32byfloat(x)(#7390).
-
-
Stringimprovements-
Triple-quoted regex strings,
r"""..."""(#4934). -
New string type,
UTF16String(#4930), constructed byutf16(s)from another string, aUint16array or pointer, or a byte array (possibly prefixed by a byte-order marker to indicate endian-ness). Its data is internallyNULL-terminated for passing to C (#7016). -
CharStringis renamed toUTF32String(#4943), and its data is now internallyNULL-terminated for passing to C (#7016).CharString(c::Char...)is deprecated in favor ofutf32(c...), andutf32(s)otherwise has functionality similar toutf16(s). -
New
WStringandwstringsynonyms for eitherUTF16Stringandutf16orUTF32Stringandutf32, respectively, depending on the width ofCwchar_t(#7016). -
normalize_stringfunction to perform Unicode normalization, case-folding, and other transformations (#5576). -
pointer(s, i=1)forByteString,UTF16String,UTF32String, andSubStrings thereof (#5703). -
bytestringis automatically called onStringarguments for conversion toPtr{Uint8}inccall(#5677).
-
-
Linear algebra improvements
-
Balancing options for eigenvector calculations for general matrices (#5428).
-
Mutating linear algebra functions no longer promote (#5526).
-
condskeelfor 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), andnormis now type-stable (#6056). -
New
UniformScalingmatrix type and identityIconstant (#5810). -
None of the concrete matrix factorization types are exported from
Baseby default anymore. -
Sparse linear algebra
-
1-d sparse
getindexhas been implemented (#7047) -
Faster sparse
getindex(#7131). -
Faster sparse
kron(#4958). -
sparse(A) \ Bnow supports a matrixBof right-hand sides (#5196). -
eigs(A, sigma)now uses shift-and-invert for nonzero shiftssigmaand inverse iteration forwhich="SM". Ifsigma==nothing(the new default), computes ordinary (forward) iterations. (#5776) -
sprandis 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, andMatrixare 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, #5927)
-
new algorithms for linear solvers and eigensystems of
Bidiagonalmatrices of generic element types (#5277) -
new algorithms for linear solvers, eigensystems and singular systems of
Diagonalmatrices of generic element types (#5263) -
new algorithms for linear solvers and eigensystems of
Triangularmatrices of generic element types (#5255) -
specialized
invanddetmethods forTridiagonalandSymTridiagonalbased on recurrence relations between principal minors (#5358) -
specialized
transpose,ctranspose,istril,istriumethods forTriangular(#5255) andBidiagonal(#5277) -
new LAPACK wrappers
- condition number estimate
cond(A::Triangular)(#5255)
- condition number estimate
-
parametrize
Triangularon matrix type (#7064) -
Lyapunov / Sylvester solver (#7435)
-
eigvalsforSymmetric,TridiagonalandHermitianmatrices now support additional method signatures: (#3688, #6652, #6678, #7647)eigvals(M, el, eu)finds all eigenvalues in the interval(el, eu]eigvals(M, il:iu)finds theilth through theiuth eigenvalues (in ascending order)
-
-
Dense linear algebra for generic matrix element types
-
-
New function
deleteat!deletes a specified index or indices and returns the updated collection -
The
setenvfunction for external processes now accepts adirkeyword 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)
-
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)
-
Rangeis now the abstract range type, instead ofRanges -
New function
rangefor constructing ranges by length -
Rangeis nowStepRange, andRange1is nowUnitRange. Their constructors accept end points instead of lengths. Both are subtypes of a new abstract typeOrdinalRange. -
Ranges now support
BigIntand 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
covandcor, which accept keyword argumentsvardim,corrected, andmean(#6273) -
New functions
randsubseqandrandsubseq!to create a random subsequence of an array (#6726) -
New macro
@evalpolyfor efficient inline evaluation of polynomials (#7146). -
The signal filtering function
filtnow accepts an optional initial filter state vector. A new in-place functionfilt!is also exported. (#7513) -
Significantly faster
cumsumandcumprod. (#7359) -
Implement
findminandfindmaxover specified array dimensions. (#6716) -
Support memory-mapping of files with offsets on Windows. (#7242)
-
Catch writes to protect memory, such as when trying to modify a mmapped file opened in read-only mode. (#3434)
-
New
--code-coverageand--track-allocationstartup features allow one to measure the number of executions or the amount of memory allocated, respectively, at each line of code. (#5423,#7464) -
Profile.initnow accepts keyword arguments, and returns the current settings when no arguments are supplied. (#7365)
- Dependencies are now verified against stored MD5/SHA512 hashes, to ensure that the correct file has been downloaded and was not modified. (#6773)
-
convert(Ptr{T1}, x::Array{T2})is now deprecated unlessT1 == T2orT1 == Void(#6073). (You can still explicitlyconvertone pointer type into another if needed.) -
Sys.shlib_exthas been renamed toSys.dlext -
denseis deprecated in favor offull(#4759) -
The
Stattype is renamedStatStruct(#4670) -
set_rounding,get_roundingandwith_roundingnow take an additional argument specifying the floating point type to which they apply. The old behaviour and[get/set/with]_bigfloat_roundingfunctions are deprecated (#5007) -
cholpfactandqrpfactare deprecated in favor of keyword arguments incholfact(..., pivot=true)andqrfact(..., pivot=true)(#5330) -
symmetrize!is deprecated in favor ofBase.LinAlg.copytri!(#5427) -
myindexeshas been renamed tolocalindexes(#5475) -
factorize!is deprecated in favor offactorize. (#5526) -
nnzcounts the number of structural nonzeros in a sparse matrix. Usecountnzfor the actual number of nonzeros. (#6769) -
setfieldis renamedsetfield!(#5748) -
putandtakeare renamedput!andtake!(#5511) -
put!now returns its first argument, the remote reference (#5819) -
readmethods that modify a passed array are now calledread!(#5970) -
infsandnansare deprecated in favor of the more generalfill. -
*anddivare no longer supported forChar. -
Rangeis renamedStepRangeandRange1is renamedUnitRange.Rangesis renamedRange. -
bitmixis replaced by a 2-argument form ofhash. -
readsfromandwritestoare replaced byopen(#6948). -
insert!now throws aBoundsErrorifindex > length(collection)+1(#7373).
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 3and 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
importorusingstatement (#4130). -
In an interactive session (REPL), you can use
;cmdto runcmdvia 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 newBigFloatoperations. -
New half-precision IEEE floating-point type,
Float16(#3467). -
Support for setting floating-point rounding modes (#3149).
-
methodswithshows all methods with an argument of specific type. -
mapslicesprovides a general way to perform operations on slices of arrays (#2204). -
repeatfunction for constructing Arrays with repeated elements (#3605). -
Collections.PriorityQueuetype andCollections.heapfunctions (#2920). -
quadgk1d-integration routine (#3140). -
erfinvanderfcinvfunctions (#2987). -
varm,stdm(#2265). -
digamma,invdigamma,trigammaandpolygammafor calculating derivatives ofgammafunction (#3233). -
logdet(#3070). -
Names for C-compatible types:
Cchar,Clong, etc. (#2370). -
cglobalto access global variables (#1815). -
unsafe_pointer_to_objref(#2468) andpointer_from_objref(#2515). -
readandwritefor external processes. -
I/O functions
readbytesandreadbytes!(#3878). -
flush_cstdiofunction (#3949). -
ClusterManager makes it possible to support different types of compute clusters (#3649, #4014).
-
rmprocsfor removing processors from a parallel computing session. The system can also tolerate to some extent processors that die unexpectedly (#3050). -
interruptfor interrupting worker processes (#3819). -
timedwaitdoes a polled wait for an event till a specified timeout. -
Conditiontype withwaitandnotifyfunctions forTasksynchronization. -
versioninfoprovides detailed version information, especially useful when reporting and diagnosing bugs. -
detachfor running child processes in a separate process group. -
setenvfor passing environment variables to child processes. -
ifelseeagerly-evaluated conditional function, especially useful for vectorized conditionals.
-
isequalnow returnsfalsefor numbers of different types. This makes it much easier to define hashing for new numeric types. Uses ofDictwith numeric keys might need to change to account for this increased strictness. -
A redesigned and rewritten
Pkgsystem 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)removeskeyfromdand returns the value that was associated with it; it throws an exception ifddoes not containkey.delete!(d,key)removeskeyfromdand succeeds regardless of whetherdcontainedkeyor not, returningditself in either case. -
Linear-algebra factorization routines (
lu,chol, etc.) now returnFactorizationobjects (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,TridiagonalandBidiagonalmatrix 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).isboolandiscomplexare eliminated in favor of a generaliseltypefunction. -
Transitive comparison of floats with rationals (#3102).
-
Fast prime generation with
primesand fast primality testing withisprime. -
sumandcumsumnow 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, andpartitionsnow return iterators instead of a task, andinteger_partitionshas been renamed topartitions(#3989, #4055). -
isreadable/iswritablemethods added for more IO types (#3872). -
Much faster and improved
readdlmandwritedlm(#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). -
pmapnow works with any iterable collection. -
Options in
pmapfor retrying or ignoring failed tasks. -
New
sinpi(x)andcospi(x)functions to compute sine and cosine ofpi*xmore accurately (#4112). -
New implementations of elementary complex functions
sqrt,log,asin,acos,atan,tanh,asinh,acosh,atanhwith 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.
-
Implementation of reduction functions (including
reduce,mapreduce,sum,prod,maximum,minimum,all, andany) are refactored, with improved type stability, efficiency, and consistency. (#6116, #7035, #7061, #7106)
-
Methods of
minandmaxthat do reductions were renamed tominimumandmaximum.min(x)is nowminimum(x), andmin(x,(),dim)is nowminimum(x,dim). (#4235) -
ComplexPairwas renamed toComplexand madeimmutable, andComplex128and so on are now aliases to the newComplextype. -
!was added to the name of many mutating functions, e.g.,pushwas renamedpush!(#907). -
refrenamed togetindex, andassigntosetindex!(#1484). -
writeablerenamed towritable(#3874). -
logbandilogbrenamed toexponent(#2516). -
quote_stringbecame a method ofrepr. -
safe_char,check_ascii, andcheck_utf8replaced byis_valid_char,is_valid_ascii, andis_valid_utf8, respectively. -
each_line,each_match,begins_with,ends_with,parse_float,parse_int, andseek_endreplaced 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_nzsreplaced byfindnz(#1539). -
DivideByZeroErrorreplaced byDivideError. -
addprocs_ssh,addprocs_ssh_tunnel, andaddprocs_localreplaced byaddprocs(with keyword options). -
remote_call,remote_call_fetch, andremote_call_waitreplaced byremotecall,remotecall_fetch, andremotecall_wait. -
hasreplaced byinfor sets and byhaskeyfor dictionaries. -
diagmmanddiagmm!replaced byscaleandscale!(#2916). -
unsafe_refandunsafe_assignreplaced byunsafe_loadandunsafe_store!. -
add_each!anddel_each!replaced byunion!andsetdiff!. -
isdenormalrenamed toissubnormal(#3105). -
exprreplaced by direct call toExprconstructor. -
|,&,$,-, and~for sets replaced byunion,intersect,symdiff,setdiff, andcomplement(#3272). -
squarefunction removed. -
pascalfunction removed. -
addandadd!forSetreplaced bypush!. -
lsfunction deprecated in favor ofreaddiror;lsin the REPL. -
start_timernow expects arguments in units of seconds, not milliseconds. -
Shell redirection operators
|,>, and<eliminated in favor of a new operator|>(#3523). -
amapis deprecated in favor of newmapslicesfunctionality. -
The
Reverseiterator was removed since it did not work in many cases. -
The
gcdfunction now returns a non-negative value regardless of the argument signs, and various other sign problems withinvmod,lcm,gcdx, andpowermodwere fixed (#4811).
-
julia-release-*executables renamed tojulia-*, andlibjulia-releaserenamed tolibjulia(#4177). -
Packages will now be installed in
.julia/vX.Y, where X.Y is the current Julia version.
Too numerous to mention.