Movatterモバイル変換


[0]ホーム

URL:


Packt
Search iconClose icon
Search icon CANCEL
Subscription
0
Cart icon
Your Cart(0 item)
Close icon
You have no products in your basket yet
Save more on your purchases!discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Profile icon
Account
Close icon

Change country

Modal Close icon
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timerSALE ENDS IN
0Days
:
00Hours
:
00Minutes
:
00Seconds
Home> Programming> Programming Language> Julia 1.0 Programming
Julia 1.0 Programming
Julia 1.0 Programming

Julia 1.0 Programming: Dynamic and high-performance programming to build fast scientific applications , Second Edition

Arrow left icon
Profile Icon Ivo Balbaert
Arrow right icon
€23.99€26.99
Full star iconFull star iconFull star iconHalf star iconEmpty star icon3.5(2 Ratings)
eBookSep 2018196 pages2nd Edition
eBook
€23.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€23.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature iconInstant access to your Digital eBook purchase
Product feature icon Download this book inEPUB andPDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature iconDRM FREE - Read whenever, wherever and however you want
OR

Contact Details

Modal Close icon
Payment Processing...
tickCompleted

Billing Address

Table of content iconView table of contentsPreview book icon Preview Book

Julia 1.0 Programming

Installing Julia

The Julia platform, in binary (that is, executable) form, can be downloaded fromhttp://julialang.org/downloads/. It exists for three major platforms (Windows, Linux, and OS X) in 32- and 64-bit format, and it is delivered as a package or in an archive version. FreeBSD 64-bit is also supported.

You should use the current official stable release when doing serious professional work with Julia. At the time of writing, Julia has reached its version 1.0 production release. The previous link contains detailed and platform-specific instructions for the installation. We will not repeat these instructions here completely, but we will summarize some important points.

Windows OS

Keep in mind that your Windows OS must be version 7 or higher. Now, follow the steps shown here:

  1. Download thejulia-n.m.p-win64.exe file into a temporary folder (n.m.p is the version number, such as0.7.0 or0.1.0;win32/win64 are the 32- and 64-bit versions, respectively; a release candidate file looks likejulia-1.0.0-rc1-nnnnnnn-win64 (where nnnnnnn is a checksum number such as0480f1b)).
  2. Double-click on the file (or right-click and selectRun as Administrator if you want Julia installed for all users on the machine). ClickOK on the security dialog message. Then, choose the installation directory (for example, forC:\julia, the default installation folder is:C:\Users\UserName\AppData\Local\Julia-n.m.p (wheren.m.p is the version number)) and the setup program will extract the archive into the chosen folder, producing the following directory structure, and taking some 800 MB of disk space:
The Julia folder structure in Windows
  1. A menu shortcut will be created which, when clicked, starts the Julia command-line version orRead Evaluate Print Loop (REPL), as shown in the following screenshot:
The Julia REPL
  1. On Windows, if you have chosenC:\Julia as your installation directory, this is theC:\Julia\bin\julia.exe file. AddC:\Julia\bin to yourPATH variable if you want the REPL to be available on any command window.
  2. More information on Julia's installation for the Windows OS can be found athttps://github.com/JuliaLang/julia/blob/master/README.windows.md.

OS X

Installation for OS X is straightforward, and can be done using the standard software installation tools for the platform. Add/Applications/Julia-n.m.app/Contents/Resources/julia/bin/Julia to make Julia available everywhere on your computer.

Linux OS

Generic Linux binaries for x86 can be downloaded. This will get you a compressedtar.gz archive that will have a name similar tojulia-1.0-linux-x86_64.tar.gz, for example, in your~/Downloads directory in Ubuntu. Open up a Terminal window and navigate to theDownloads directory usingcd Downloads. Move thetar.gz file to a directory of your choice, and then extract thetar.gz file using thetar -zxvf julia-1.0-linux-x86_64.tar.gzcommand. A directory with the extracted contents will be generated in the same parent directory as the compressed archive with a name similar tojulia-n.m.p, wheren.m.p is Julia's version number.

This is the directory from which Julia will be run; no further installation is needed. To run it, simply navigate to thejulia-n.m.p\bin directory in your Terminal and type:./julia.

If you want to be at the bleeding edge of development, you can download the nightly builds instead of the stable releases fromhttps://julialang.org/downloads/nightlies.html. The nightly builds are generally less stable, but will contain the most recent features. They are available for Windows, Linux, and OS X.

The path to the Julia executable is contained in the environment variable,JULIA_BINDIR (for example, in our installation procedure, this wasC:\Julia\bin on Windows).

If you want code to be run whenever you start a Julia session, put it in/home/.juliarc.jl on Ubuntu,~/.juliarc.jl on OS X, orC:\Users\username\.juliarc.jl on Windows.

Building from source

Download the source code, rather than the binaries, if you intend to contribute to the development of Julia itself, or if no Julia binaries are provided for your operating system or particular computer architecture. The Julia source code can be found on GitHub athttps://github.com/JuliaLang/julia.git. Compiling the source code will get you the latest Julia version, not the stable version (if you want the latter, download the binaries, and refer to the previous section).

Because of the diversity of platforms and the possible issues involved, we refer you tohttps://github.com/JuliaLang/julia, and in that, theSource Download and Compilation section.

JuliaPro

Another alternative is JuliaPro, which is available fromhttps://juliacomputing.com/products/juliapro.html. This is an Anaconda-style Julia repository, which, at present, is only up to version 0.6.4. It does come with about 200+ verified ready-to-go packages, and is a very good way for beginners to start. JuliaPro version 1.0 will probably become available after some time.

There are two ways of using Julia. As described in the previous section, we can use the Julia shell for interactive work. Alternatively, we can write programs in a text file, save them with a.jl extension, and let Julia execute the program by starting it by running julia program.jl.

Working with Julia's REPL

We started with Julia's REPL in the previous section to verify the correctness of the installation by issuing thejuliacommand in a Terminal session. The REPL is Julia's working environment, where you can interact with thejust in time (JIT) compiler to test out pieces of code. When satisfied, you can copy and paste this code into a file with a.jl extension, such asprogram.jl. Alternatively, you can continue to work on this code from within a text editor or an IDE, such as the ones we will point out later in this chapter. After the banner with Julia's logo has appeared, you will get ajulia>prompt for the input. To end this session and get to the OS Command Prompt, typeCtrl +D, and hitEnter. To evaluate an expression, type it and pressEnter to show the result, as shown in the following screenshot:

Working with the REPL (1)

If, for some reason, you don't need to see the result, end the expression with a; (semicolon) such as8 * 5; In both the cases, the resulting value is stored, for convenience, in a variable namedans that can be used in expressions, but only inside the REPL. You can bind a value to a variable by entering an assignment asa = 3. Julia is dynamic, and we don't need to enter a type fora, but we do need to enter a value for the variable so that Julia can infer its type. Using a variableb that is not bound to thea value results in theERROR: UndefVarError: b not defined message. Strings are delineated by double quotes (" "), as inb = "Julia". The following screenshot illustrates this in the REPL:

Working with the REPL (2)

Previous expressions can be retrieved in the same session by working with the up and down arrow keys. The following key bindings are also handy:

  • To clear or interrupt a current command, pressCtrl +C
  • To clear the screen, pressCtrl +L (variables are kept in memory)

Commands from the previous sessions can still be retrieved, because they are stored (with a timestamp) in arepl_history.jl file (in/home/$USER/.julia/logs on Ubuntu,C:\Users\username\.julia\logs on Windows, or~/.julia/logs/repl_historyon OS X).Ctrl +R (produces areverse-i-search prompt) searches through these commands. 

Typing? starts up the help mode (help?>) to give you quick access to Julia's documentation. Information on function names, types, macros, and so on, is given when typing in their names. Alternatively, to get more information on a variable, for example, a, type?a, and to get more information on a function such assort, type?sort. To find all the places where a function such asprintln is defined or used, typeapropos("println"), which gives the following output:

Base.Pair
Base.any
Base.@isdefined
Base.eachindex
Base.all
Base.Generator
Base.Timer

Printf.@sprintf
REPL.TerminalMenus.request

Thus, we can see that it is defined in theBase module, and that it is used in several other functions.

Different complete expressions on the same line have to be separated by a; (semicolon), and only the last result is shown. You can enter multiline expressions, as shown in the following screenshot. If the shell detects that the statement is syntactically incomplete, it will not attempt to evaluate it. Rather, it will wait for the user to enter additional lines until the multiline statement can be evaluated:

Working with the REPL (3)

A handy autocomplete feature also exists. Type one or more letters, press theTab key twice, and then a list of functions starting with these letters appears. For example, typeso, press theTab key twice, and then you will get the list as sort sort! sortcols sortperm sortperm! sortrows.

If you start a line with;, the rest of the line is interpreted as a system shell command (try, for example,ls,cd,mkdir,whoamion Linux). TheBackspace key returns to the Julia prompt.

A Julia script can be executed in the REPL by calling it withinclude. For example, forhello.jl, which contains theprintln("Hello, Julia World!") statement, the command is as follows:

julia> include("hello.jl")

The preceding command prints the output as follows:

Hello, Julia World!

Experiment a bit with different expressions to get a feeling for this environment.

Startup options and Julia scripts

Without any options, thejulia command starts up the REPL environment. A useful option to check your environment isjulia -v. This shows Julia's version, for example,julia version 1.0.0. (Theversioninfo()function in REPL is more detailed, and theVERSION constant only gives you the version number:v"1.0.0"). An option that lets you evaluate expressions on the command line itself is-e, for example:

julia -e 'a = 6 * 7;
println(a)'

The preceding commands print out42 (this also works in a PowerShell window on Windows, but in an ordinary Windows Command Prompt, use" instead of the' character).

Some other options that are useful for parallel processing will be discussed inChapter 9,Running External Programs. Typejulia -h for a list of all options.

Ascript.jl file with Julia source code can be started from the command line with the following command:

julia script.jl arg1 arg2 arg3

Here,arg1,arg2, andarg3 are optional arguments to be used in the script's code. They are available from the global constantARGS. Take a look at theargs.jl file, which contains the following:

for arg in ARGS     println(arg) end

Thejulia args.jl 1 Red C command prints out1,Red, andC on consecutive lines.

A script file can also execute other source files by including them in the REPL; for example,main.jl containsinclude("hello.jl"), which will execute the code fromhello.jl when called withjulia main.jl.

Sometimes, it can be useful to know when code is executed interactively in the REPL, or when started up with the Julia VM with thejulia command. This can be tested with theisinteractive() function. Theisinteractive.jl script contains the following code:

println("Is this interactive? $(isinteractive())")

If you start this up in the REPL withinclude("isinteractive.jl"), the output will beIs this interactive? true.

When started up in a Terminal window asjulia isinteractive.jl, the output is Is this interactive? false.

You can download the example code files from your account athttp://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visithttps://github.com/PacktPublishing/Julia-1.0-Programming-Second-Edition.

Packages

Most of the standard library in Julia (which can be found in/share/julia/base and/share/julia/stdlib, relative to where Julia was installed) is written in Julia itself. The rest of Julia's code ecosystem is contained in packages that are simply GitHub repositories. They are most often authored by external contributors, and already provide functionality for such diverse disciplines such as bioinformatics, chemistry, cosmology, finance, linguistics, machine learning, mathematics, statistics, and high-performance computing. A package listing can be found athttp://pkg.julialang.org.

Julia's installation contains a built-in package manager,Pkg, for installing additional packages that are written in Julia. Version and dependency management is handled automatically byPkg.

Pkghas a REPL mode, which can be started from within the Julia REPL by entering the] key, which is often called the REPL's package mode. ThePkg mode is shown as a blue prompt, like this:(v1.0) pkg>.

From this mode, we can start all functions ofPkg. To return to the normal REPL mode, pressBackspace orCtrl C.

To initialize your environment, enter theinit command, which creates an emptyProject.toml file in your Julia installation folder.

Adding a new package

Before adding a new package, it is always a good idea to update your package database for the already installed packages with theup command. Then, add a new package by issuing theadd PackageName command, and execute it by usingPackageName in the code or in the REPL.

For example, to add 2D plotting capabilities, install thePlots package withadd Plots in thePackage mode by first typing]. This installs thePlots package and all of its dependencies, building them when needed.

To make a graph of 100 random numbers between 0 and 1, execute the following commands:

using Plotsplot(rand(100))

Therand(100) function is an array with 100 random numbers. This produces the following output:

A plot of white noise with Plots

After installing a new Julia version, update all the installed packages by runningup in thePkg REPL-mode.

Installing and working with IJulia

IJulia (https://github.com/JuliaLang/IJulia.jl) is a combination of the Jupyter Notebook interactive environment (http://jupyter.org/) with a Julia language backend. It allows you to work with a powerful graphical notebook (which combines code, formatted text, math, and multimedia in a single document) witha regular REPL. Detailed instructions for installation can be found at the GitHub page for IJulia (https://github.com/JuliaLang/IJulia.jl) and in theJulia at MIT notes (https://github.com/stevengj/julia-mit/blob/master/README.md). Add the IJulia package in the REPL package mode withadd IJulia.

Then, whenever you want to use it, start up a Julia REPL and type the following commands:

using IJulianotebook()

If you want to run it from the command line, type:

jupyter notebook

The IJulia dashboard should look as follows:

The IJulia dashboard

You should see the Jupyter logo in the upper-left corner of the browser window. Julia code is entered in the input cells (the input can be multiline) and then executed withShift +Enter

Here is a small example (ijulia-example.jl):

The output should be something as follows:

An IJulia session example

In the first input cell, the value ofb is calculated froma:

a = 5b = 2a^2 + 30a + 9

In the second input cell, we usePyPlot. Install this package withadd PyPlot in the REPL package mode, and by issuingusing PyPlot in the REPL.

Therange(0,stop=5,length=101) command defines an array of 100 equally spaced values between0 and5;y is defined as a function ofx and is then shown graphically with theplot command, as follows:

using PyPlot
x = range(0,stop=5,length=101)
y = cos.(2x .+ 5) plot(x, y, linewidth=2.0, linestyle="--") title("a nice cosinus") xlabel("x axis") ylabel("y axis")

Save a notebook in file format (with the.ipynb extension) by downloading it from the menu.

Installing Juno

Juno (http://junolab.org/) is a full-fledged IDE for Julia by Mike Innes, which is based on the Atom environment. The setup page athttps://github.com/JunoLab/uber-juno/blob/master/setup.md provides detailed instructions for installing and configuring Juno. Here is a summary of the steps:

  1. Download and install Atom (https://atom.io/)
  2. Start it up, go toSettings, and then click Install Panel
  3. Enteruber-juno into the search box

Atom works extensively with a command palette that you can open by typingCtrl + spacebar, entering a command, and then selecting it. Juno provides an integrated console, and you can evaluate single expressions in the code editor directly by typingCtrl +Enter at the end of the line. A complete script is evaluated by typingCtrl +Shift +Enter. More on basic usage can be found here:http://docs.junolab.org/latest/man/basic_usage.html.

Installing julia-vscode

Another IDE calledjulia-vscode is based on the Visual Studio Code editor (https://code.visualstudio.com/). Install it by following the instructions given here:https://github.com/JuliaEditorSupport/julia-vscode.This IDE provides syntax highlighting, code snippets, Julia-specific commands (execute code by pressingF5), an integrated Julia REPL, code completion, hover help, a linter, code navigation, and tasks for running tests, builds, benchmarks, and build documentation.

Installing Sublime-IJulia

The Sublime Text editor (http://www.sublimetext.com/3) has a plugin calledJulia-sublime:https://github.com/JuliaEditorSupport/Julia-sublime. It gives you syntax highlighting, autocompletion, auto-indentation, and code snippets. To install it, selectJulia from thePackage Control: Install Package drop-down list in the Command Palette.

Other editors and IDEs

For Terminal users, the available editors are as follows:

On Linux,gedit is very good. The Julia plugin works well and provides autocompletion.Notepad++ also has Julia support from thecontrib directory mentioned earlier.

TheCoCalc project (https://cocalc.com/) runs Julia in the cloud within a Terminal and lets you work with Jupyter notebooks. You can also work and teach with Julia in the cloud by using theJuliaBox platform (https://juliabox.org/).

How Julia works

(You can safely skip this section on a first reading.)Julia works with an LLVM JIT compiler framework that is used for JIT generation of machine code. The first time you run a Julia function, it is parsed, and the types are inferred. Then, LLVM code is generated by theJIT compiler, which is then optimized and compiled down to native code. The second time you run a Julia function, the native code that's already generated is called. This is the reason why, the second time you call a function with arguments of a specific type, it takes much less time to run than the first time (keep this in mind when doing benchmarks of Julia code).

This generated code can be inspected. Suppose, for example, that we have defined af(x) = 2x + 5function in a REPL session. Julia responds with the message f (generic function with one method); the code isdynamic because we didn't have to specify the type ofx orf. Functions are, by default, generic in Julia because they are ready to work with different data types for their variables.

Thecode_llvm function can be used to see the JIT bytecode. This is the bytecode generated by LLVM, and it will be different for each target platform. For example, for the Intel x64 platform, if thex argument is of typeInt64, it will be as follows:

julia> code_llvm(f, (Int64,)) ; Function f ; Location: REPL[7]:1 ; Function Attrs: uwtable define i64 @julia_f_33833(i64) #0 { top: ; Function *; { ; Location: int.jl:54   %1 = shl i64 %0, 1 ;} ; Function +; { ; Location: int.jl:53   %2 = add i64 %1, 5 ;}   ret i64 %2 }

Thecode_native function can be used to see the assembly code that was generated for the same type ofx:

julia> code_native(f, (Int64,))         .text ; Function f { ; Location: REPL[7]:1         pushq   %rbp         movq    %rsp, %rbp ; Function +; { ; Location: int.jl:53         leaq    5(%rcx,%rcx), %rax ;}         popq    %rbp         retq         nopl    (%rax,%rax) ;}

Compare this with the code generated whenx is of typeFloat64:

julia> code_native(f, (Float64,))        .text ; Function f { ; Location: REPL[7]:1         pushq   %rbp         movq    %rsp, %rbp ; Function *; { ; Location: promotion.jl:314 ; Function *; { ; Location: float.jl:399         vaddsd  %xmm0, %xmm0, %xmm0         movabsq $424735072, %rax        # imm = 0x1950F160 ;}} ; Function +; { ; Location: promotion.jl:313 ; Function +; { ; Location: float.jl:395         vaddsd  (%rax), %xmm0, %xmm0 ;}}         popq    %rbp         retq         nopl    (%rax,%rax) ;}

Julia code is fast because it generates specialized versions of functions for each data type. Julia also implements automatic memory management. The user doesn't have to worry about allocating and keeping track of the memory for specific objects. Automatic deletion of objects that are not needed anymore (and hence, reclamation of the memory associated with those objects) is done using agarbage collector (GC).

The GC runs at the same time as your program. Exactly when a specific object is garbage collected is unpredictable. The GC implements an incremental mark-and-sweep algorithm. You can start garbage collection yourself by callingGC.gc(), or if you don't need it, you can disable it by callingGC.enable(false).

The standard library is implemented in Julia itself. The I/O functions rely on thelibuv library for an efficient, platform-independent I/O. The standard library is contained in a package calledBase, which is automatically imported when starting Julia.

Key benefits

  • Leverage Julia's high speed and efficiency for your applications
  • Work with Julia in a multi-core, distributed, and networked environment
  • Apply Julia to tackle problems concurrently and in a distributed environment

Description

The release of Julia 1.0 is now ready to change the technical world by combining the high productivity and ease of use of Python and R with the lightning-fast speed of C++. Julia 1.0 programming gives you a head start in tackling your numerical and data problems. You will begin by learning how to set up a running Julia platform, before exploring its various built-in types. With the help of practical examples, this book walks you through two important collection types: arrays and matrices. In addition to this, you will be taken through how type conversions and promotions work. In the course of the book, you will be introduced to the homo-iconicity and metaprogramming concepts in Julia. You will understand how Julia provides different ways to interact with an operating system, as well as other languages, and then you'll discover what macros are. Once you have grasped the basics, you’ll study what makes Julia suitable for numerical and scientific computing, and learn about the features provided by Julia. By the end of this book, you will also have learned how to run external programs. This book covers all you need to know about Julia in order to leverage its high speed and efficiency for your applications.

Who is this book for?

Julia 1.0 Programming is for you if you are a statistician or data scientist who wants a crash course in the Julia programming language while building big data applications. A basic knowledge of mathematics is needed to understand the various methods that are used or created during the course of the book to exploit the capabilities that Julia is designed with.

What you will learn

  • Set up your Julia environment to achieve high productivity
  • Create your own types to extend the built-in type system
  • Visualize your data in Julia with plotting packages
  • Explore the use of built-in macros for testing and debugging, among other uses
  • Apply Julia to tackle problems concurrently
  • Integrate Julia with other languages such as C, Python, and MATLAB

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Languages :

What do you get with eBook?

Product feature iconInstant access to your Digital eBook purchase
Product feature icon Download this book inEPUB andPDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature iconDRM FREE - Read whenever, wherever and however you want
OR

Contact Details

Modal Close icon
Payment Processing...
tickCompleted

Billing Address

Product Details

Publication date :Sep 24, 2018
Length:196 pages
Edition :2nd
Language :English
ISBN-13 :9781788990059
Category :
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99billed monthly
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconSimple pricing, no contract
€189.99billed annually
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconChoose a DRM-free eBook or Video every month to keep
Feature tick iconPLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick iconExclusive print discounts
€264.99billed in 18 months
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconChoose a DRM-free eBook or Video every month to keep
Feature tick iconPLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick iconExclusive print discounts

Frequently bought together


Julia 1.0 Programming Cookbook
Julia 1.0 Programming Cookbook
Read more
Nov 2018460 pages
Full star icon3.3 (4)
eBook
eBook
€26.98€29.99
€36.99
Julia Programming Projects
Julia Programming Projects
Read more
Dec 2018500 pages
Full star icon4 (10)
eBook
eBook
€26.98€29.99
€36.99
Julia 1.0 Programming
Julia 1.0 Programming
Read more
Sep 2018196 pages
Full star icon3.5 (2)
eBook
eBook
€23.99€26.99
€32.99
Stars icon
Total106.97
Julia 1.0 Programming Cookbook
€36.99
Julia Programming Projects
€36.99
Julia 1.0 Programming
€32.99
Total106.97Stars icon

Table of Contents

11 Chapters
Installing the Julia PlatformChevron down iconChevron up icon
Installing the Julia Platform
Installing Julia
Working with Julia's REPL
Startup options and Julia scripts
Packages
Installing and working with IJulia
Installing Juno
Installing julia-vscode
Installing Sublime-IJulia
Other editors and IDEs
How Julia works
Summary
Variables, Types, and OperationsChevron down iconChevron up icon
Variables, Types, and Operations
Variables, naming conventions, and comments
Types
Integers
Floating point numbers
Elementary mathematical functions and operations
Rational and complex numbers
Characters
Strings
Regular expressions
Ranges and arrays
Dates and times
Scope and constants
Summary
FunctionsChevron down iconChevron up icon
Functions
Defining functions
Optional and keyword arguments
Anonymous functions
First-class functions and closures
functions
Broadcasting
Map, filter, and list comprehensions
Generic functions and multiple dispatch
Summary
Control FlowChevron down iconChevron up icon
Control Flow
Conditional evaluation
Repeated evaluation
Exception handling
Scope revisited
Tasks
Summary
Collection TypesChevron down iconChevron up icon
Collection Types
Matrices
Tuples
Dictionaries
Sets
An example project – word frequency
Summary
More on Types, Methods, and ModulesChevron down iconChevron up icon
More on Types, Methods, and Modules
Type annotations
The type hierarchy – subtypes and supertypes
Concrete and abstract types
User-defined and composite types
Types and collections – inner constructors
Type unions
Parametric types and methods
Standard modules and paths
Summary
Metaprogramming in JuliaChevron down iconChevron up icon
Metaprogramming in Julia
Expressions and symbols
Evaluation and interpolation
Defining macros
Built-in macros
Reflection capabilities
Summary
I/O, Networking, and Parallel ComputingChevron down iconChevron up icon
I/O, Networking, and Parallel Computing
Basic input and output
Working with files
Using DataFrames
Working with TCP sockets and servers
Interacting with databases
Parallel operations and computing
Summary
Running External ProgramsChevron down iconChevron up icon
Running External Programs
Running shell commands
Calling C and Fortran
Calling Python
Performance tips
Summary
The Standard Library and PackagesChevron down iconChevron up icon
The Standard Library and Packages
Digging deeper into the standard library
Julia's package manager
Graphics in Julia
Using Plots on data
Summary
Other Books You May EnjoyChevron down iconChevron up icon
Other Books You May Enjoy
Leave a review - let other readers know what you think

Recommendations for you

Left arrow icon
Debunking C++ Myths
Debunking C++ Myths
Read more
Dec 2024226 pages
Full star icon5 (1)
eBook
eBook
€20.99€23.99
€29.99
Go Recipes for Developers
Go Recipes for Developers
Read more
Dec 2024350 pages
eBook
eBook
€20.99€23.99
€29.99
50 Algorithms Every Programmer Should Know
50 Algorithms Every Programmer Should Know
Read more
Sep 2023538 pages
Full star icon4.5 (68)
eBook
eBook
€26.98€29.99
€37.99
€37.99
Asynchronous Programming with C++
Asynchronous Programming with C++
Read more
Nov 2024424 pages
Full star icon5 (1)
eBook
eBook
€22.99€25.99
€31.99
Modern CMake for C++
Modern CMake for C++
Read more
May 2024504 pages
Full star icon4.7 (12)
eBook
eBook
€26.98€29.99
€37.99
Learn Python Programming
Learn Python Programming
Read more
Nov 2024616 pages
Full star icon5 (1)
eBook
eBook
€20.99€23.99
€29.99
Learn to Code with Rust
Learn to Code with Rust
Read more
Nov 202457hrs 40mins
Video
Video
€56.99
Modern Python Cookbook
Modern Python Cookbook
Read more
Jul 2024818 pages
Full star icon4.9 (21)
eBook
eBook
€28.99€32.99
€41.99
Right arrow icon

Customer reviews

Rating distribution
Full star iconFull star iconFull star iconHalf star iconEmpty star icon3.5
(2 Ratings)
5 star0%
4 star50%
3 star50%
2 star0%
1 star0%
Gianluigi PivaJul 09, 2020
Full star iconFull star iconFull star iconFull star iconEmpty star icon4
Dopo Python, ritengo he per la parte matematica sia veramente notevole
Amazon Verified reviewAmazon
SaSyMar 09, 2019
Full star iconFull star iconFull star iconEmpty star iconEmpty star icon3
Ein gutes Buch für den Einsteiger in die Julia-Programmierung. Ich würde aber definitiv mit dem Kauf bis zur nächsten Auflage warten, da noch einige Inkonsistenzen im Buch zu finden sind (ich habe die 2. Auflage). Offensichtlich ist das Buch ein Update für die Beschreibung der Version 0.6 (oder 0.7). Mit dem Wechsel auf 1.0 haben sich aber einige Befehle dauerhaft geändert (type heißt jetzt struct oder @parallel ist jetzt @distributed). Die Code-Beispiele berücksichtigen diese Änderungen. Der Text erwähnt allerdings noch die alten Befehle. Dies kann zu Verwirrungen führen. Ich benutze das Buch, wenn ich schnell eine Kleinigkeit nachschlagen will. Dafür ist es ganz gut. Bei Julia ist jedoch auch die Online-Dokumentation sehr gut verfasst. Das Buch ist natürlich demgegenüber übersichtlicher gestaltet, deckt aber auch nur einen Bruchteil ab.
Amazon Verified reviewAmazon

People who bought this also bought

Left arrow icon
50 Algorithms Every Programmer Should Know
50 Algorithms Every Programmer Should Know
Read more
Sep 2023538 pages
Full star icon4.5 (68)
eBook
eBook
€26.98€29.99
€37.99
€37.99
Event-Driven Architecture in Golang
Event-Driven Architecture in Golang
Read more
Nov 2022384 pages
Full star icon4.9 (11)
eBook
eBook
€26.98€29.99
€37.99
The Python Workshop Second Edition
The Python Workshop Second Edition
Read more
Nov 2022600 pages
Full star icon4.6 (22)
eBook
eBook
€27.99€31.99
€38.99
Template Metaprogramming with C++
Template Metaprogramming with C++
Read more
Aug 2022480 pages
Full star icon4.6 (14)
eBook
eBook
€25.99€28.99
€35.99
Domain-Driven Design with Golang
Domain-Driven Design with Golang
Read more
Dec 2022204 pages
Full star icon4.4 (19)
eBook
eBook
€23.99€26.99
€33.99
Right arrow icon

About the author

Profile icon Ivo Balbaert
Ivo Balbaert
LinkedIn iconGithub icon
Ivo Balbaert is a lecturer in web programming and databases at CVO Antwerpen, a community college in Belgium. He received a PhD in applied physics from the University of Antwerp in 1986. He worked for 20 years in the software industry as a developer and consultant in several companies, and for 10 years as project manager at the University Hospital of Antwerp. From 2000 onwards, he switched to partly teaching and partly developing software (at KHM Mechelen, CVO Antwerpen). He also wrote an introductory book in Dutch about developing in Ruby and Rails, Programmeren met Ruby en Rails, published by Van Duuren Media. In 2012, he authored a book on the Go programming language, The Way to Go, published by iUniverse. He has written a number of introductory books for new programming languages, notably Dart, Julia, Rust, and Red, all published by Packt.
Read more
See other products by Ivo Balbaert
Getfree access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook?Chevron down iconChevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website?Chevron down iconChevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook?Chevron down iconChevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support?Chevron down iconChevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks?Chevron down iconChevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook?Chevron down iconChevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.


[8]ページ先頭

©2009-2025 Movatter.jp