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
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
Note on Optional and keyword Arguments
Call overloading and function-like objects
Empty generic functions
Constructors
Outer Constructor Methods
Inner Constructor Methods
Incomplete Initialization
Parametric Constructors
Case Study: Rational
Constructors, Call, 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 Notes
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
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
RemoteRefs and AbstractChannels
Shared Arrays
Distributed Garbage Collection
ClusterManagers
Cluster Managers with custom transports
Specifying network topology (Experimental)
Date and DateTime
Constructors
Durations/Comparisons
Accessor Functions
Query Functions
TimeType-Period Arithmetic
Adjuster Functions
Period Types
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
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
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
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
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 Matrices
Tasks and Parallel Computing
Tasks
General Parallel Computing Support
Shared Arrays
Cluster Manager Interface
Linear Algebra
Standard Functions
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 and Functional Testing
Testing Base Julia
Test Framework
Handlers
Macros
Functions
C Interface
LLVM Interface
C Standard Library
Dynamic Linker
Profiling
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
Base.Cartesian
Talking to the compiler (the
:meta
mechanism)
SubArrays
System Image Building
Working with LLVM
printf() and stdio in the Julia runtime
Operator-sensitive promotion
Developing/debugging Julia’s C code
Reporting and analyzing crashes (segfaults)
gdb debugging tips
Using Valgrind with Julia
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