You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
before turning into the desired result (hopefully).
14
14
15
15
.. sidebar:: Definitions
@@ -30,26 +30,26 @@ Julia Execution
30
30
31
31
The 10,000 foot view of the whole process is as follows:
32
32
33
-
1. The user starts `julia`.
34
-
2. The C function :c:func:`main` from `ui/repl.c` gets called.
33
+
1. The user starts ``julia``.
34
+
2. The C function :c:func:`main` from ``ui/repl.c`` gets called.
35
35
This function processes the command line arguments, filling in the :c:type:`jl_options` struct and setting the variable :code:`ARGS`.
36
36
It then initializes Julia (by calling `julia_init in task.c <https://github.com/JuliaLang/julia/blob/master/src/task.c>`_,
37
37
which may load a previously compiled sysimg_).
38
38
Finally, it passes off control to Julia by calling `Base._start() <https://github.com/JuliaLang/julia/blob/master/base/client.jl>`_.
39
-
#. When `_start()` takes over control, the subsequent sequence of commands depends on the command line arguments given.
39
+
#. When ``_start()`` takes over control, the subsequent sequence of commands depends on the command line arguments given.
40
40
For example, if a filename was supplied, it will proceed to execute that file. Otherwise, it will start an interactive REPL.
41
41
#. Skipping the details about how the REPL interacts with the user,
42
42
let's just say the program ends up with a block of code that it wants to run.
43
43
#. If the block of code to run is in a file, `jl_load(char *filename) <https://github.com/JuliaLang/julia/blob/master/src/toplevel.c>`_
44
-
gets invoked to load the file and parse_ it. Each fragment of code is then passed to `eval` to execute.
44
+
gets invoked to load the file and parse_ it. Each fragment of code is then passed to ``eval`` to execute.
45
45
#. Each fragment of code (or AST), is handed off to :func:`eval` to turn into results.
46
46
#. :func:`eval` takes each code fragment and tries to run it in `jl_toplevel_eval_flex() <https://github.com/JuliaLang/julia/blob/master/src/toplevel.c>`_.
47
-
#. :c:func:`jl_toplevel_eval_flex` decides whether the code is a "toplevel" action (such as `using` or `module`), which would be invalid inside a function.
47
+
#. :c:func:`jl_toplevel_eval_flex` decides whether the code is a "toplevel" action (such as ``using`` or ``module``), which would be invalid inside a function.
48
48
If so, it passes off the code to the toplevel interpreter.
49
49
#. :c:func:`jl_toplevel_eval_flex` then expands_ the code to eliminate any macros and to "lower" the AST to make it simpler to execute.
50
50
#. :c:func:`jl_toplevel_eval_flex` then uses some simple heuristics to decide whether to JIT compiler the AST or to interpret it directly.
51
51
#. The bulk of the work to interpret code is handled by `eval in interpreter.c <https://github.com/JuliaLang/julia/blob/master/src/interpreter.c>`_.
52
-
#. If instead, the code is compiled, the bulk of the work is handled by `codegen.cpp`.
52
+
#. If instead, the code is compiled, the bulk of the work is handled by ``codegen.cpp``.
53
53
Whenever a Julia function is called for the first time with a given set of argument types, `type inference`_ will be run on that function.
54
54
This information is used by the codegen_ step to generate faster code.
55
55
#. Eventually, the user quits the REPL, or the end of the program is reached, and the :func:`_start` method returns.
@@ -80,8 +80,8 @@ Macro Expansion
80
80
---------------
81
81
82
82
When :func:`eval` encounters a macro, it expands that AST node before attempting to evaluate the expression.
83
-
Macro expansion involves a handoff from :func:`eval` (in Julia), to the parser function :c:func:`jl_macroexpand` (written in `flisp`)
84
-
to the Julia macro itself (written in - what else - `Julia`) via :c:func:`fl_invoke_julia_macro`, and back.
83
+
Macro expansion involves a handoff from :func:`eval` (in Julia), to the parser function :c:func:`jl_macroexpand` (written in ``flisp``)
84
+
to the Julia macro itself (written in - what else - Julia) via :c:func:`fl_invoke_julia_macro`, and back.
85
85
86
86
Typically, macro expansion is invoked as a first step during a call to :func:`expand`/:c:func:`jl_expand`,
87
87
although it can also be invoked directly by a call to :func:`macroexpand`/:c:func:`jl_macroexpand`.
@@ -139,7 +139,7 @@ Type inference may also include other steps such as constant propagation and inl
139
139
These pseudo-functions implement operations on raw bits such as add and sign extend
140
140
that cannot be expressed directly in any other way.
141
141
Since they operate on bits directly, they must be compiled into a function
142
-
and surrounded by a call to `Core.Intrinsics.box(T, ...)` to reassign type information to the value.
142
+
and surrounded by a call to ``Core.Intrinsics.box(T, ...)`` to reassign type information to the value.
143
143
144
144
.. _codegen:
145
145
@@ -164,7 +164,7 @@ Other parts of codegen are handled by various helper files:
Handles the emission of various low-level intrinsic functions
@@ -183,14 +183,14 @@ System Image
183
183
------------
184
184
185
185
The system image is a precompiled archive of a set of Julia files.
186
-
The `sys.ji` file distributed with Julia is one such system image,
186
+
The ``sys.ji`` file distributed with Julia is one such system image,
187
187
generated by executing the file `sysimg.jl <https://github.com/JuliaLang/julia/blob/master/base/sysimg.jl>`_,
188
188
and serializing the resulting environment (including Types, Functions, Modules, and all other defined values)
189
189
into a file. Therefore, it contains a frozen version of the :mod:`Main`, :mod:`Core`, and :mod:`Base` modules (and whatever else was in the environment at the end of bootstrapping).
190
190
This serializer/deserializer is implemented by `jl_save_system_image/jl_restore_system_image in dump.c <https://github.com/JuliaLang/julia/blob/master/src/dump.c>`_.
191
191
192
192
If there is no sysimg file (:code:`jl_options.image_file == NULL`),
193
-
this also implies that `--build` was given on the command line,
193
+
this also implies that ``--build`` was given on the command line,
194
194
so the final result should be a new sysimg file.
195
195
During Julia initialization, minimal :mod:`Core` and :mod:`Main` modules are created.
196
196
Then a file named ``boot.jl`` is evaluated from the current directory.
0 commit comments