Markdown link migration part 2 (#20371)
This commit is contained in:
parent
2147b116a1
commit
c4ba4f06f8
18 changed files with 287 additions and 283 deletions
22
doc/docs.md
22
doc/docs.md
|
|
@ -1,38 +1,38 @@
|
||||||
The documentation consists of several documents:
|
The documentation consists of several documents:
|
||||||
|
|
||||||
- | `Tutorial (part I) <tut1.html>`_
|
- | [Tutorial (part I)](tut1.html)
|
||||||
| The Nim tutorial part one deals with the basics.
|
| The Nim tutorial part one deals with the basics.
|
||||||
|
|
||||||
- | `Tutorial (part II) <tut2.html>`_
|
- | [Tutorial (part II)](tut2.html)
|
||||||
| The Nim tutorial part two deals with the advanced language constructs.
|
| The Nim tutorial part two deals with the advanced language constructs.
|
||||||
|
|
||||||
- | `Tutorial (part III) <tut3.html>`_
|
- | [Tutorial (part III)](tut3.html)
|
||||||
| The Nim tutorial part three about Nim's macro system.
|
| The Nim tutorial part three about Nim's macro system.
|
||||||
|
|
||||||
- | `Language Manual <manual.html>`_
|
- | [Language Manual](manual.html)
|
||||||
| The Nim manual is a draft that will evolve into a proper specification.
|
| The Nim manual is a draft that will evolve into a proper specification.
|
||||||
|
|
||||||
- | `Library documentation <lib.html>`_
|
- | [Library documentation](lib.html)
|
||||||
| This document describes Nim's standard library.
|
| This document describes Nim's standard library.
|
||||||
|
|
||||||
- | `Compiler user guide <nimc.html>`_
|
- | [Compiler user guide](nimc.html)
|
||||||
| The user guide lists command line arguments, special features of the
|
| The user guide lists command line arguments, special features of the
|
||||||
compiler, etc.
|
compiler, etc.
|
||||||
|
|
||||||
- | `Tools documentation <tools.html>`_
|
- | [Tools documentation](tools.html)
|
||||||
| Description of some tools that come with the standard distribution.
|
| Description of some tools that come with the standard distribution.
|
||||||
|
|
||||||
- | `Memory management <mm.html>`_
|
- | [Memory management](mm.html)
|
||||||
| Additional documentation about Nim's memory management strategies
|
| Additional documentation about Nim's memory management strategies
|
||||||
| and how to operate them in a realtime setting.
|
| and how to operate them in a realtime setting.
|
||||||
|
|
||||||
- | `Source code filters <filters.html>`_
|
- | [Source code filters](filters.html)
|
||||||
| The Nim compiler supports source code filters as a simple yet powerful
|
| The Nim compiler supports source code filters as a simple yet powerful
|
||||||
builtin templating system.
|
builtin templating system.
|
||||||
|
|
||||||
- | `Internal documentation <intern.html>`_
|
- | [Internal documentation](intern.html)
|
||||||
| The internal documentation describes how the compiler is implemented. Read
|
| The internal documentation describes how the compiler is implemented. Read
|
||||||
this if you want to hack the compiler.
|
this if you want to hack the compiler.
|
||||||
|
|
||||||
- | `Index <theindex.html>`_
|
- | [Index](theindex.html)
|
||||||
| The generated index. **Index + (Ctrl+F) == Joy**
|
| The generated index. **Index + (Ctrl+F) == Joy**
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ Documentation Style
|
||||||
General Guidelines
|
General Guidelines
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
* See also `nep1<https://nim-lang.github.io/Nim/nep1.html>`_ which should probably be merged here.
|
* See also [nep1](nep1.html) which should probably be merged here.
|
||||||
* Authors should document anything that is exported; documentation for private
|
* Authors should document anything that is exported; documentation for private
|
||||||
procs can be useful too (visible via `nim doc --docInternal foo.nim`:cmd:).
|
procs can be useful too (visible via `nim doc --docInternal foo.nim`:cmd:).
|
||||||
* Within documentation, a period (`.`) should follow each sentence (or sentence fragment) in a comment block.
|
* Within documentation, a period (`.`) should follow each sentence (or sentence fragment) in a comment block.
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ Introduction
|
||||||
============
|
============
|
||||||
|
|
||||||
This document describes the usage of the *DrNim* tool. DrNim combines
|
This document describes the usage of the *DrNim* tool. DrNim combines
|
||||||
the Nim frontend with the `Z3 <https://github.com/Z3Prover/z3>`_ proof
|
the Nim frontend with the [Z3](https://github.com/Z3Prover/z3) proof
|
||||||
engine, in order to allow verify/validate software written in Nim.
|
engine, in order to allow verify/validate software written in Nim.
|
||||||
DrNim's command-line options are the same as the Nim compiler's.
|
DrNim's command-line options are the same as the Nim compiler's.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,19 +12,19 @@
|
||||||
|
|
||||||
> "yes, I'm the creator" -- Araq, 2013-07-26 19:28:32.
|
> "yes, I'm the creator" -- Araq, 2013-07-26 19:28:32.
|
||||||
|
|
||||||
Note: this is mostly outdated, see instead `nimsuggest <nimsuggest.html>`_
|
Note: this is mostly outdated, see instead [nimsuggest](nimsuggest.html)
|
||||||
|
|
||||||
Nim differs from many other compilers in that it is really fast,
|
Nim differs from many other compilers in that it is really fast,
|
||||||
and being so fast makes it suited to provide external queries for
|
and being so fast makes it suited to provide external queries for
|
||||||
text editors about the source code being written. Through the
|
text editors about the source code being written. Through the
|
||||||
`idetools` command of `the compiler <nimc.html>`_, any IDE
|
`idetools` command of [the compiler](nimc.html), any IDE
|
||||||
can query a `.nim` source file and obtain useful information like
|
can query a `.nim` source file and obtain useful information like
|
||||||
definition of symbols or suggestions for completion.
|
definition of symbols or suggestions for completion.
|
||||||
|
|
||||||
This document will guide you through the available options. If you
|
This document will guide you through the available options. If you
|
||||||
want to look at practical examples of idetools support you can look
|
want to look at practical examples of idetools support you can look
|
||||||
at the test files found in the `Test suite`_ or `various editor
|
at the test files found in the [Test suite] or [various editor
|
||||||
integrations <https://github.com/Araq/Nim/wiki/Editor-Support>`_
|
integrations](https://github.com/Araq/Nim/wiki/Editor-Support)
|
||||||
already available.
|
already available.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -124,8 +124,8 @@ to the case insensitiveness of the language (plus underscores as
|
||||||
separators!).
|
separators!).
|
||||||
|
|
||||||
The typical usage scenario for this option is to call it after the
|
The typical usage scenario for this option is to call it after the
|
||||||
user has typed the dot character for `the object oriented call
|
user has typed the dot character for [the object oriented call
|
||||||
syntax <tut2.html#object-oriented-programming-method-call-syntax>`_.
|
syntax](tut2.html#object-oriented-programming-method-call-syntax).
|
||||||
Idetools will try to return the suggestions sorted first by scope
|
Idetools will try to return the suggestions sorted first by scope
|
||||||
(from innermost to outermost) and then by item name.
|
(from innermost to outermost) and then by item name.
|
||||||
|
|
||||||
|
|
@ -196,7 +196,7 @@ of text it thinks necessary plus an empty line to indicate the end
|
||||||
of the answer.
|
of the answer.
|
||||||
|
|
||||||
You can find examples of client/server communication in the idetools
|
You can find examples of client/server communication in the idetools
|
||||||
tests found in the `Test suite`_.
|
tests found in the [Test suite].
|
||||||
|
|
||||||
|
|
||||||
Parsing idetools output
|
Parsing idetools output
|
||||||
|
|
@ -367,8 +367,8 @@ defined, since at that point in the file the parser hasn't processed
|
||||||
the full line yet. The signature will be returned complete in
|
the full line yet. The signature will be returned complete in
|
||||||
posterior instances of the method.
|
posterior instances of the method.
|
||||||
|
|
||||||
Methods imply `dynamic dispatch
|
Methods imply [dynamic dispatch](
|
||||||
<tut2.html#object-oriented-programming-dynamic-dispatch>`_ and
|
tut2.html#object-oriented-programming-dynamic-dispatch) and
|
||||||
idetools performs a static analysis on the code. For this reason
|
idetools performs a static analysis on the code. For this reason
|
||||||
idetools may not return the definition of the correct method you
|
idetools may not return the definition of the correct method you
|
||||||
are querying because it may be impossible to know until the code
|
are querying because it may be impossible to know until the code
|
||||||
|
|
@ -590,7 +590,7 @@ All the `tests/caas/*.txt` files encode a session with the compiler:
|
||||||
modes, you can prefix a line with the mode and the line will be
|
modes, you can prefix a line with the mode and the line will be
|
||||||
processed only in that mode.
|
processed only in that mode.
|
||||||
|
|
||||||
* The rest of the line is treated as a `regular expression <re.html>`_,
|
* The rest of the line is treated as a [regular expression](re.html),
|
||||||
so be careful escaping metacharacters like parenthesis.
|
so be careful escaping metacharacters like parenthesis.
|
||||||
|
|
||||||
Before the line is processed as a regular expression, some basic
|
Before the line is processed as a regular expression, some basic
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ And for a debug version compatible with GDB:
|
||||||
|
|
||||||
The `koch`:cmd: program is Nim's maintenance script. It is a replacement for
|
The `koch`:cmd: program is Nim's maintenance script. It is a replacement for
|
||||||
make and shell scripting with the advantage that it is much more portable.
|
make and shell scripting with the advantage that it is much more portable.
|
||||||
More information about its options can be found in the `koch <koch.html>`_
|
More information about its options can be found in the [koch](koch.html)
|
||||||
documentation.
|
documentation.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -105,7 +105,7 @@ current commit:
|
||||||
|
|
||||||
You can also bisect using custom options to build the compiler, for example if
|
You can also bisect using custom options to build the compiler, for example if
|
||||||
you don't need a debug version of the compiler (which runs slower), you can replace
|
you don't need a debug version of the compiler (which runs slower), you can replace
|
||||||
`./koch temp`:cmd: by explicit compilation command, see `Bootstrapping the compiler`_.
|
`./koch temp`:cmd: by explicit compilation command, see [Bootstrapping the compiler].
|
||||||
|
|
||||||
|
|
||||||
Building an instrumented compiler
|
Building an instrumented compiler
|
||||||
|
|
@ -269,7 +269,7 @@ Native debugging
|
||||||
|
|
||||||
Stepping through the compiler with a native debugger is a very powerful tool to
|
Stepping through the compiler with a native debugger is a very powerful tool to
|
||||||
both learn and debug it. However, there is still the need to constrain when
|
both learn and debug it. However, there is still the need to constrain when
|
||||||
breakpoints are triggered. The same methods as in `Debug logging`_ can be applied
|
breakpoints are triggered. The same methods as in [Debug logging] can be applied
|
||||||
here when combined with calls to the debug helpers `enteringDebugSection()`:nim:
|
here when combined with calls to the debug helpers `enteringDebugSection()`:nim:
|
||||||
and `exitingDebugSection()`:nim:.
|
and `exitingDebugSection()`:nim:.
|
||||||
|
|
||||||
|
|
@ -309,7 +309,7 @@ The syntax tree consists of nodes which may have an arbitrary number of
|
||||||
children. Types and symbols are represented by other nodes, because they
|
children. Types and symbols are represented by other nodes, because they
|
||||||
may contain cycles. The AST changes its shape after semantic checking. This
|
may contain cycles. The AST changes its shape after semantic checking. This
|
||||||
is needed to make life easier for the code generators. See the "ast" module
|
is needed to make life easier for the code generators. See the "ast" module
|
||||||
for the type definitions. The `macros <macros.html>`_ module contains many
|
for the type definitions. The [macros](macros.html) module contains many
|
||||||
examples how the AST represents each syntactic structure.
|
examples how the AST represents each syntactic structure.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -324,7 +324,7 @@ ARC/ORC. The new runtime is active `when defined(nimV2)`.
|
||||||
Coding Guidelines
|
Coding Guidelines
|
||||||
=================
|
=================
|
||||||
|
|
||||||
* We follow Nim's official style guide, see `<nep1.html>`_.
|
* We follow Nim's official style guide, see [NEP1](nep1.html).
|
||||||
* Max line length is 100 characters.
|
* Max line length is 100 characters.
|
||||||
* Provide spaces around binary operators if that enhances readability.
|
* Provide spaces around binary operators if that enhances readability.
|
||||||
* Use a space after a colon, but not before it.
|
* Use a space after a colon, but not before it.
|
||||||
|
|
@ -332,7 +332,7 @@ Coding Guidelines
|
||||||
pointers/references which start with `P`.
|
pointers/references which start with `P`.
|
||||||
* Prefer `import package`:nim: over `from package import symbol`:nim:.
|
* Prefer `import package`:nim: over `from package import symbol`:nim:.
|
||||||
|
|
||||||
See also the `API naming design <apis.html>`_ document.
|
See also the [API naming design](apis.html) document.
|
||||||
|
|
||||||
|
|
||||||
Porting to new platforms
|
Porting to new platforms
|
||||||
|
|
@ -452,7 +452,7 @@ could stem from a complex expression:
|
||||||
receivesClosure(returnsDefaultCC[i])
|
receivesClosure(returnsDefaultCC[i])
|
||||||
```
|
```
|
||||||
|
|
||||||
A thunk would need to call 'returnsDefaultCC[i]' somehow and that would require
|
A thunk would need to call `returnsDefaultCC[i]` somehow and that would require
|
||||||
an *additional* closure generation... Ok, not really, but it requires to pass
|
an *additional* closure generation... Ok, not really, but it requires to pass
|
||||||
the function to call. So we'd end up with 2 indirect calls instead of one.
|
the function to call. So we'd end up with 2 indirect calls instead of one.
|
||||||
Another much more severe problem with this solution is that it's not GC-safe
|
Another much more severe problem with this solution is that it's not GC-safe
|
||||||
|
|
|
||||||
10
doc/koch.md
10
doc/koch.md
|
|
@ -48,16 +48,16 @@ csource command
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
The `csource`:idx: command builds the C sources for installation. It accepts
|
The `csource`:idx: command builds the C sources for installation. It accepts
|
||||||
the same options as you would pass to the `boot command
|
the same options as you would pass to the [boot command](
|
||||||
<#commands-boot-command>`_.
|
#commands-boot-command).
|
||||||
|
|
||||||
temp command
|
temp command
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The temp command builds the Nim compiler but with a different final name
|
The temp command builds the Nim compiler but with a different final name
|
||||||
(`nim_temp`:cmd:), so it doesn't overwrite your normal compiler. You can use
|
(`nim_temp`:cmd:), so it doesn't overwrite your normal compiler. You can use
|
||||||
this command to test different options, the same you would issue for the `boot
|
this command to test different options, the same you would issue for the [boot
|
||||||
command <#commands-boot-command>`_.
|
command](#commands-boot-command).
|
||||||
|
|
||||||
test command
|
test command
|
||||||
------------
|
------------
|
||||||
|
|
@ -88,4 +88,4 @@ pdf command
|
||||||
|
|
||||||
The `pdf`:idx: command builds PDF versions of Nim documentation: Manual,
|
The `pdf`:idx: command builds PDF versions of Nim documentation: Manual,
|
||||||
Tutorial and a few other documents. To run it one needs to
|
Tutorial and a few other documents. To run it one needs to
|
||||||
`install Latex/xelatex <https://www.latex-project.org/get>`_ first.
|
[install Latex/xelatex](https://www.latex-project.org/get) first.
|
||||||
|
|
|
||||||
278
doc/lib.md
278
doc/lib.md
|
|
@ -15,14 +15,14 @@ Pure libraries do not depend on any external ``*.dll`` or ``lib*.so`` binary
|
||||||
while impure libraries do. A wrapper is an impure library that is a very
|
while impure libraries do. A wrapper is an impure library that is a very
|
||||||
low-level interface to a C library.
|
low-level interface to a C library.
|
||||||
|
|
||||||
Read this `document <apis.html>`_ for a quick overview of the API design.
|
Read [this document](apis.html) for a quick overview of the API design.
|
||||||
|
|
||||||
|
|
||||||
Nimble
|
Nimble
|
||||||
======
|
======
|
||||||
|
|
||||||
Nim's standard library only covers the basics, check
|
Nim's standard library only covers the basics, check
|
||||||
out `<https://nimble.directory/>`_ for a list of 3rd party packages.
|
out https://nimble.directory/ for a list of 3rd party packages.
|
||||||
|
|
||||||
|
|
||||||
Pure libraries
|
Pure libraries
|
||||||
|
|
@ -31,17 +31,17 @@ Pure libraries
|
||||||
Automatic imports
|
Automatic imports
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
* `system <system.html>`_
|
* [system](system.html)
|
||||||
Basic procs and operators that every program needs. It also provides IO
|
Basic procs and operators that every program needs. It also provides IO
|
||||||
facilities for reading and writing text and binary files. It is imported
|
facilities for reading and writing text and binary files. It is imported
|
||||||
implicitly by the compiler. Do not import it directly. It relies on compiler
|
implicitly by the compiler. Do not import it directly. It relies on compiler
|
||||||
magic to work.
|
magic to work.
|
||||||
|
|
||||||
* `threads <threads.html>`_
|
* [threads](threads.html)
|
||||||
Basic Nim thread support. **Note:** This is part of the system module. Do not
|
Basic Nim thread support. **Note:** This is part of the system module. Do not
|
||||||
import it explicitly. Enabled with `--threads:on`:option:.
|
import it explicitly. Enabled with `--threads:on`:option:.
|
||||||
|
|
||||||
* `channels_builtin <channels_builtin.html>`_
|
* [channels_builtin](channels_builtin.html)
|
||||||
Nim message passing support for threads. **Note:** This is part of the
|
Nim message passing support for threads. **Note:** This is part of the
|
||||||
system module. Do not import it explicitly. Enabled with `--threads:on`:option:.
|
system module. Do not import it explicitly. Enabled with `--threads:on`:option:.
|
||||||
|
|
||||||
|
|
@ -49,40 +49,40 @@ Automatic imports
|
||||||
Core
|
Core
|
||||||
----
|
----
|
||||||
|
|
||||||
* `atomics <atomics.html>`_
|
* [atomics](atomics.html)
|
||||||
Types and operations for atomic operations and lockless algorithms.
|
Types and operations for atomic operations and lockless algorithms.
|
||||||
|
|
||||||
* `bitops <bitops.html>`_
|
* [bitops](bitops.html)
|
||||||
Provides a series of low-level methods for bit manipulation.
|
Provides a series of low-level methods for bit manipulation.
|
||||||
|
|
||||||
* `cpuinfo <cpuinfo.html>`_
|
* [cpuinfo](cpuinfo.html)
|
||||||
This module implements procs to determine the number of CPUs / cores.
|
This module implements procs to determine the number of CPUs / cores.
|
||||||
|
|
||||||
* `endians <endians.html>`_
|
* [endians](endians.html)
|
||||||
This module contains helpers that deal with different byte orders.
|
This module contains helpers that deal with different byte orders.
|
||||||
|
|
||||||
* `lenientops <lenientops.html>`_
|
* [lenientops](lenientops.html)
|
||||||
Provides binary operators for mixed integer/float expressions for convenience.
|
Provides binary operators for mixed integer/float expressions for convenience.
|
||||||
|
|
||||||
* `locks <locks.html>`_
|
* [locks](locks.html)
|
||||||
Locks and condition variables for Nim.
|
Locks and condition variables for Nim.
|
||||||
|
|
||||||
* `macrocache <macrocache.html>`_
|
* [macrocache](macrocache.html)
|
||||||
Provides an API for macros to collect compile-time information across modules.
|
Provides an API for macros to collect compile-time information across modules.
|
||||||
|
|
||||||
* `macros <macros.html>`_
|
* [macros](macros.html)
|
||||||
Contains the AST API and documentation of Nim for writing macros.
|
Contains the AST API and documentation of Nim for writing macros.
|
||||||
|
|
||||||
* `rlocks <rlocks.html>`_
|
* [rlocks](rlocks.html)
|
||||||
Reentrant locks for Nim.
|
Reentrant locks for Nim.
|
||||||
|
|
||||||
* `typeinfo <typeinfo.html>`_
|
* [typeinfo](typeinfo.html)
|
||||||
Provides (unsafe) access to Nim's run-time type information.
|
Provides (unsafe) access to Nim's run-time type information.
|
||||||
|
|
||||||
* `typetraits <typetraits.html>`_
|
* [typetraits](typetraits.html)
|
||||||
This module defines compile-time reflection procs for working with types.
|
This module defines compile-time reflection procs for working with types.
|
||||||
|
|
||||||
* `volatile <volatile.html>`_
|
* [volatile](volatile.html)
|
||||||
This module contains code for generating volatile loads and stores,
|
This module contains code for generating volatile loads and stores,
|
||||||
which are useful in embedded and systems programming.
|
which are useful in embedded and systems programming.
|
||||||
|
|
||||||
|
|
@ -90,169 +90,169 @@ Core
|
||||||
Algorithms
|
Algorithms
|
||||||
----------
|
----------
|
||||||
|
|
||||||
* `algorithm <algorithm.html>`_
|
* [algorithm](algorithm.html)
|
||||||
This module implements some common generic algorithms like sort or binary search.
|
This module implements some common generic algorithms like sort or binary search.
|
||||||
|
|
||||||
* `enumutils <enumutils.html>`_
|
* [enumutils](enumutils.html)
|
||||||
This module adds functionality for the built-in `enum` type.
|
This module adds functionality for the built-in `enum` type.
|
||||||
|
|
||||||
* `sequtils <sequtils.html>`_
|
* [sequtils](sequtils.html)
|
||||||
This module implements operations for the built-in `seq` type
|
This module implements operations for the built-in `seq` type
|
||||||
which were inspired by functional programming languages.
|
which were inspired by functional programming languages.
|
||||||
|
|
||||||
* `setutils <setutils.html>`_
|
* [setutils](setutils.html)
|
||||||
This module adds functionality for the built-in `set` type.
|
This module adds functionality for the built-in `set` type.
|
||||||
|
|
||||||
|
|
||||||
Collections
|
Collections
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
* `critbits <critbits.html>`_
|
* [critbits](critbits.html)
|
||||||
This module implements a *crit bit tree* which is an efficient
|
This module implements a *crit bit tree* which is an efficient
|
||||||
container for a sorted set of strings, or a sorted mapping of strings.
|
container for a sorted set of strings, or a sorted mapping of strings.
|
||||||
|
|
||||||
* `deques <deques.html>`_
|
* [deques](deques.html)
|
||||||
Implementation of a double-ended queue.
|
Implementation of a double-ended queue.
|
||||||
The underlying implementation uses a `seq`.
|
The underlying implementation uses a `seq`.
|
||||||
|
|
||||||
* `heapqueue <heapqueue.html>`_
|
* [heapqueue](heapqueue.html)
|
||||||
Implementation of a binary heap data structure that can be used as a priority queue.
|
Implementation of a binary heap data structure that can be used as a priority queue.
|
||||||
|
|
||||||
* `intsets <intsets.html>`_
|
* [intsets](intsets.html)
|
||||||
Efficient implementation of a set of ints as a sparse bit set.
|
Efficient implementation of a set of ints as a sparse bit set.
|
||||||
|
|
||||||
* `lists <lists.html>`_
|
* [lists](lists.html)
|
||||||
Nim linked list support. Contains singly and doubly linked lists and
|
Nim linked list support. Contains singly and doubly linked lists and
|
||||||
circular lists ("rings").
|
circular lists ("rings").
|
||||||
|
|
||||||
* `options <options.html>`_
|
* [options](options.html)
|
||||||
The option type encapsulates an optional value.
|
The option type encapsulates an optional value.
|
||||||
|
|
||||||
* `packedsets <packedsets.html>`_
|
* [packedsets](packedsets.html)
|
||||||
Efficient implementation of a set of ordinals as a sparse bit set.
|
Efficient implementation of a set of ordinals as a sparse bit set.
|
||||||
|
|
||||||
* `sets <sets.html>`_
|
* [sets](sets.html)
|
||||||
Nim hash set support.
|
Nim hash set support.
|
||||||
|
|
||||||
* `tables <tables.html>`_
|
* [tables](tables.html)
|
||||||
Nim hash table support. Contains tables, ordered tables, and count tables.
|
Nim hash table support. Contains tables, ordered tables, and count tables.
|
||||||
|
|
||||||
|
|
||||||
String handling
|
String handling
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
* `cstrutils <cstrutils.html>`_
|
* [cstrutils](cstrutils.html)
|
||||||
Utilities for `cstring` handling.
|
Utilities for `cstring` handling.
|
||||||
|
|
||||||
* `editdistance <editdistance.html>`_
|
* [editdistance](editdistance.html)
|
||||||
This module contains an algorithm to compute the edit distance between two
|
This module contains an algorithm to compute the edit distance between two
|
||||||
Unicode strings.
|
Unicode strings.
|
||||||
|
|
||||||
* `encodings <encodings.html>`_
|
* [encodings](encodings.html)
|
||||||
Converts between different character encodings. On UNIX, this uses
|
Converts between different character encodings. On UNIX, this uses
|
||||||
the `iconv` library, on Windows the Windows API.
|
the `iconv` library, on Windows the Windows API.
|
||||||
|
|
||||||
* `parseutils <parseutils.html>`_
|
* [parseutils](parseutils.html)
|
||||||
This module contains helpers for parsing tokens, numbers, identifiers, etc.
|
This module contains helpers for parsing tokens, numbers, identifiers, etc.
|
||||||
|
|
||||||
* `pegs <pegs.html>`_
|
* [pegs](pegs.html)
|
||||||
This module contains procedures and operators for handling PEGs.
|
This module contains procedures and operators for handling PEGs.
|
||||||
|
|
||||||
* `punycode <punycode.html>`_
|
* [punycode](punycode.html)
|
||||||
Implements a representation of Unicode with the limited ASCII character subset.
|
Implements a representation of Unicode with the limited ASCII character subset.
|
||||||
|
|
||||||
* `ropes <ropes.html>`_
|
* [ropes](ropes.html)
|
||||||
This module contains support for a *rope* data type.
|
This module contains support for a *rope* data type.
|
||||||
Ropes can represent very long strings efficiently;
|
Ropes can represent very long strings efficiently;
|
||||||
in particular, concatenation is done in O(1) instead of O(n).
|
in particular, concatenation is done in O(1) instead of O(n).
|
||||||
|
|
||||||
* `strbasics <strbasics.html>`_
|
* [strbasics](strbasics.html)
|
||||||
This module provides some high performance string operations.
|
This module provides some high performance string operations.
|
||||||
|
|
||||||
* `strformat <strformat.html>`_
|
* [strformat](strformat.html)
|
||||||
Macro based standard string interpolation/formatting. Inspired by
|
Macro based standard string interpolation/formatting. Inspired by
|
||||||
Python's f-strings.
|
Python's f-strings.
|
||||||
|
|
||||||
* `strmisc <strmisc.html>`_
|
* [strmisc](strmisc.html)
|
||||||
This module contains uncommon string handling operations that do not
|
This module contains uncommon string handling operations that do not
|
||||||
fit with the commonly used operations in strutils.
|
fit with the commonly used operations in strutils.
|
||||||
|
|
||||||
* `strscans <strscans.html>`_
|
* [strscans](strscans.html)
|
||||||
This module contains a `scanf` macro for convenient parsing of mini languages.
|
This module contains a `scanf` macro for convenient parsing of mini languages.
|
||||||
|
|
||||||
* `strtabs <strtabs.html>`_
|
* [strtabs](strtabs.html)
|
||||||
The `strtabs` module implements an efficient hash table that is a mapping
|
The `strtabs` module implements an efficient hash table that is a mapping
|
||||||
from strings to strings. Supports a case-sensitive, case-insensitive and
|
from strings to strings. Supports a case-sensitive, case-insensitive and
|
||||||
style-insensitive modes.
|
style-insensitive modes.
|
||||||
|
|
||||||
* `strutils <strutils.html>`_
|
* [strutils](strutils.html)
|
||||||
This module contains common string handling operations like changing
|
This module contains common string handling operations like changing
|
||||||
case of a string, splitting a string into substrings, searching for
|
case of a string, splitting a string into substrings, searching for
|
||||||
substrings, replacing substrings.
|
substrings, replacing substrings.
|
||||||
|
|
||||||
* `unicode <unicode.html>`_
|
* [unicode](unicode.html)
|
||||||
This module provides support to handle the Unicode UTF-8 encoding.
|
This module provides support to handle the Unicode UTF-8 encoding.
|
||||||
|
|
||||||
* `unidecode <unidecode.html>`_
|
* [unidecode](unidecode.html)
|
||||||
It provides a single proc that does Unicode to ASCII transliterations.
|
It provides a single proc that does Unicode to ASCII transliterations.
|
||||||
Based on Python's Unidecode module.
|
Based on Python's Unidecode module.
|
||||||
|
|
||||||
* `wordwrap <wordwrap.html>`_
|
* [wordwrap](wordwrap.html)
|
||||||
This module contains an algorithm to wordwrap a Unicode string.
|
This module contains an algorithm to wordwrap a Unicode string.
|
||||||
|
|
||||||
|
|
||||||
Time handling
|
Time handling
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
* `monotimes <monotimes.html>`_
|
* [monotimes](monotimes.html)
|
||||||
The `monotimes` module implements monotonic timestamps.
|
The `monotimes` module implements monotonic timestamps.
|
||||||
|
|
||||||
* `times <times.html>`_
|
* [times](times.html)
|
||||||
The `times` module contains support for working with time.
|
The `times` module contains support for working with time.
|
||||||
|
|
||||||
|
|
||||||
Generic Operating System Services
|
Generic Operating System Services
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
* `distros <distros.html>`_
|
* [distros](distros.html)
|
||||||
This module implements the basics for OS distribution ("distro") detection
|
This module implements the basics for OS distribution ("distro") detection
|
||||||
and the OS's native package manager.
|
and the OS's native package manager.
|
||||||
Its primary purpose is to produce output for Nimble packages,
|
Its primary purpose is to produce output for Nimble packages,
|
||||||
but it also contains the widely used **Distribution** enum
|
but it also contains the widely used **Distribution** enum
|
||||||
that is useful for writing platform-specific code.
|
that is useful for writing platform-specific code.
|
||||||
See `packaging <packaging.html>`_ for hints on distributing Nim using OS packages.
|
See [packaging](packaging.html) for hints on distributing Nim using OS packages.
|
||||||
|
|
||||||
* `dynlib <dynlib.html>`_
|
* [dynlib](dynlib.html)
|
||||||
This module implements the ability to access symbols from shared libraries.
|
This module implements the ability to access symbols from shared libraries.
|
||||||
|
|
||||||
* `marshal <marshal.html>`_
|
* [marshal](marshal.html)
|
||||||
Contains procs for serialization and deserialization of arbitrary Nim
|
Contains procs for serialization and deserialization of arbitrary Nim
|
||||||
data structures.
|
data structures.
|
||||||
|
|
||||||
* `memfiles <memfiles.html>`_
|
* [memfiles](memfiles.html)
|
||||||
This module provides support for memory-mapped files (Posix's `mmap`)
|
This module provides support for memory-mapped files (Posix's `mmap`)
|
||||||
on the different operating systems.
|
on the different operating systems.
|
||||||
|
|
||||||
* `os <os.html>`_
|
* [os](os.html)
|
||||||
Basic operating system facilities like retrieving environment variables,
|
Basic operating system facilities like retrieving environment variables,
|
||||||
reading command line arguments, working with directories, running shell
|
reading command line arguments, working with directories, running shell
|
||||||
commands, etc.
|
commands, etc.
|
||||||
|
|
||||||
* `osproc <osproc.html>`_
|
* [osproc](osproc.html)
|
||||||
Module for process communication beyond `os.execShellCmd`.
|
Module for process communication beyond `os.execShellCmd`.
|
||||||
|
|
||||||
* `streams <streams.html>`_
|
* [streams](streams.html)
|
||||||
This module provides a stream interface and two implementations thereof:
|
This module provides a stream interface and two implementations thereof:
|
||||||
the `FileStream` and the `StringStream` which implement the stream
|
the `FileStream` and the `StringStream` which implement the stream
|
||||||
interface for Nim file objects (`File`) and strings. Other modules
|
interface for Nim file objects (`File`) and strings. Other modules
|
||||||
may provide other implementations for this standard stream interface.
|
may provide other implementations for this standard stream interface.
|
||||||
|
|
||||||
* `terminal <terminal.html>`_
|
* [terminal](terminal.html)
|
||||||
This module contains a few procedures to control the *terminal*
|
This module contains a few procedures to control the *terminal*
|
||||||
(also called *console*). The implementation simply uses ANSI escape
|
(also called *console*). The implementation simply uses ANSI escape
|
||||||
sequences and does not depend on any other module.
|
sequences and does not depend on any other module.
|
||||||
|
|
||||||
* `tempfiles <tempfiles.html>`_
|
* [tempfiles](tempfiles.html)
|
||||||
This module provides some utils to generate temporary path names and
|
This module provides some utils to generate temporary path names and
|
||||||
create temporary files and directories.
|
create temporary files and directories.
|
||||||
|
|
||||||
|
|
@ -260,131 +260,131 @@ Generic Operating System Services
|
||||||
Math libraries
|
Math libraries
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
* `complex <complex.html>`_
|
* [complex](complex.html)
|
||||||
This module implements complex numbers and relevant mathematical operations.
|
This module implements complex numbers and relevant mathematical operations.
|
||||||
|
|
||||||
* `fenv <fenv.html>`_
|
* [fenv](fenv.html)
|
||||||
Floating-point environment. Handling of floating-point rounding and
|
Floating-point environment. Handling of floating-point rounding and
|
||||||
exceptions (overflow, zero-divide, etc.).
|
exceptions (overflow, zero-divide, etc.).
|
||||||
|
|
||||||
* `math <math.html>`_
|
* [math](math.html)
|
||||||
Mathematical operations like cosine, square root.
|
Mathematical operations like cosine, square root.
|
||||||
|
|
||||||
* `random <random.html>`_
|
* [random](random.html)
|
||||||
Fast and tiny random number generator.
|
Fast and tiny random number generator.
|
||||||
|
|
||||||
* `rationals <rationals.html>`_
|
* [rationals](rationals.html)
|
||||||
This module implements rational numbers and relevant mathematical operations.
|
This module implements rational numbers and relevant mathematical operations.
|
||||||
|
|
||||||
* `stats <stats.html>`_
|
* [stats](stats.html)
|
||||||
Statistical analysis.
|
Statistical analysis.
|
||||||
|
|
||||||
* `sums <sums.html>`_
|
* [sums](sums.html)
|
||||||
Accurate summation functions.
|
Accurate summation functions.
|
||||||
|
|
||||||
* `sysrand <sysrand.html>`_
|
* [sysrand](sysrand.html)
|
||||||
Cryptographically secure pseudorandom number generator.
|
Cryptographically secure pseudorandom number generator.
|
||||||
|
|
||||||
|
|
||||||
Internet Protocols and Support
|
Internet Protocols and Support
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
* `asyncdispatch <asyncdispatch.html>`_
|
* [asyncdispatch](asyncdispatch.html)
|
||||||
This module implements an asynchronous dispatcher for IO operations.
|
This module implements an asynchronous dispatcher for IO operations.
|
||||||
|
|
||||||
* `asyncfile <asyncfile.html>`_
|
* [asyncfile](asyncfile.html)
|
||||||
This module implements asynchronous file reading and writing using
|
This module implements asynchronous file reading and writing using
|
||||||
`asyncdispatch`.
|
`asyncdispatch`.
|
||||||
|
|
||||||
* `asyncftpclient <asyncftpclient.html>`_
|
* `asyncftpclient](asyncftpclient.html)
|
||||||
This module implements an asynchronous FTP client using the `asyncnet`
|
[his module implements an asynchronous FTP client using the `asyncnet`
|
||||||
module.
|
module.
|
||||||
|
|
||||||
* `asynchttpserver <asynchttpserver.html>`_
|
* `asynchttpserver](asynchttpserver.html)
|
||||||
This module implements an asynchronous HTTP server using the `asyncnet`
|
[his module implements an asynchronous HTTP server using the `asyncnet`
|
||||||
module.
|
module.
|
||||||
|
|
||||||
* `asyncnet <asyncnet.html>`_
|
* [asyncnet](asyncnet.html)
|
||||||
This module implements asynchronous sockets based on the `asyncdispatch`
|
This module implements asynchronous sockets based on the `asyncdispatch`
|
||||||
module.
|
module.
|
||||||
|
|
||||||
* `asyncstreams <asyncstreams.html>`_
|
* [asyncstreams](asyncstreams.html)
|
||||||
This module provides `FutureStream` - a future that acts as a queue.
|
This module provides `FutureStream` - a future that acts as a queue.
|
||||||
|
|
||||||
* `cgi <cgi.html>`_
|
* [cgi](cgi.html)
|
||||||
This module implements helpers for CGI applications.
|
This module implements helpers for CGI applications.
|
||||||
|
|
||||||
* `cookies <cookies.html>`_
|
* [cookies](cookies.html)
|
||||||
This module contains helper procs for parsing and generating cookies.
|
This module contains helper procs for parsing and generating cookies.
|
||||||
|
|
||||||
* `httpclient <httpclient.html>`_
|
* [httpclient](httpclient.html)
|
||||||
This module implements a simple HTTP client which supports both synchronous
|
This module implements a simple HTTP client which supports both synchronous
|
||||||
and asynchronous retrieval of web pages.
|
and asynchronous retrieval of web pages.
|
||||||
|
|
||||||
* `mimetypes <mimetypes.html>`_
|
* [mimetypes](mimetypes.html)
|
||||||
This module implements a mimetypes database.
|
This module implements a mimetypes database.
|
||||||
|
|
||||||
* `nativesockets <nativesockets.html>`_
|
* [nativesockets](nativesockets.html)
|
||||||
This module implements a low-level sockets API.
|
This module implements a low-level sockets API.
|
||||||
|
|
||||||
* `net <net.html>`_
|
* [net](net.html)
|
||||||
This module implements a high-level sockets API. It replaces the
|
This module implements a high-level sockets API. It replaces the
|
||||||
`sockets` module.
|
`sockets` module.
|
||||||
|
|
||||||
* `selectors <selectors.html>`_
|
* [selectors](selectors.html)
|
||||||
This module implements a selector API with backends specific to each OS.
|
This module implements a selector API with backends specific to each OS.
|
||||||
Currently, epoll on Linux and select on other operating systems.
|
Currently, epoll on Linux and select on other operating systems.
|
||||||
|
|
||||||
* `smtp <smtp.html>`_
|
* [smtp](smtp.html)
|
||||||
This module implements a simple SMTP client.
|
This module implements a simple SMTP client.
|
||||||
|
|
||||||
* `uri <uri.html>`_
|
* [uri](uri.html)
|
||||||
This module provides functions for working with URIs.
|
This module provides functions for working with URIs.
|
||||||
|
|
||||||
|
|
||||||
Threading
|
Threading
|
||||||
---------
|
---------
|
||||||
|
|
||||||
* `threadpool <threadpool.html>`_
|
* [threadpool](threadpool.html)
|
||||||
Implements Nim's `spawn <manual_experimental.html#parallel-amp-spawn>`_.
|
Implements Nim's [spawn](manual_experimental.html#parallel-amp-spawn).
|
||||||
|
|
||||||
|
|
||||||
Parsers
|
Parsers
|
||||||
-------
|
-------
|
||||||
|
|
||||||
* `htmlparser <htmlparser.html>`_
|
* [htmlparser](htmlparser.html)
|
||||||
This module parses an HTML document and creates its XML tree representation.
|
This module parses an HTML document and creates its XML tree representation.
|
||||||
|
|
||||||
* `json <json.html>`_
|
* [json](json.html)
|
||||||
High-performance JSON parser.
|
High-performance JSON parser.
|
||||||
|
|
||||||
* `jsonutils <jsonutils.html>`_
|
* [jsonutils](jsonutils.html)
|
||||||
This module implements a hookable (de)serialization for arbitrary types.
|
This module implements a hookable (de)serialization for arbitrary types.
|
||||||
|
|
||||||
* `lexbase <lexbase.html>`_
|
* [lexbase](lexbase.html)
|
||||||
This is a low-level module that implements an extremely efficient buffering
|
This is a low-level module that implements an extremely efficient buffering
|
||||||
scheme for lexers and parsers. This is used by the diverse parsing modules.
|
scheme for lexers and parsers. This is used by the diverse parsing modules.
|
||||||
|
|
||||||
* `parsecfg <parsecfg.html>`_
|
* [parsecfg](parsecfg.html)
|
||||||
The `parsecfg` module implements a high-performance configuration file
|
The `parsecfg` module implements a high-performance configuration file
|
||||||
parser. The configuration file's syntax is similar to the Windows ``.ini``
|
parser. The configuration file's syntax is similar to the Windows ``.ini``
|
||||||
format, but much more powerful, as it is not a line based parser. String
|
format, but much more powerful, as it is not a line based parser. String
|
||||||
literals, raw string literals, and triple quote string literals are supported
|
literals, raw string literals, and triple quote string literals are supported
|
||||||
as in the Nim programming language.
|
as in the Nim programming language.
|
||||||
|
|
||||||
* `parsecsv <parsecsv.html>`_
|
* [parsecsv](parsecsv.html)
|
||||||
The `parsecsv` module implements a simple high-performance CSV parser.
|
The `parsecsv` module implements a simple high-performance CSV parser.
|
||||||
|
|
||||||
* `parsejson <parsejson.html>`_
|
* [parsejson](parsejson.html)
|
||||||
This module implements a JSON parser. It is used and exported by the `json <json.html>`_ module, but can also be used in its own right.
|
This module implements a JSON parser. It is used and exported by the [json](json.html) module, but can also be used in its own right.
|
||||||
|
|
||||||
* `parseopt <parseopt.html>`_
|
* [parseopt](parseopt.html)
|
||||||
The `parseopt` module implements a command line option parser.
|
The `parseopt` module implements a command line option parser.
|
||||||
|
|
||||||
* `parsesql <parsesql.html>`_
|
* [parsesql](parsesql.html)
|
||||||
The `parsesql` module implements a simple high-performance SQL parser.
|
The `parsesql` module implements a simple high-performance SQL parser.
|
||||||
|
|
||||||
* `parsexml <parsexml.html>`_
|
* [parsexml](parsexml.html)
|
||||||
The `parsexml` module implements a simple high performance XML/HTML parser.
|
The `parsexml` module implements a simple high performance XML/HTML parser.
|
||||||
The only encoding that is supported is UTF-8. The parser has been designed
|
The only encoding that is supported is UTF-8. The parser has been designed
|
||||||
to be somewhat error-correcting, so that even some "wild HTML" found on the
|
to be somewhat error-correcting, so that even some "wild HTML" found on the
|
||||||
|
|
@ -394,37 +394,37 @@ Parsers
|
||||||
Docutils
|
Docutils
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* `packages/docutils/highlite <highlite.html>`_
|
* [packages/docutils/highlite](highlite.html)
|
||||||
Source highlighter for programming or markup languages. Currently,
|
Source highlighter for programming or markup languages. Currently,
|
||||||
only a few languages are supported, other languages may be added.
|
only a few languages are supported, other languages may be added.
|
||||||
The interface supports one language nested in another.
|
The interface supports one language nested in another.
|
||||||
|
|
||||||
* `packages/docutils/rst <rst.html>`_
|
* [packages/docutils/rst](rst.html)
|
||||||
This module implements a reStructuredText parser. A large subset
|
This module implements a reStructuredText parser. A large subset
|
||||||
is implemented. Some features of the markdown wiki syntax are also supported.
|
is implemented. Some features of the markdown wiki syntax are also supported.
|
||||||
|
|
||||||
* `packages/docutils/rstast <rstast.html>`_
|
* [packages/docutils/rstast](rstast.html)
|
||||||
This module implements an AST for the reStructuredText parser.
|
This module implements an AST for the reStructuredText parser.
|
||||||
|
|
||||||
* `packages/docutils/rstgen <rstgen.html>`_
|
* [packages/docutils/rstgen](rstgen.html)
|
||||||
This module implements a generator of HTML/Latex from reStructuredText.
|
This module implements a generator of HTML/Latex from reStructuredText.
|
||||||
|
|
||||||
|
|
||||||
XML Processing
|
XML Processing
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
* `xmltree <xmltree.html>`_
|
* [xmltree](xmltree.html)
|
||||||
A simple XML tree. More efficient and simpler than the DOM. It also
|
A simple XML tree. More efficient and simpler than the DOM. It also
|
||||||
contains a macro for XML/HTML code generation.
|
contains a macro for XML/HTML code generation.
|
||||||
|
|
||||||
* `xmlparser <xmlparser.html>`_
|
* [xmlparser](xmlparser.html)
|
||||||
This module parses an XML document and creates its XML tree representation.
|
This module parses an XML document and creates its XML tree representation.
|
||||||
|
|
||||||
|
|
||||||
Generators
|
Generators
|
||||||
----------
|
----------
|
||||||
|
|
||||||
* `htmlgen <htmlgen.html>`_
|
* [htmlgen](htmlgen.html)
|
||||||
This module implements a simple XML and HTML code
|
This module implements a simple XML and HTML code
|
||||||
generator. Each commonly used HTML tag has a corresponding macro
|
generator. Each commonly used HTML tag has a corresponding macro
|
||||||
that generates a string with its HTML representation.
|
that generates a string with its HTML representation.
|
||||||
|
|
@ -433,81 +433,81 @@ Generators
|
||||||
Hashing
|
Hashing
|
||||||
-------
|
-------
|
||||||
|
|
||||||
* `base64 <base64.html>`_
|
* [base64](base64.html)
|
||||||
This module implements a Base64 encoder and decoder.
|
This module implements a Base64 encoder and decoder.
|
||||||
|
|
||||||
* `hashes <hashes.html>`_
|
* [hashes](hashes.html)
|
||||||
This module implements efficient computations of hash values for diverse
|
This module implements efficient computations of hash values for diverse
|
||||||
Nim types.
|
Nim types.
|
||||||
|
|
||||||
* `md5 <md5.html>`_
|
* [md5](md5.html)
|
||||||
This module implements the MD5 checksum algorithm.
|
This module implements the MD5 checksum algorithm.
|
||||||
|
|
||||||
* `oids <oids.html>`_
|
* [oids](oids.html)
|
||||||
An OID is a global ID that consists of a timestamp,
|
An OID is a global ID that consists of a timestamp,
|
||||||
a unique counter, and a random value. This combination should suffice to
|
a unique counter, and a random value. This combination should suffice to
|
||||||
produce a globally distributed unique ID. This implementation was extracted
|
produce a globally distributed unique ID. This implementation was extracted
|
||||||
from the MongoDB interface and it thus binary compatible with a MongoDB OID.
|
from the MongoDB interface and it thus binary compatible with a MongoDB OID.
|
||||||
|
|
||||||
* `sha1 <sha1.html>`_
|
* [sha1](sha1.html)
|
||||||
This module implements the SHA-1 checksum algorithm.
|
This module implements the SHA-1 checksum algorithm.
|
||||||
|
|
||||||
|
|
||||||
Miscellaneous
|
Miscellaneous
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
* `browsers <browsers.html>`_
|
* [browsers](browsers.html)
|
||||||
This module implements procs for opening URLs with the user's default
|
This module implements procs for opening URLs with the user's default
|
||||||
browser.
|
browser.
|
||||||
|
|
||||||
* `colors <colors.html>`_
|
* [colors](colors.html)
|
||||||
This module implements color handling for Nim.
|
This module implements color handling for Nim.
|
||||||
|
|
||||||
* `coro <coro.html>`_
|
* [coro](coro.html)
|
||||||
This module implements experimental coroutines in Nim.
|
This module implements experimental coroutines in Nim.
|
||||||
|
|
||||||
* `enumerate <enumerate.html>`_
|
* [enumerate](enumerate.html)
|
||||||
This module implements `enumerate` syntactic sugar based on Nim's macro system.
|
This module implements `enumerate` syntactic sugar based on Nim's macro system.
|
||||||
|
|
||||||
* `logging <logging.html>`_
|
* [logging](logging.html)
|
||||||
This module implements a simple logger.
|
This module implements a simple logger.
|
||||||
|
|
||||||
* `segfaults <segfaults.html>`_
|
* [segfaults](segfaults.html)
|
||||||
Turns access violations or segfaults into a `NilAccessDefect` exception.
|
Turns access violations or segfaults into a `NilAccessDefect` exception.
|
||||||
|
|
||||||
* `sugar <sugar.html>`_
|
* [sugar](sugar.html)
|
||||||
This module implements nice syntactic sugar based on Nim's macro system.
|
This module implements nice syntactic sugar based on Nim's macro system.
|
||||||
|
|
||||||
* `unittest <unittest.html>`_
|
* [unittest](unittest.html)
|
||||||
Implements a Unit testing DSL.
|
Implements a Unit testing DSL.
|
||||||
|
|
||||||
* `varints <varints.html>`_
|
* [varints](varints.html)
|
||||||
Decode variable-length integers that are compatible with SQLite.
|
Decode variable-length integers that are compatible with SQLite.
|
||||||
|
|
||||||
* `with <with.html>`_
|
* [with](with.html)
|
||||||
This module implements the `with` macro for easy function chaining.
|
This module implements the `with` macro for easy function chaining.
|
||||||
|
|
||||||
|
|
||||||
Modules for the JS backend
|
Modules for the JS backend
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
* `asyncjs <asyncjs.html>`_
|
* [asyncjs](asyncjs.html)
|
||||||
Types and macros for writing asynchronous procedures in JavaScript.
|
Types and macros for writing asynchronous procedures in JavaScript.
|
||||||
|
|
||||||
* `dom <dom.html>`_
|
* [dom](dom.html)
|
||||||
Declaration of the Document Object Model for the JS backend.
|
Declaration of the Document Object Model for the JS backend.
|
||||||
|
|
||||||
* `jsbigints <jsbigints.html>`_
|
* [jsbigints](jsbigints.html)
|
||||||
Arbitrary precision integers.
|
Arbitrary precision integers.
|
||||||
|
|
||||||
* `jsconsole <jsconsole.html>`_
|
* [jsconsole](jsconsole.html)
|
||||||
Wrapper for the `console` object.
|
Wrapper for the `console` object.
|
||||||
|
|
||||||
* `jscore <jscore.html>`_
|
* [jscore](jscore.html)
|
||||||
The wrapper of core JavaScript functions. For most purposes, you should be using
|
The wrapper of core JavaScript functions. For most purposes, you should be using
|
||||||
the `math`, `json`, and `times` stdlib modules instead of this module.
|
the `math`, `json`, and `times` stdlib modules instead of this module.
|
||||||
|
|
||||||
* `jsffi <jsffi.html>`_
|
* [jsffi](jsffi.html)
|
||||||
Types and macros for easier interaction with JavaScript.
|
Types and macros for easier interaction with JavaScript.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -517,7 +517,7 @@ Impure libraries
|
||||||
Regular expressions
|
Regular expressions
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
* `re <re.html>`_
|
* [re](re.html)
|
||||||
This module contains procedures and operators for handling regular
|
This module contains procedures and operators for handling regular
|
||||||
expressions. The current implementation uses PCRE.
|
expressions. The current implementation uses PCRE.
|
||||||
|
|
||||||
|
|
@ -525,15 +525,15 @@ Regular expressions
|
||||||
Database support
|
Database support
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
* `db_postgres <db_postgres.html>`_
|
* [db_postgres](db_postgres.html)
|
||||||
A higher level PostgreSQL database wrapper. The same interface is implemented
|
A higher level PostgreSQL database wrapper. The same interface is implemented
|
||||||
for other databases too.
|
for other databases too.
|
||||||
|
|
||||||
* `db_mysql <db_mysql.html>`_
|
* [db_mysql](db_mysql.html)
|
||||||
A higher level MySQL database wrapper. The same interface is implemented
|
A higher level MySQL database wrapper. The same interface is implemented
|
||||||
for other databases too.
|
for other databases too.
|
||||||
|
|
||||||
* `db_sqlite <db_sqlite.html>`_
|
* [db_sqlite](db_sqlite.html)
|
||||||
A higher level SQLite database wrapper. The same interface is implemented
|
A higher level SQLite database wrapper. The same interface is implemented
|
||||||
for other databases too.
|
for other databases too.
|
||||||
|
|
||||||
|
|
@ -541,7 +541,7 @@ Database support
|
||||||
Generic Operating System Services
|
Generic Operating System Services
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
* `rdstdin <rdstdin.html>`_
|
* [rdstdin](rdstdin.html)
|
||||||
This module contains code for reading from stdin.
|
This module contains code for reading from stdin.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -555,43 +555,43 @@ not contained in the distribution. You can then find them on the website.
|
||||||
Windows-specific
|
Windows-specific
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
* `winlean <winlean.html>`_
|
* [winlean](winlean.html)
|
||||||
Contains a wrapper for a small subset of the Win32 API.
|
Contains a wrapper for a small subset of the Win32 API.
|
||||||
* `registry <registry.html>`_
|
* [registry](registry.html)
|
||||||
Windows registry support.
|
Windows registry support.
|
||||||
|
|
||||||
|
|
||||||
UNIX specific
|
UNIX specific
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
* `posix <posix.html>`_
|
* [posix](posix.html)
|
||||||
Contains a wrapper for the POSIX standard.
|
Contains a wrapper for the POSIX standard.
|
||||||
* `posix_utils <posix_utils.html>`_
|
* [posix_utils](posix_utils.html)
|
||||||
Contains helpers for the POSIX standard or specialized for Linux and BSDs.
|
Contains helpers for the POSIX standard or specialized for Linux and BSDs.
|
||||||
|
|
||||||
|
|
||||||
Regular expressions
|
Regular expressions
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
* `pcre <pcre.html>`_
|
* [pcre](pcre.html)
|
||||||
Wrapper for the PCRE library.
|
Wrapper for the PCRE library.
|
||||||
|
|
||||||
|
|
||||||
Database support
|
Database support
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
* `postgres <postgres.html>`_
|
* [postgres](postgres.html)
|
||||||
Contains a wrapper for the PostgreSQL API.
|
Contains a wrapper for the PostgreSQL API.
|
||||||
* `mysql <mysql.html>`_
|
* [mysql](mysql.html)
|
||||||
Contains a wrapper for the mySQL API.
|
Contains a wrapper for the mySQL API.
|
||||||
* `sqlite3 <sqlite3.html>`_
|
* [sqlite3](sqlite3.html)
|
||||||
Contains a wrapper for the SQLite 3 API.
|
Contains a wrapper for the SQLite 3 API.
|
||||||
* `odbcsql <odbcsql.html>`_
|
* [odbcsql](odbcsql.html)
|
||||||
interface to the ODBC driver.
|
interface to the ODBC driver.
|
||||||
|
|
||||||
|
|
||||||
Network Programming and Internet Protocols
|
Network Programming and Internet Protocols
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
* `openssl <openssl.html>`_
|
* [openssl](openssl.html)
|
||||||
Wrapper for OpenSSL.
|
Wrapper for OpenSSL.
|
||||||
|
|
|
||||||
10
doc/mm.md
10
doc/mm.md
|
|
@ -35,7 +35,7 @@ the involved heap sizes.
|
||||||
|
|
||||||
The reference counting operations (= "RC ops") do not use atomic instructions and do not have to --
|
The reference counting operations (= "RC ops") do not use atomic instructions and do not have to --
|
||||||
instead entire subgraphs are *moved* between threads. The Nim compiler also aggressively
|
instead entire subgraphs are *moved* between threads. The Nim compiler also aggressively
|
||||||
optimizes away RC ops and exploits `move semantics <destructors.html#move-semantics>`_.
|
optimizes away RC ops and exploits [move semantics](destructors.html#move-semantics).
|
||||||
|
|
||||||
Nim performs a fair share of optimizations for ARC/ORC; you can inspect what it did
|
Nim performs a fair share of optimizations for ARC/ORC; you can inspect what it did
|
||||||
to your time critical function via `--expandArc:functionName`.
|
to your time critical function via `--expandArc:functionName`.
|
||||||
|
|
@ -62,7 +62,7 @@ Other MM modes
|
||||||
--mm:refc This is the default memory management strategy. It's a
|
--mm:refc This is the default memory management strategy. It's a
|
||||||
deferred reference counting based garbage collector
|
deferred reference counting based garbage collector
|
||||||
with a simple Mark&Sweep backup GC in order to collect cycles. Heaps are thread-local.
|
with a simple Mark&Sweep backup GC in order to collect cycles. Heaps are thread-local.
|
||||||
`This document <refc.html>`_ contains further information.
|
[This document](refc.html) contains further information.
|
||||||
--mm:markAndSweep Simple Mark-And-Sweep based garbage collector.
|
--mm:markAndSweep Simple Mark-And-Sweep based garbage collector.
|
||||||
Heaps are thread-local.
|
Heaps are thread-local.
|
||||||
--mm:boehm Boehm based garbage collector, it offers a shared heap.
|
--mm:boehm Boehm based garbage collector, it offers a shared heap.
|
||||||
|
|
@ -89,7 +89,7 @@ None Manual Manual Manual `--mm:none`
|
||||||
.. default-role:: code
|
.. default-role:: code
|
||||||
.. include:: rstcommon.rst
|
.. include:: rstcommon.rst
|
||||||
|
|
||||||
JavaScript's garbage collector is used for the `JavaScript and NodeJS
|
JavaScript's garbage collector is used for the [JavaScript and NodeJS](
|
||||||
<backends.html#backends-the-javascript-target>`_ compilation targets.
|
backends.html#backends-the-javascript-target) compilation targets.
|
||||||
The `NimScript <nims.html>`_ target uses the memory management strategy built into
|
The [NimScript](nims.html) target uses the memory management strategy built into
|
||||||
the Nim compiler.
|
the Nim compiler.
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ library should follow.
|
||||||
Note that there can be exceptions to these rules. Nim being as flexible as it
|
Note that there can be exceptions to these rules. Nim being as flexible as it
|
||||||
is, there will be parts of this style guide that don't make sense in certain
|
is, there will be parts of this style guide that don't make sense in certain
|
||||||
contexts. Furthermore, just as
|
contexts. Furthermore, just as
|
||||||
`Python's style guide<http://legacy.python.org/dev/peps/pep-0008/>`_ changes
|
[Python's style guide](http://legacy.python.org/dev/peps/pep-0008/) changes
|
||||||
over time, this style guide will too.
|
over time, this style guide will too.
|
||||||
|
|
||||||
These rules will only be enforced for contributions to the Nim
|
These rules will only be enforced for contributions to the Nim
|
||||||
|
|
|
||||||
50
doc/nimc.md
50
doc/nimc.md
|
|
@ -21,10 +21,10 @@ Introduction
|
||||||
|
|
||||||
This document describes the usage of the *Nim compiler*
|
This document describes the usage of the *Nim compiler*
|
||||||
on the different supported platforms. It is not a definition of the Nim
|
on the different supported platforms. It is not a definition of the Nim
|
||||||
programming language (which is covered in the `manual <manual.html>`_).
|
programming language (which is covered in the [manual](manual.html)).
|
||||||
|
|
||||||
Nim is free software; it is licensed under the
|
Nim is free software; it is licensed under the
|
||||||
`MIT License <http://www.opensource.org/licenses/mit-license.php>`_.
|
[MIT License](http://www.opensource.org/licenses/mit-license.php).
|
||||||
|
|
||||||
|
|
||||||
Compiler Usage
|
Compiler Usage
|
||||||
|
|
@ -130,13 +130,13 @@ Level Description
|
||||||
===== ============================================
|
===== ============================================
|
||||||
0 Minimal output level for the compiler.
|
0 Minimal output level for the compiler.
|
||||||
1 Displays compilation of all the compiled files, including those imported
|
1 Displays compilation of all the compiled files, including those imported
|
||||||
by other modules or through the `compile pragma
|
by other modules or through the [compile pragma](
|
||||||
<manual.html#implementation-specific-pragmas-compile-pragma>`_.
|
manual.html#implementation-specific-pragmas-compile-pragma).
|
||||||
This is the default level.
|
This is the default level.
|
||||||
2 Displays compilation statistics, enumerates the dynamic
|
2 Displays compilation statistics, enumerates the dynamic
|
||||||
libraries that will be loaded by the final binary, and dumps to
|
libraries that will be loaded by the final binary, and dumps to
|
||||||
standard output the result of applying `a filter to the source code
|
standard output the result of applying [a filter to the source code](
|
||||||
<filters.html>`_ if any filter was used during compilation.
|
filters.html) if any filter was used during compilation.
|
||||||
3 In addition to the previous levels dumps a debug stack trace
|
3 In addition to the previous levels dumps a debug stack trace
|
||||||
for compiler developers.
|
for compiler developers.
|
||||||
===== ============================================
|
===== ============================================
|
||||||
|
|
@ -147,16 +147,16 @@ Compile-time symbols
|
||||||
|
|
||||||
Through the `-d:x`:option: or `--define:x`:option: switch you can define compile-time
|
Through the `-d:x`:option: or `--define:x`:option: switch you can define compile-time
|
||||||
symbols for conditional compilation. The defined switches can be checked in
|
symbols for conditional compilation. The defined switches can be checked in
|
||||||
source code with the `when statement
|
source code with the [when statement](
|
||||||
<manual.html#statements-and-expressions-when-statement>`_ and
|
manual.html#statements-and-expressions-when-statement) and
|
||||||
`defined proc <system.html#defined,untyped>`_. The typical use of this switch is
|
[defined proc](system.html#defined,untyped). The typical use of this switch is
|
||||||
to enable builds in release mode (`-d:release`:option:) where optimizations are
|
to enable builds in release mode (`-d:release`:option:) where optimizations are
|
||||||
enabled for better performance. Another common use is the `-d:ssl`:option: switch to
|
enabled for better performance. Another common use is the `-d:ssl`:option: switch to
|
||||||
activate SSL sockets.
|
activate SSL sockets.
|
||||||
|
|
||||||
Additionally, you may pass a value along with the symbol: `-d:x=y`:option:
|
Additionally, you may pass a value along with the symbol: `-d:x=y`:option:
|
||||||
which may be used in conjunction with the `compile-time define
|
which may be used in conjunction with the [compile-time define
|
||||||
pragmas<manual.html#implementation-specific-pragmas-compileminustime-define-pragmas>`_
|
pragmas](manual.html#implementation-specific-pragmas-compileminustime-define-pragmas)
|
||||||
to override symbols during build time.
|
to override symbols during build time.
|
||||||
|
|
||||||
Compile-time symbols are completely **case insensitive** and underscores are
|
Compile-time symbols are completely **case insensitive** and underscores are
|
||||||
|
|
@ -268,7 +268,7 @@ The `_r` suffix is used for release builds, `_d` is for debug builds.
|
||||||
This makes it easy to delete all generated files.
|
This makes it easy to delete all generated files.
|
||||||
|
|
||||||
The `--nimcache`:option:
|
The `--nimcache`:option:
|
||||||
`compiler switch <#compiler-usage-commandminusline-switches>`_ can be used to
|
[compiler switch][command-line switches] can be used to
|
||||||
to change the ``nimcache`` directory.
|
to change the ``nimcache`` directory.
|
||||||
|
|
||||||
However, the generated C code is not platform-independent. C code generated for
|
However, the generated C code is not platform-independent. C code generated for
|
||||||
|
|
@ -355,7 +355,7 @@ There are two ways to compile for Android: terminal programs (Termux) and with
|
||||||
the NDK (Android Native Development Kit).
|
the NDK (Android Native Development Kit).
|
||||||
|
|
||||||
The first one is to treat Android as a simple Linux and use
|
The first one is to treat Android as a simple Linux and use
|
||||||
`Termux <https://wiki.termux.com>`_ to connect and run the Nim compiler
|
[Termux](https://wiki.termux.com) to connect and run the Nim compiler
|
||||||
directly on android as if it was Linux. These programs are console-only
|
directly on android as if it was Linux. These programs are console-only
|
||||||
programs that can't be distributed in the Play Store.
|
programs that can't be distributed in the Play Store.
|
||||||
|
|
||||||
|
|
@ -363,8 +363,8 @@ Use regular `nim c`:cmd: inside termux to make Android terminal programs.
|
||||||
|
|
||||||
Normal Android apps are written in Java, to use Nim inside an Android app
|
Normal Android apps are written in Java, to use Nim inside an Android app
|
||||||
you need a small Java stub that calls out to a native library written in
|
you need a small Java stub that calls out to a native library written in
|
||||||
Nim using the `NDK <https://developer.android.com/ndk>`_. You can also use
|
Nim using the [NDK](https://developer.android.com/ndk). You can also use
|
||||||
`native-activity <https://developer.android.com/ndk/samples/sample_na>`_
|
[native-activity](https://developer.android.com/ndk/samples/sample_na)
|
||||||
to have the Java stub be auto-generated for you.
|
to have the Java stub be auto-generated for you.
|
||||||
|
|
||||||
Use `nim c -c --cpu:arm --os:android -d:androidNDK --noMain:on`:cmd: to
|
Use `nim c -c --cpu:arm --os:android -d:androidNDK --noMain:on`:cmd: to
|
||||||
|
|
@ -444,8 +444,8 @@ or setup a ``nim.cfg`` file like so::
|
||||||
--passL="-specs=$DEVKITPRO/libnx/switch.specs -L$DEVKITPRO/libnx/lib -lnx"
|
--passL="-specs=$DEVKITPRO/libnx/switch.specs -L$DEVKITPRO/libnx/lib -lnx"
|
||||||
|
|
||||||
The devkitPro setup must be the same as the default with their new installer
|
The devkitPro setup must be the same as the default with their new installer
|
||||||
`here for Mac/Linux <https://github.com/devkitPro/pacman/releases>`_ or
|
[here for Mac/Linux](https://github.com/devkitPro/pacman/releases) or
|
||||||
`here for Windows <https://github.com/devkitPro/installer/releases>`_.
|
[here for Windows](https://github.com/devkitPro/installer/releases).
|
||||||
|
|
||||||
For example, with the above-mentioned config:
|
For example, with the above-mentioned config:
|
||||||
|
|
||||||
|
|
@ -455,7 +455,7 @@ For example, with the above-mentioned config:
|
||||||
|
|
||||||
This will generate a file called ``switchhomebrew.elf`` which can then be turned into
|
This will generate a file called ``switchhomebrew.elf`` which can then be turned into
|
||||||
an nro file with the `elf2nro`:cmd: tool in the devkitPro release. Examples can be found at
|
an nro file with the `elf2nro`:cmd: tool in the devkitPro release. Examples can be found at
|
||||||
`the nim-libnx github repo <https://github.com/jyapayne/nim-libnx.git>`_.
|
[the nim-libnx github repo](https://github.com/jyapayne/nim-libnx.git).
|
||||||
|
|
||||||
There are a few things that don't work because the devkitPro libraries don't support them.
|
There are a few things that don't work because the devkitPro libraries don't support them.
|
||||||
They are:
|
They are:
|
||||||
|
|
@ -512,7 +512,7 @@ Define Effect
|
||||||
This only works with `--mm:none`:option:,
|
This only works with `--mm:none`:option:,
|
||||||
`--mm:arc`:option: and `--mm:orc`:option:.
|
`--mm:arc`:option: and `--mm:orc`:option:.
|
||||||
`useRealtimeGC` Enables support of Nim's GC for *soft* realtime
|
`useRealtimeGC` Enables support of Nim's GC for *soft* realtime
|
||||||
systems. See the documentation of the `mm <mm.html>`_
|
systems. See the documentation of the [mm](mm.html)
|
||||||
for further information.
|
for further information.
|
||||||
`logGC` Enable GC logging to stdout.
|
`logGC` Enable GC logging to stdout.
|
||||||
`nodejs` The JS target is actually ``node.js``.
|
`nodejs` The JS target is actually ``node.js``.
|
||||||
|
|
@ -591,7 +591,7 @@ The typical compiler usage involves using the `compile`:option: or `c`:option:
|
||||||
command to transform a ``.nim`` file into one or more ``.c`` files which are then
|
command to transform a ``.nim`` file into one or more ``.c`` files which are then
|
||||||
compiled with the platform's C compiler into a static binary. However, there
|
compiled with the platform's C compiler into a static binary. However, there
|
||||||
are other commands to compile to C++, Objective-C, or JavaScript. More details
|
are other commands to compile to C++, Objective-C, or JavaScript. More details
|
||||||
can be read in the `Nim Backend Integration document <backends.html>`_.
|
can be read in the [Nim Backend Integration document](backends.html).
|
||||||
|
|
||||||
|
|
||||||
Nim documentation tools
|
Nim documentation tools
|
||||||
|
|
@ -599,13 +599,13 @@ Nim documentation tools
|
||||||
|
|
||||||
Nim provides the `doc`:idx: command to generate HTML
|
Nim provides the `doc`:idx: command to generate HTML
|
||||||
documentation from ``.nim`` source files. Only exported symbols will appear in
|
documentation from ``.nim`` source files. Only exported symbols will appear in
|
||||||
the output. For more details `see the docgen documentation <docgen.html>`_.
|
the output. For more details see [the docgen documentation](docgen.html).
|
||||||
|
|
||||||
Nim idetools integration
|
Nim idetools integration
|
||||||
========================
|
========================
|
||||||
|
|
||||||
Nim provides language integration with external IDEs through the
|
Nim provides language integration with external IDEs through the
|
||||||
idetools command. See the documentation of `idetools <idetools.html>`_
|
idetools command. See the documentation of [idetools](idetools.html)
|
||||||
for further information.
|
for further information.
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
@ -666,7 +666,7 @@ The `--opt:size`:option: flag instructs Nim to optimize code generation for smal
|
||||||
size (with the help of the C compiler), the `-flto`:option: flags enable link-time
|
size (with the help of the C compiler), the `-flto`:option: flags enable link-time
|
||||||
optimization in the compiler and linker.
|
optimization in the compiler and linker.
|
||||||
|
|
||||||
Check the `Cross-compilation`_ section for instructions on how to compile the
|
Check the [Cross-compilation] section for instructions on how to compile the
|
||||||
program for your target.
|
program for your target.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -717,8 +717,8 @@ Currently only Zephyr and FreeRTOS support these configurations.
|
||||||
Nim for realtime systems
|
Nim for realtime systems
|
||||||
========================
|
========================
|
||||||
|
|
||||||
See the `--mm:arc` or `--mm:orc` memory management settings in `MM <mm.html>`_ for further
|
See the `--mm:arc` or `--mm:orc` memory management settings in
|
||||||
information.
|
[MM](mm.html) for further information.
|
||||||
|
|
||||||
|
|
||||||
Signal handling in Nim
|
Signal handling in Nim
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ Introduction
|
||||||
|
|
||||||
niminst is a tool to generate an installer for a Nim program. Currently
|
niminst is a tool to generate an installer for a Nim program. Currently
|
||||||
it can create an installer for Windows
|
it can create an installer for Windows
|
||||||
via `Inno Setup <http://www.jrsoftware.org/isinfo.php>`_ as well as
|
via [Inno Setup](http://www.jrsoftware.org/isinfo.php) as well as
|
||||||
installation/deinstallation scripts for UNIX. Later versions will support
|
installation/deinstallation scripts for UNIX. Later versions will support
|
||||||
Linux' package management systems.
|
Linux' package management systems.
|
||||||
|
|
||||||
|
|
@ -26,7 +26,7 @@ systems.
|
||||||
Configuration file
|
Configuration file
|
||||||
==================
|
==================
|
||||||
|
|
||||||
niminst uses the Nim `parsecfg <parsecfg.html>`_ module to parse the
|
niminst uses the Nim [parsecfg](parsecfg.html) module to parse the
|
||||||
configuration file. Here's an example of how the syntax looks like:
|
configuration file. Here's an example of how the syntax looks like:
|
||||||
|
|
||||||
.. include:: mytest.cfg
|
.. include:: mytest.cfg
|
||||||
|
|
|
||||||
101
doc/nims.md
101
doc/nims.md
|
|
@ -29,7 +29,7 @@ previous settings):
|
||||||
``$project.nim``. This file can be skipped with the same
|
``$project.nim``. This file can be skipped with the same
|
||||||
`--skipProjCfg`:option: command line option.
|
`--skipProjCfg`:option: command line option.
|
||||||
|
|
||||||
For available procs and implementation details see `nimscript <nimscript.html>`_.
|
For available procs and implementation details see [nimscript](nimscript.html).
|
||||||
|
|
||||||
|
|
||||||
Limitations
|
Limitations
|
||||||
|
|
@ -61,52 +61,53 @@ Standard library modules
|
||||||
|
|
||||||
At least the following standard library modules are available:
|
At least the following standard library modules are available:
|
||||||
|
|
||||||
* `macros <macros.html>`_
|
* [macros](macros.html)
|
||||||
* `os <os.html>`_
|
* [os](os.html)
|
||||||
* `strutils <strutils.html>`_
|
* [strutils](strutils.html)
|
||||||
* `math <math.html>`_
|
* [math](math.html)
|
||||||
* `distros <distros.html>`_
|
* [distros](distros.html)
|
||||||
* `sugar <sugar.html>`_
|
* [sugar](sugar.html)
|
||||||
* `algorithm <algorithm.html>`_
|
* [algorithm](algorithm.html)
|
||||||
* `base64 <base64.html>`_
|
* [base64](base64.html)
|
||||||
* `bitops <bitops.html>`_
|
* [bitops](bitops.html)
|
||||||
* `chains <chains.html>`_
|
* [chains](chains.html)
|
||||||
* `colors <colors.html>`_
|
* [colors](colors.html)
|
||||||
* `complex <complex.html>`_
|
* [complex](complex.html)
|
||||||
* `htmlgen <htmlgen.html>`_
|
* [htmlgen](htmlgen.html)
|
||||||
* `httpcore <httpcore.html>`_
|
* [httpcore](httpcore.html)
|
||||||
* `lenientops <lenientops.html>`_
|
* [lenientops](lenientops.html)
|
||||||
* `mersenne <mersenne.html>`_
|
* [mersenne](mersenne.html)
|
||||||
* `options <options.html>`_
|
* [options](options.html)
|
||||||
* `parseutils <parseutils.html>`_
|
* [parseutils](parseutils.html)
|
||||||
* `punycode <punycode.html>`_
|
* [punycode](punycode.html)
|
||||||
* `random <punycode.html>`_
|
* [random](punycode.html)
|
||||||
* `stats <stats.html>`_
|
* [stats](stats.html)
|
||||||
* `strformat <strformat.html>`_
|
* [strformat](strformat.html)
|
||||||
* `strmisc <strmisc.html>`_
|
* [strmisc](strmisc.html)
|
||||||
* `strscans <strscans.html>`_
|
* [strscans](strscans.html)
|
||||||
* `unicode <unicode.html>`_
|
* [unicode](unicode.html)
|
||||||
* `uri <uri.html>`_
|
* [uri](uri.html)
|
||||||
* `std/editdistance <editdistance.html>`_
|
* [std/editdistance](editdistance.html)
|
||||||
* `std/wordwrap <wordwrap.html>`_
|
* [std/wordwrap](wordwrap.html)
|
||||||
* `std/sums <sums.html>`_
|
* [std/sums](sums.html)
|
||||||
* `parsecsv <parsecsv.html>`_
|
* [parsecsv](parsecsv.html)
|
||||||
* `parsecfg <parsecfg.html>`_
|
* [parsecfg](parsecfg.html)
|
||||||
* `parsesql <parsesql.html>`_
|
* [parsesql](parsesql.html)
|
||||||
* `xmlparser <xmlparser.html>`_
|
* [xmlparser](xmlparser.html)
|
||||||
* `htmlparser <htmlparser.html>`_
|
* [htmlparser](htmlparser.html)
|
||||||
* `ropes <ropes.html>`_
|
* [ropes](ropes.html)
|
||||||
* `json <json.html>`_
|
* [json](json.html)
|
||||||
* `parsejson <parsejson.html>`_
|
* [parsejson](parsejson.html)
|
||||||
* `strtabs <strtabs.html>`_
|
* [strtabs](strtabs.html)
|
||||||
* `unidecode <unidecode.html>`_
|
* [unidecode](unidecode.html)
|
||||||
|
|
||||||
In addition to the standard Nim syntax (`system <system.html>`_ module),
|
In addition to the standard Nim syntax ([system](system.html) module),
|
||||||
NimScripts support the procs and templates defined in the
|
NimScripts support the procs and templates defined in the
|
||||||
`nimscript <nimscript.html>`_ module too.
|
[nimscript](nimscript.html) module too.
|
||||||
|
|
||||||
See also:
|
See also:
|
||||||
* `Check the tests for more information about modules compatible with NimScript. <https://github.com/nim-lang/Nim/blob/devel/tests/test_nimscript.nims>`_
|
* [Check the tests for more information about modules compatible with NimScript](
|
||||||
|
https://github.com/nim-lang/Nim/blob/devel/tests/test_nimscript.nims)
|
||||||
|
|
||||||
|
|
||||||
NimScript as a configuration file
|
NimScript as a configuration file
|
||||||
|
|
@ -169,14 +170,14 @@ Task Description
|
||||||
========= ===================================================
|
========= ===================================================
|
||||||
|
|
||||||
|
|
||||||
Look at the module `distros <distros.html>`_ for some support of the
|
Look at the module [distros](distros.html) for some support of the
|
||||||
OS's native package managers.
|
OS's native package managers.
|
||||||
|
|
||||||
|
|
||||||
Nimble integration
|
Nimble integration
|
||||||
==================
|
==================
|
||||||
|
|
||||||
See the `Nimble readme <https://github.com/nim-lang/nimble#readme>`_
|
See the [Nimble readme](https://github.com/nim-lang/nimble#readme)
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -297,7 +298,7 @@ translations.cfg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
* `Nimterlingua <https://nimble.directory/pkg/nimterlingua>`_
|
* [Nimterlingua](https://nimble.directory/pkg/nimterlingua)
|
||||||
|
|
||||||
|
|
||||||
Graceful Fallback
|
Graceful Fallback
|
||||||
|
|
@ -329,14 +330,15 @@ Evolving Scripting language
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
NimScript evolves together with Nim,
|
NimScript evolves together with Nim,
|
||||||
`occasionally new features might become available on NimScript <https://github.com/nim-lang/Nim/pulls?utf8=%E2%9C%93&q=nimscript>`_ ,
|
[occasionally new features might become available on NimScript](
|
||||||
|
https://github.com/nim-lang/Nim/pulls?utf8=%E2%9C%93&q=nimscript),
|
||||||
adapted from compiled Nim or added as new features on both.
|
adapted from compiled Nim or added as new features on both.
|
||||||
|
|
||||||
Scripting Language with a Package Manager
|
Scripting Language with a Package Manager
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
You can create your own modules to be compatible with NimScript,
|
You can create your own modules to be compatible with NimScript,
|
||||||
and check `Nimble <https://nimble.directory>`_
|
and check [Nimble](https://nimble.directory)
|
||||||
to search for third party modules that may work on NimScript.
|
to search for third party modules that may work on NimScript.
|
||||||
|
|
||||||
DevOps Scripting
|
DevOps Scripting
|
||||||
|
|
@ -345,4 +347,5 @@ DevOps Scripting
|
||||||
You can use NimScript to deploy to production, run tests, build projects, do benchmarks,
|
You can use NimScript to deploy to production, run tests, build projects, do benchmarks,
|
||||||
generate documentation, and all kinds of DevOps/SysAdmin specific tasks.
|
generate documentation, and all kinds of DevOps/SysAdmin specific tasks.
|
||||||
|
|
||||||
* `An example of a third party NimScript that can be used as a project-agnostic tool. <https://github.com/kaushalmodi/nim_config#list-available-tasks>`_
|
* [An example of a third party NimScript that can be used as a project-agnostic
|
||||||
|
tool.](https://github.com/kaushalmodi/nim_config#list-available-tasks)
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ definition of symbols or suggestions for completion.
|
||||||
This document will guide you through the available options. If you
|
This document will guide you through the available options. If you
|
||||||
want to look at practical examples of nimsuggest support you can look
|
want to look at practical examples of nimsuggest support you can look
|
||||||
at the
|
at the
|
||||||
`various editor integrations <https://github.com/Araq/Nim/wiki/Editor-Support>`_
|
[various editor integrations](https://github.com/Araq/Nim/wiki/Editor-Support)
|
||||||
already available.
|
already available.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -49,7 +49,7 @@ via sockets is more reasonable so that is the default. It listens to port 6000
|
||||||
by default.
|
by default.
|
||||||
|
|
||||||
Nimsuggest is basically a frontend for the nim compiler so `--path`:option: flags and
|
Nimsuggest is basically a frontend for the nim compiler so `--path`:option: flags and
|
||||||
`config files <https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files>`_
|
[config files](https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files)
|
||||||
can be used to specify additional dependencies like
|
can be used to specify additional dependencies like
|
||||||
`nimsuggest --stdin --debug --path:"dependencies" myproject.nim`:cmd:.
|
`nimsuggest --stdin --debug --path:"dependencies" myproject.nim`:cmd:.
|
||||||
|
|
||||||
|
|
@ -113,8 +113,8 @@ The `sug` Nimsuggest command performs a query about possible
|
||||||
completion symbols at some point in the file.
|
completion symbols at some point in the file.
|
||||||
|
|
||||||
The typical usage scenario for this option is to call it after the
|
The typical usage scenario for this option is to call it after the
|
||||||
user has typed the dot character for `the object oriented call
|
user has typed the dot character for [the object oriented call
|
||||||
syntax <tut2.html#object-oriented-programming-method-call-syntax>`_.
|
syntax](tut2.html#object-oriented-programming-method-call-syntax).
|
||||||
Nimsuggest will try to return the suggestions sorted first by scope
|
Nimsuggest will try to return the suggestions sorted first by scope
|
||||||
(from innermost to outermost) and then by item name.
|
(from innermost to outermost) and then by item name.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ Packaging Nim
|
||||||
|
|
||||||
This page provide hints on distributing Nim using OS packages.
|
This page provide hints on distributing Nim using OS packages.
|
||||||
|
|
||||||
See `distros <distros.html>`_ for tools to detect Linux distribution at runtime.
|
See [distros](distros.html) for tools to detect Linux distribution at runtime.
|
||||||
|
|
||||||
See `here <intern.html#bootstrapping-the-compiler-reproducible-builds>`_ for how to
|
See [here](intern.html#bootstrapping-the-compiler-reproducible-builds) for how to
|
||||||
compile reproducible builds.
|
compile reproducible builds.
|
||||||
|
|
||||||
Supported architectures
|
Supported architectures
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ Keeping track of memory
|
||||||
If you need to pass around memory allocated by Nim to C, you can use the
|
If you need to pass around memory allocated by Nim to C, you can use the
|
||||||
procs `GC_ref` and `GC_unref` to mark objects as referenced to avoid them
|
procs `GC_ref` and `GC_unref` to mark objects as referenced to avoid them
|
||||||
being freed by the garbage collector.
|
being freed by the garbage collector.
|
||||||
Other useful procs from `system <system.html>`_ you can use to keep track of memory are:
|
Other useful procs from [system](system.html) you can use to keep track of memory are:
|
||||||
|
|
||||||
* `getTotalMem()` Returns the amount of total memory managed by the garbage collector.
|
* `getTotalMem()` Returns the amount of total memory managed by the garbage collector.
|
||||||
* `getOccupiedMem()` Bytes reserved by the garbage collector and used by objects.
|
* `getOccupiedMem()` Bytes reserved by the garbage collector and used by objects.
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ Nim has two flavors of parallelism:
|
||||||
1) `Structured`:idx parallelism via the ``parallel`` statement.
|
1) `Structured`:idx parallelism via the ``parallel`` statement.
|
||||||
2) `Unstructured`:idx: parallelism via the standalone ``spawn`` statement.
|
2) `Unstructured`:idx: parallelism via the standalone ``spawn`` statement.
|
||||||
|
|
||||||
Both need the `threadpool <threadpool.html>`_ module to work.
|
Both need the [threadpool](threadpool.html) module to work.
|
||||||
|
|
||||||
Somewhat confusingly, ``spawn`` is also used in the ``parallel`` statement
|
Somewhat confusingly, ``spawn`` is also used in the ``parallel`` statement
|
||||||
with slightly different semantics. ``spawn`` always takes a call expression of
|
with slightly different semantics. ``spawn`` always takes a call expression of
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
Testament is an advanced automatic unittests runner for Nim tests, is used for the development of Nim itself,
|
Testament is an advanced automatic unittests runner for Nim tests, is used for the development of Nim itself,
|
||||||
offers process isolation for your tests, it can generate statistics about test cases,
|
offers process isolation for your tests, it can generate statistics about test cases,
|
||||||
supports multiple targets (C, C++, ObjectiveC, JavaScript, etc.),
|
supports multiple targets (C, C++, ObjectiveC, JavaScript, etc.),
|
||||||
simulated `Dry-Runs <https://en.wikipedia.org/wiki/Dry_run_(testing)>`_,
|
simulated [Dry-Runs](https://en.wikipedia.org/wiki/Dry_run_(testing)),
|
||||||
has logging, can generate HTML reports, skip tests from a file, and more,
|
has logging, can generate HTML reports, skip tests from a file, and more,
|
||||||
so can be useful to run your tests, even the most complex ones.
|
so can be useful to run your tests, even the most complex ones.
|
||||||
|
|
||||||
|
|
@ -185,8 +185,10 @@ Example "template" **to edit** and write a Testament unittest:
|
||||||
|
|
||||||
* As you can see the "Spec" is just a `discard """ """`.
|
* As you can see the "Spec" is just a `discard """ """`.
|
||||||
* Spec has sane defaults, so you don't need to provide them all, any simple assert will work just fine.
|
* Spec has sane defaults, so you don't need to provide them all, any simple assert will work just fine.
|
||||||
* `This is not the full spec of Testament, check the Testament Spec on GitHub, see parseSpec(). <https://github.com/nim-lang/Nim/blob/devel/testament/specs.nim#L238>`_
|
* This is not the full spec of Testament, check [the Testament Spec on GitHub,
|
||||||
* `Nim itself uses Testament, so there are plenty of test examples. <https://github.com/nim-lang/Nim/tree/devel/tests>`_
|
see parseSpec()](https://github.com/nim-lang/Nim/blob/devel/testament/specs.nim#L315).
|
||||||
|
* Nim itself uses Testament, so [there are plenty of test examples](
|
||||||
|
https://github.com/nim-lang/Nim/tree/devel/tests).
|
||||||
* Has some built-in CI compatibility, like Azure Pipelines, etc.
|
* Has some built-in CI compatibility, like Azure Pipelines, etc.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -195,11 +197,10 @@ Inline hints, warnings and errors (notes)
|
||||||
|
|
||||||
Testing the line, column, kind and message of hints, warnings and errors can
|
Testing the line, column, kind and message of hints, warnings and errors can
|
||||||
be written inline like so:
|
be written inline like so:
|
||||||
|
```nim
|
||||||
.. code-block:: nim
|
|
||||||
|
|
||||||
{.warning: "warning!!"} #[tt.Warning
|
{.warning: "warning!!"} #[tt.Warning
|
||||||
^ warning!! [User] ]#
|
^ warning!! [User] ]#
|
||||||
|
```
|
||||||
|
|
||||||
The opening `#[tt.` marks the message line.
|
The opening `#[tt.` marks the message line.
|
||||||
The `^` marks the message column.
|
The `^` marks the message column.
|
||||||
|
|
@ -207,18 +208,17 @@ The `^` marks the message column.
|
||||||
Inline messages can be combined with `nimout` when `nimoutFull` is false (default).
|
Inline messages can be combined with `nimout` when `nimoutFull` is false (default).
|
||||||
This allows testing for expected messages from other modules:
|
This allows testing for expected messages from other modules:
|
||||||
|
|
||||||
.. code-block:: nim
|
```nim
|
||||||
|
|
||||||
discard """
|
discard """
|
||||||
nimout: "config.nims(1, 1) Hint: some hint message [User]"
|
nimout: "config.nims(1, 1) Hint: some hint message [User]"
|
||||||
"""
|
"""
|
||||||
{.warning: "warning!!"} #[tt.Warning
|
{.warning: "warning!!"} #[tt.Warning
|
||||||
^ warning!! [User] ]#
|
^ warning!! [User] ]#
|
||||||
|
```
|
||||||
|
|
||||||
Multiple messages for a line can be checked by delimiting messages with ';':
|
Multiple messages for a line can be checked by delimiting messages with ';':
|
||||||
|
|
||||||
.. code-block:: nim
|
```nim
|
||||||
|
|
||||||
discard """
|
discard """
|
||||||
matrix: "--errorMax:0 --styleCheck:error"
|
matrix: "--errorMax:0 --styleCheck:error"
|
||||||
"""
|
"""
|
||||||
|
|
@ -227,6 +227,7 @@ Multiple messages for a line can be checked by delimiting messages with ';':
|
||||||
^ 'generic_proc' should be: 'genericProc'; tt.Error
|
^ 'generic_proc' should be: 'genericProc'; tt.Error
|
||||||
^ 'a_a' should be: 'aA' ]#
|
^ 'a_a' should be: 'aA' ]#
|
||||||
discard
|
discard
|
||||||
|
```
|
||||||
|
|
||||||
Use `--errorMax:0` in `matrix`, or `cmd: "nim check $file"` when testing
|
Use `--errorMax:0` in `matrix`, or `cmd: "nim check $file"` when testing
|
||||||
for multiple 'Error' messages.
|
for multiple 'Error' messages.
|
||||||
|
|
@ -327,4 +328,4 @@ Tests without Spec:
|
||||||
|
|
||||||
|
|
||||||
See also:
|
See also:
|
||||||
* `Unittest <unittest.html>`_
|
* [Unittest](unittest.html)
|
||||||
|
|
|
||||||
16
doc/tools.md
16
doc/tools.md
|
|
@ -7,36 +7,36 @@ Tools available with Nim
|
||||||
|
|
||||||
The standard distribution ships with the following tools:
|
The standard distribution ships with the following tools:
|
||||||
|
|
||||||
- | `Hot code reloading <hcr.html>`_
|
- | [Hot code reloading](hcr.html)
|
||||||
| The "Hot code reloading" feature is built into the compiler but has its own
|
| The "Hot code reloading" feature is built into the compiler but has its own
|
||||||
document explaining how it works.
|
document explaining how it works.
|
||||||
|
|
||||||
- | `Documentation generator <docgen.html>`_
|
- | [Documentation generator](docgen.html)
|
||||||
| The builtin document generator `nim doc`:cmd: generates HTML documentation
|
| The builtin document generator `nim doc`:cmd: generates HTML documentation
|
||||||
from ``.nim`` source files.
|
from ``.nim`` source files.
|
||||||
|
|
||||||
- | `Nimsuggest for IDE support <nimsuggest.html>`_
|
- | [Nimsuggest for IDE support](nimsuggest.html)
|
||||||
| Through the `nimsuggest`:cmd: tool, any IDE can query a ``.nim`` source file
|
| Through the `nimsuggest`:cmd: tool, any IDE can query a ``.nim`` source file
|
||||||
and obtain useful information like the definition of symbols or suggestions for
|
and obtain useful information like the definition of symbols or suggestions for
|
||||||
completion.
|
completion.
|
||||||
|
|
||||||
- | `C2nim <https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst>`_
|
- | [C2nim](https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst)
|
||||||
| C to Nim source converter. Translates C header files to Nim.
|
| C to Nim source converter. Translates C header files to Nim.
|
||||||
|
|
||||||
- | `niminst <niminst.html>`_
|
- | [niminst](niminst.html)
|
||||||
| niminst is a tool to generate an installer for a Nim program.
|
| niminst is a tool to generate an installer for a Nim program.
|
||||||
|
|
||||||
- | `nimgrep <nimgrep.html>`_
|
- | [nimgrep](nimgrep.html)
|
||||||
| Nim search and replace utility.
|
| Nim search and replace utility.
|
||||||
|
|
||||||
- | nimpretty
|
- | nimpretty
|
||||||
| `nimpretty`:cmd: is a Nim source code beautifier,
|
| `nimpretty`:cmd: is a Nim source code beautifier,
|
||||||
to format code according to the official style guide.
|
to format code according to the official style guide.
|
||||||
|
|
||||||
- | `testament <https://nim-lang.github.io/Nim/testament.html>`_
|
- | [testament](https://nim-lang.github.io/Nim/testament.html)
|
||||||
| `testament`:cmd: is an advanced automatic *unittests runner* for Nim tests,
|
| `testament`:cmd: is an advanced automatic *unittests runner* for Nim tests,
|
||||||
is used for the development of Nim itself, offers process isolation for your tests,
|
is used for the development of Nim itself, offers process isolation for your tests,
|
||||||
it can generate statistics about test cases, supports multiple targets (C, JS, etc),
|
it can generate statistics about test cases, supports multiple targets (C, JS, etc),
|
||||||
`simulated Dry-Runs <https://en.wikipedia.org/wiki/Dry_run_(testing)>`_,
|
[simulated Dry-Runs](https://en.wikipedia.org/wiki/Dry_run_(testing)),
|
||||||
has logging, can generate HTML reports, skip tests from a file, and more,
|
has logging, can generate HTML reports, skip tests from a file, and more,
|
||||||
so can be useful to run your tests, even the most complex ones.
|
so can be useful to run your tests, even the most complex ones.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue