Goto Chapter: Top 1 2 3 Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

1 Introduction to JuliaInterface
 1.1 Aims of the JuliaInterface package
 1.2 Installation of the JuliaInterface package
 1.3 User preferences in the JuliaInterface package

1 Introduction to JuliaInterface

The GAP package JuliaInterface is part of a bidirectional interface between GAP and Julia.

1.1 Aims of the JuliaInterface package

The low level interface between GAP and Julia allows one to access GAP objects and to call GAP functions in a Julia session, to access Julia objects and to call Julia functions in a GAP session, and to convert low level data such as integers, booleans, strings, arrays/lists, dictionaries/records between the two systems.

In particular, this interface is not intended to provide a very Julia-ish interface to GAP objects and functions, nor a GAP-ish interface to Julia objects and functions.

Also, the interface does not provide conversions to GAP for Julia objects whose types are defined in Julia packages (that is, not in the core Julia). For example, the Julia package Oscar.jl provides several data types that correspond to objects in GAP. Their conversions between Julia and GAP are handled in Oscar.jl, see its src/GAP subdirectory, JuliaInterface does not deal with these issues.

The interface consists of

The JuliaInterface manual takes the viewpoint of a GAP session from where one wants to use Julia functionality. The opposite direction, using GAP functionality in a Julia session, is described in the documentation of the Julia package GAP.jl.

1.2 Installation of the JuliaInterface package

The package can be used only when the underlying GAP has been compiled with the Julia garbage collector, and the recommended way to install such a GAP is to install Julia first (see https://julialang.org/downloads/) and then to ask Julia's package manager to download and install GAP, by entering

using Pkg; Pkg.add( "GAP" )

at the Julia prompt.

One way to start a GAP session from the Julia session is to enter

using GAP; GAP.prompt()

at the Julia prompt, afterwards the package JuliaInterface is already installed and loaded.

Alternatively, one can start GAP in the traditional way, by executing a shell script. Such a script can be created in a location of your choice via the following Julia command, where dstdir is a directory path in which a gap.sh script plus some auxiliary files will be placed:

using GAP; GAP.create_gap_sh(dstdir)

Note that the JuliaInterface code belongs to the Julia package GAP.jl, hence it can be found there.

1.3 User preferences in the JuliaInterface package

1.3-1 User preference IncludeJuliaStartupFile

When one starts an interactive Julia session, the Julia startup file ~/.julia/config/startup.jl gets included automatically by default, see the section The Julia REPL in the Julia documentation. Hence the effects of this inclusion can be used in a GAP session which one gets via the following input.

using GAP; GAP.prompt()

However, this Julia startup file is not included into Julia by default when GAP gets started via the gap.sh script that is created during the installation of GAP (controlled by Julia).

The user preference IncludeJuliaStartupFile can be used to force that the startup file gets included also in the latter situation, as follows.

If the value is true then the file ~/.julia/config/startup.jl gets included into Julia after startup. If the value is a nonempty string that is the name of a directory then the startup.jl file in this directory gets included into Julia. Otherwise (this is the default) no startup.jl file will be included automatically.

 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 Ind

generated by GAPDoc2HTML