Introduction
Getting Started
Resources
Variables
Allowed Variable Names
Stylistic Conventions
Integers and Floating-Point Numbers
Integers
Floating-Point Numbers
Arbitrary Precision Arithmetic
Numeric Literal Coefficients
Literal zero and one
Mathematical Operations and Elementary Functions
Arithmetic Operators
Bitwise Operators
Updating operators
Numeric Comparisons
Numerical Conversions
Complex and Rational Numbers
Complex Numbers
Rational Numbers
Strings
Characters
String Basics
Unicode and UTF-8
Interpolation
Triple-Quoted String Literals
Common Operations
Non-Standard String Literals
Regular Expressions
Byte Array Literals
Version Number Literals
Functions
Argument Passing Behavior
The
return
Keyword
Operators Are Functions
Operators With Special Names
Anonymous Functions
Multiple Return Values
Varargs Functions
Optional Arguments
Keyword Arguments
Evaluation Scope of Default Values
Do-Block Syntax for Function Arguments
Dot Syntax for Vectorizing Functions
Further Reading
Control Flow
Compound Expressions
Conditional Evaluation
Short-Circuit Evaluation
Repeated Evaluation: Loops
Exception Handling
Tasks (aka Coroutines)
Scope of Variables
Global Scope
Local Scope
Constants
Types
Type Declarations
Abstract Types
Bits Types
Composite Types
Immutable Composite Types
Declared Types
Type Unions
Parametric Types
Type Aliases
Operations on Types
“Value types”
Nullable Types: Representing Missing Values
Methods
Defining Methods
Method Ambiguities
Parametric Methods
Parametrically-constrained Varargs methods
Note on Optional and keyword Arguments
Function-like objects
Empty generic functions
Constructors
Outer Constructor Methods
Inner Constructor Methods
Incomplete Initialization
Parametric Constructors
Case Study: Rational
Constructors and Conversion
Outer-only constructors
Conversion and Promotion
Conversion
Promotion
Interfaces
Iteration
Indexing
Abstract Arrays
Modules
Summary of module usage
Documentation
Accessing Documentation
Functions & Methods
Advanced Usage
Syntax Guide
Markdown syntax
Markdown Syntax Extensions
Metaprogramming
Program representation
Expressions and evaluation
Macros
Code Generation
Non-Standard String Literals
Generated functions
Multi-dimensional Arrays
Arrays
Sparse Matrices
Linear algebra
Matrix factorizations
Special matrices
Networking and Streams
Basic Stream I/O
Text I/O
IO Output Contextual Properties
Working with Files
A simple TCP example
Resolving IP Addresses
Parallel Computing
Code Availability and Loading Packages
Data Movement
Parallel Map and Loops
Synchronization With Remote References
Scheduling
Channels
Remote references and AbstractChannels
Remote References and Distributed Garbage Collection
Shared Arrays
Shared Arrays and Distributed Garbage Collection
ClusterManagers
Cluster Managers with custom transports
Network requirements for LocalManager and SSHManager
Cluster cookie
Specifying network topology (Experimental)
Multi-threading (Experimental)
@threadcall (Experimental)
Date and DateTime
Constructors
Durations/Comparisons
Accessor Functions
Query Functions
TimeType-Period Arithmetic
Adjuster Functions
Period Types
Rounding
Running External Programs
Interpolation
Quoting
Pipelines
Calling C and Fortran Code
Creating C-Compatible Julia Function Pointers
Mapping C Types to Julia
Mapping C Functions to Julia
Some Examples of C Wrappers
Garbage Collection Safety
Non-constant Function Specifications
Indirect Calls
Calling Convention
Accessing Global Variables
Accessing Data through a Pointer
Thread-safety
More About Callbacks
C++
Handling Operating System Variation
Interacting With Julia
The different prompt modes
Key bindings
Tab completion
Customizing Colors
Embedding Julia
High-Level Embedding
Converting Types
Calling Julia Functions
Memory Management
Working with Arrays
Exceptions
Packages
Package Status
Adding and Removing Packages
Offline Installation of Packages
Installing Unregistered Packages
Updating Packages
Checkout, Pin and Free
Custom METADATA Repository
Package Development
Initial Setup
Making changes to an existing package
Creating a new Package
Fixing Package Requirements
Requirements Specification
Profiling
Basic usage
Accumulation and clearing
Options for controlling the display of profile results
Configuration
Memory allocation analysis
Stack Traces
Viewing a stack trace
Extracting useful information
Error handling
Comparison with
backtrace()
Performance Tips
Avoid global variables
Measure performance with
@time
and pay attention to memory allocation
Tools
Avoid containers with abstract type parameters
Type declarations
Break functions into multiple definitions
Write “type-stable” functions
Avoid changing the type of a variable
Separate kernel functions (aka, function barriers)
Types with values-as-parameters
The dangers of abusing multiple dispatch (aka, more on types with values-as-parameters)
Access arrays in memory order, along columns
Pre-allocating outputs
Avoid string interpolation for I/O
Optimize network I/O during parallel execution
Fix deprecation warnings
Tweaks
Performance Annotations
Treat Subnormal Numbers as Zeros
@code_warntype
Workflow Tips
REPL-based workflow
Browser-based workflow
Style Guide
Write functions, not just scripts
Avoid writing overly-specific types
Handle excess argument diversity in the caller
Append
!
to names of functions that modify their arguments
Avoid strange type Unions
Avoid type Unions in fields
Avoid elaborate container types
Use naming conventions consistent with Julia’s
base/
Don’t overuse try-catch
Don’t parenthesize conditions
Don’t overuse ...
Don’t use unnecessary static parameters
Avoid confusion about whether something is an instance or a type
Don’t overuse macros
Don’t expose unsafe operations at the interface level
Don’t overload methods of base container types
Be careful with type equality
Do not write
x->f(x)
Avoid using floats for numeric literals in generic code when possible
Frequently Asked Questions
Sessions and the REPL
Functions
Types, type declarations, and constructors
Packages and Modules
Nothingness and missing values
Memory
Asynchronous IO and concurrent synchronous writes
Julia Releases
Noteworthy Differences from other Languages
Noteworthy differences from MATLAB
Noteworthy differences from R
Noteworthy differences from Python
Noteworthy differences from C/C++
Unicode Input
Essentials
Introduction
Getting Around
All Objects
Types
Generic Functions
Syntax
Nullables
System
Errors
Events
Reflection
Internals
Collections and Data Structures
Iteration
General Collections
Iterable Collections
Indexable Collections
Associative Collections
Set-Like Collections
Dequeues
PriorityQueue
Heap Functions
Mathematics
Mathematical Operators
Mathematical Functions
Statistics
Signal Processing
Numerical Integration
Numbers
Standard Numeric Types
Data Formats
General Number Functions and Constants
BigFloats
Random Numbers
Strings
Arrays
Basic functions
Constructors
Mathematical operators and functions
Indexing, Assignment, and Concatenation
Array functions
Combinatorics
BitArrays
Sparse Vectors and Matrices
Tasks and Parallel Computing
Tasks
General Parallel Computing Support
Shared Arrays
Multi-Threading
ccall using a threadpool (Experimental)
Synchronization Primitives
Cluster Manager Interface
Linear Algebra
Standard Functions
Low-level matrix operations
BLAS Functions
LAPACK Functions
Constants
Filesystem
I/O and Network
General I/O
Text I/O
Multimedia I/O
Memory-mapped I/O
Network I/O
Punctuation
Sorting and Related Functions
Sorting Functions
Order-Related Functions
Sorting Algorithms
Package Manager Functions
Dates and Time
Dates and Time Types
Dates Functions
Unit Testing
Testing Base Julia
Basic Unit Tests
Working with Test Sets
Other Test Macros
Broken Tests
Creating Custom
AbstractTestSet
Types
C Interface
LLVM Interface
C Standard Library
Dynamic Linker
Profiling
StackTraces
SIMD Support
Reflection and introspection
Documentation of Julia’s Internals
Initialization of the Julia runtime
Eval of Julia code
Julia ASTs
More about types
Memory layout of Julia Objects
Julia Functions
Calling Conventions
Base.Cartesian
Talking to the compiler (the
:meta
mechanism)
SubArrays
System Image Building
Working with LLVM
printf() and stdio in the Julia runtime
Bounds checking
Proper maintenance and care of multi-threading locks
Arrays with custom indices
Developing/debugging Julia’s C code
Reporting and analyzing crashes (segfaults)
gdb debugging tips
Using Valgrind with Julia
Sanitizer support
Julia Language
Docs
»
Developing/debugging Julia’s C code
View page source
Developing/debugging Julia’s C code
¶
Reporting and analyzing crashes (segfaults)
gdb debugging tips
Using Valgrind with Julia
Sanitizer support