Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Conversion #18588

Merged
merged 95 commits into from
Dec 7, 2016
Merged
Changes from 1 commit
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
a1e14c4
Setup new directory structure in doc/
MichaelHatherly Dec 7, 2016
20336ae
Update README in the doc/ directory
MichaelHatherly Dec 7, 2016
becd19d
Rename and move all .rst files to .md ones
MichaelHatherly Dec 7, 2016
8d47ac8
Add Julia logo
MichaelHatherly Dec 7, 2016
7f510ec
Convert doc/src/manual/arrays
MichaelHatherly Dec 7, 2016
ef6648c
Convert doc/src/manual/calling-c-and-fortran-code
MichaelHatherly Dec 7, 2016
92fb84c
Convert doc/src/manual/complex-and-rational-numbers
MichaelHatherly Dec 7, 2016
53811ff
Convert doc/src/manual/constructors
MichaelHatherly Dec 7, 2016
505cdd9
Convert doc/src/manual/control-flow
MichaelHatherly Dec 7, 2016
100fb02
Convert doc/src/manual/conversion-and-promotion
MichaelHatherly Dec 7, 2016
002bd73
Convert doc/src/manual/dates
MichaelHatherly Dec 7, 2016
74e7764
Convert doc/src/manual/documentation
MichaelHatherly Dec 7, 2016
d88c3c5
Convert doc/src/manual/embedding
MichaelHatherly Dec 7, 2016
04fc039
Convert doc/src/manual/faq
MichaelHatherly Dec 7, 2016
b4f4525
Convert doc/src/manual/functions
MichaelHatherly Dec 7, 2016
5e17741
Convert doc/src/manual/getting-started
MichaelHatherly Dec 7, 2016
1da93f3
Convert doc/src/manual/handling-operating-system-variation
MichaelHatherly Dec 7, 2016
a43c921
Convert doc/src/manual/index
MichaelHatherly Dec 7, 2016
fa04dc4
Convert doc/src/manual/integers-and-floating-point-numbers
MichaelHatherly Dec 7, 2016
ed4ab64
Convert doc/src/manual/interacting-with-julia
MichaelHatherly Dec 7, 2016
f2107d3
Convert doc/src/manual/interfaces
MichaelHatherly Dec 7, 2016
e0de340
Convert doc/src/manual/introduction
MichaelHatherly Dec 7, 2016
d47b40e
Convert doc/src/manual/linear-algebra
MichaelHatherly Dec 7, 2016
e32b45f
Convert doc/src/manual/mathematical-operations
MichaelHatherly Dec 7, 2016
454ace8
Convert doc/src/manual/metaprogramming
MichaelHatherly Dec 7, 2016
679e136
Convert doc/src/manual/methods
MichaelHatherly Dec 7, 2016
f86ab7a
Convert doc/src/manual/modules
MichaelHatherly Dec 7, 2016
fba60de
Convert doc/src/manual/networking-and-streams
MichaelHatherly Dec 7, 2016
ff846a8
Convert doc/src/manual/noteworthy-differences
MichaelHatherly Dec 7, 2016
0d65411
Convert doc/src/manual/packages
MichaelHatherly Dec 7, 2016
0b6f736
Convert doc/src/manual/parallel-computing
MichaelHatherly Dec 7, 2016
1f1f668
Convert doc/src/manual/performance-tips
MichaelHatherly Dec 7, 2016
0163ce8
Convert doc/src/manual/profile
MichaelHatherly Dec 7, 2016
f0abd07
Convert doc/src/manual/running-external-programs
MichaelHatherly Dec 7, 2016
a41cc4a
Convert doc/src/manual/stacktraces
MichaelHatherly Dec 7, 2016
36d07ae
Convert doc/src/manual/strings
MichaelHatherly Dec 7, 2016
e94288a
Convert doc/src/manual/style-guide
MichaelHatherly Dec 7, 2016
46f1efa
Convert doc/src/manual/types
MichaelHatherly Dec 7, 2016
de3f705
Convert doc/src/manual/unicode-input
MichaelHatherly Dec 7, 2016
2341ca3
Convert doc/src/manual/variables-and-scoping
MichaelHatherly Dec 7, 2016
cbb6124
Convert doc/src/manual/variables
MichaelHatherly Dec 7, 2016
a40eb3b
Convert doc/src/manual/workflow-tips
MichaelHatherly Dec 7, 2016
177bdbf
Convert doc/src/stdlib/arrays
MichaelHatherly Dec 7, 2016
3ab2174
Convert doc/src/stdlib/base
MichaelHatherly Dec 7, 2016
6c44fbe
Convert doc/src/stdlib/c
MichaelHatherly Dec 7, 2016
3276c6a
Convert doc/src/stdlib/collections
MichaelHatherly Dec 7, 2016
2e88791
Convert doc/src/stdlib/constants
MichaelHatherly Dec 7, 2016
63c89cf
Convert doc/src/stdlib/dates
MichaelHatherly Dec 7, 2016
eb940fa
Convert doc/src/stdlib/file
MichaelHatherly Dec 7, 2016
b21cd89
Convert doc/src/stdlib/index
MichaelHatherly Dec 7, 2016
c4c515b
Convert doc/src/stdlib/io-network
MichaelHatherly Dec 7, 2016
c3cb729
Convert doc/src/stdlib/iterators
MichaelHatherly Dec 7, 2016
ba1a672
Convert doc/src/stdlib/libc
MichaelHatherly Dec 7, 2016
e478fe0
Convert doc/src/stdlib/libdl
MichaelHatherly Dec 7, 2016
a48c67c
Convert doc/src/stdlib/linalg
MichaelHatherly Dec 7, 2016
aa6078c
Convert doc/src/stdlib/math
MichaelHatherly Dec 7, 2016
2e9d4f8
Convert doc/src/stdlib/numbers
MichaelHatherly Dec 7, 2016
ac38d3a
Convert doc/src/stdlib/parallel
MichaelHatherly Dec 7, 2016
2b40b77
Convert doc/src/stdlib/pkg
MichaelHatherly Dec 7, 2016
c878340
Convert doc/src/stdlib/profile
MichaelHatherly Dec 7, 2016
4dae035
Convert doc/src/stdlib/punctuation
MichaelHatherly Dec 7, 2016
017a9f7
Convert doc/src/stdlib/simd-types
MichaelHatherly Dec 7, 2016
ae1de4d
Convert doc/src/stdlib/sort
MichaelHatherly Dec 7, 2016
b43dff4
Convert doc/src/stdlib/stacktraces
MichaelHatherly Dec 7, 2016
c244c0e
Convert doc/src/stdlib/strings
MichaelHatherly Dec 7, 2016
da67cb6
Convert doc/src/stdlib/test
MichaelHatherly Dec 7, 2016
134ac3a
Convert doc/src/devdocs/ast
MichaelHatherly Dec 7, 2016
2abbdfa
Convert doc/src/devdocs/backtraces
MichaelHatherly Dec 7, 2016
94de094
Convert doc/src/devdocs/boundscheck
MichaelHatherly Dec 7, 2016
435d925
Convert doc/src/devdocs/callconv
MichaelHatherly Dec 7, 2016
0341030
Convert doc/src/devdocs/cartesian
MichaelHatherly Dec 7, 2016
1df1d1e
Convert doc/src/devdocs/C
MichaelHatherly Dec 7, 2016
ae6d027
Convert doc/src/devdocs/debuggingtips
MichaelHatherly Dec 7, 2016
aebc200
Convert doc/src/devdocs/eval
MichaelHatherly Dec 7, 2016
b69a5fd
Convert doc/src/devdocs/functions
MichaelHatherly Dec 7, 2016
d8f5b4e
Convert doc/src/devdocs/init
MichaelHatherly Dec 7, 2016
cc40c6a
Convert doc/src/devdocs/julia
MichaelHatherly Dec 7, 2016
0d74803
Convert doc/src/devdocs/llvm
MichaelHatherly Dec 7, 2016
b0fb710
Convert doc/src/devdocs/locks
MichaelHatherly Dec 7, 2016
5e9a2c4
Convert doc/src/devdocs/meta
MichaelHatherly Dec 7, 2016
c659571
Convert doc/src/devdocs/object
MichaelHatherly Dec 7, 2016
33be9c3
Convert doc/src/devdocs/offset-arrays
MichaelHatherly Dec 7, 2016
1e39955
Convert doc/src/devdocs/reflection
MichaelHatherly Dec 7, 2016
eb722cb
Convert doc/src/devdocs/sanitizers
MichaelHatherly Dec 7, 2016
226e12a
Convert doc/src/devdocs/stdio
MichaelHatherly Dec 7, 2016
c4ea3a0
Convert doc/src/devdocs/subarrays
MichaelHatherly Dec 7, 2016
bb62572
Convert doc/src/devdocs/sysimg
MichaelHatherly Dec 7, 2016
5cff3ab
Convert doc/src/devdocs/types
MichaelHatherly Dec 7, 2016
08338b7
Convert doc/src/devdocs/valgrind
MichaelHatherly Dec 7, 2016
105624a
Convert doc/src/index
MichaelHatherly Dec 7, 2016
1c58e98
Add Documenter 'make.jl' build file
MichaelHatherly Dec 7, 2016
bd35156
Fix autolinks in /base
MichaelHatherly Dec 7, 2016
b1d015a
Remove unused files from doc/ directory
MichaelHatherly Dec 7, 2016
abddf00
Update Makefiles for Sphinx to Documenter.jl changes
MichaelHatherly Dec 7, 2016
421633d
Update documentation section of CONTRIBUTING.md
MichaelHatherly Dec 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 26 additions & 43 deletions doc/src/devdocs/callconv.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,43 @@
.. _devdocs-callconv:

*******************
Calling Conventions
*******************

.. currentmodule:: Base
# Calling Conventions

Julia uses three calling conventions for four distinct purposes:

+-------+--------------+----------------------------------+
|Name |Prefix |Purpose |
+=======+==============+==================================+
|Native |``julia_`` | Speed via specialized signatures |
+-------+--------------+----------------------------------+
|JL Call|``jlcall_`` | Wrapper for generic calls |
+ +--------------+----------------------------------+
| |``jl_`` | Builtins |
+-------+--------------+----------------------------------+
|C ABI |``jlcapi_`` | Wrapper callable from C |
+-------+--------------+----------------------------------+
| Name | Prefix | Purpose |
|:------- |:--------- |:-------------------------------- |
| Native | `julia_` | Speed via specialized signatures |
| JL Call | `jlcall_` | Wrapper for generic calls |
| JL Call | `jl_` | Builtins |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does markdown not have a way of making table entries extend across multiple rows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, markdown doesn't usually have that I think, though there are some dialects, such as pandoc, that do seem to support those kind of things, so we could probably just extend our parser as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. In case you hadn't guessed, I've been checking a few pages using http://services.w3.org/htmldiff, looking at a branch on my fork where I pushed the last pre-conversion commit's html docs (https://github.com/tkelman/julia/commits/gh-pages-preconversion). Haven't done too many yet, but the ones I've looked at have been remarkably clean.

We do need to figure something out for the windows buildbots though.

| C ABI | `jlcapi_` | Wrapper callable from C |

Julia Native Calling Convention
-------------------------------
## Julia Native Calling Convention

The native calling convention is designed for fast non-generic calls.
It usually uses a specialized signature.
The native calling convention is designed for fast non-generic calls. It usually uses a specialized
signature.

* LLVM ghosts (zero-length types) are omitted.
* LLVM scalars and vectors are passed by value.
* LLVM aggregates (arrays and structs) are passed by reference.
* LLVM ghosts (zero-length types) are omitted.
* LLVM scalars and vectors are passed by value.
* LLVM aggregates (arrays and structs) are passed by reference.

A small return values is returned as LLVM return values.
A large return values is returned via the "structure return" (``sret``)
convention, where the caller provides a pointer to a return slot.
A small return values is returned as LLVM return values. A large return values is returned via
the "structure return" (`sret`) convention, where the caller provides a pointer to a return slot.

An argument or return values thta is a homogeneous tuple is
sometimes represented as an LLVM vector instead of an LLVM array.
An argument or return values thta is a homogeneous tuple is sometimes represented as an LLVM vector
instead of an LLVM array.

JL Call Convention
------------------
## JL Call Convention

The JL Call convention is for builtins and generic dispatch.
Hand-written functions using this convention are declared via the macro ``JL_CALLABLE``.
The convention uses exactly 3 parameters:
The JL Call convention is for builtins and generic dispatch. Hand-written functions using this
convention are declared via the macro `JL_CALLABLE`. The convention uses exactly 3 parameters:

* ``F`` - Julia representation of function that is being applied
* ``args`` - pointer to array of pointers to boxes
* ``nargs`` - length of the array
* `F` - Julia representation of function that is being applied
* `args` - pointer to array of pointers to boxes
* `nargs` - length of the array

The return value is a pointer to a box.

C ABI
-----
## C ABI

C ABI wrappers enable calling Julia from C.
The wrapper calls a function using the native calling convention.
C ABI wrappers enable calling Julia from C. The wrapper calls a function using the native calling
convention.

Tuples are always represented as C arrays.