-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from CFiggers/master
Overhaul spork's docs
- Loading branch information
Showing
51 changed files
with
650 additions
and
670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{:title "build-rules" | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
Run commands that produce files in an incremental manner. | ||
Use to implement a build system. | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "build-rules") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{:title "cc" | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
Improved version of the C Compiler abstraction from JPM that should be more correct, composable, and | ||
have less configuration. | ||
|
||
Wrapper around the system C compiler for compiling Janet native modules and executables. | ||
Opinionated and optimized for use with Janet, and does not actually run | ||
commands unless specified with (dyn *visit*). Also included is package config integration. | ||
Headers, static libraries, and dynamic libraries can all be used from `(dyn *syspath*)`. | ||
|
||
## Example usage | ||
|
||
@codeblock[janet]``` | ||
(use spork/cc) | ||
|
||
(search-static-libraries "m" "rt" "dl") | ||
(search-dynamic-libraries "janet") | ||
(pkg-config "sdl2" "vulkan") | ||
(with-dyns [*defines* {"GAME_BUILD" "devel-0.0"} | ||
*visit* visit-execute-if-stale] | ||
(compile-and-link-executable "game" "main.c" "sound.c" "graphics.c")) | ||
``` | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "cc") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{:title "channel" | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
Channel utilities for Janet. | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "channel") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{:title "cjanet" | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
A DSL that compiles to C. | ||
Improved version of jpm/cgen that is more amenable to Janet integration, macros, and meta-programming. | ||
|
||
The semantics of the language are basically the | ||
same as C so a higher level language (or type system) should be built on top of this. | ||
This IR emits a very useful subset of valid C 99. | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "cjanet") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{:title "cmath" | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "cmath") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{:title "crc" | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
Generate CRC (Cyclic Redundancy Check) variants. | ||
Rather than compile separate variants, we have code to generate the needed tables. | ||
Keeps build simple, footprint small but with many variants accessible. | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "crc") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{:title "cron" | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
Timer library for interfacing with the UNIX crontab format. | ||
|
||
The cron format support is based on the unix cron syntax, with an optional seconds field. | ||
Each field can be a comma separated list of individual values or a range of values. | ||
|
||
A range has three variants as follows: | ||
@ol{ | ||
@li{Two values with a "-" between them, optionally followed by a "/" and a step value.} | ||
@li{An asterisk ("*") followed by a "/" and a step value. This implies every "step" value.} | ||
@li{A single value followed by a "/" and a step value. This implies every "step" value starting with the single value. I.e., 2/3 implies every 3 units from 2 to max units.}} | ||
|
||
A single asterisk ("*") can be used to denote all possible values. | ||
|
||
The fields: | ||
@ul{ | ||
@li{minutes: 0-5 } | ||
@li{hours: 0-2 } | ||
@li{day of month: 1-3 } | ||
@li{month: 1-12. Also allowed are the following month codes in any case } | ||
jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec | ||
@li{day of week: 0-7, where 0 or 7 is sunday, monday is 1, etc. allows the following day codes (any case)} | ||
sun,mon,tue,wed,thu,fri,sat | ||
@li{ seconds (optional): 0-5}} | ||
|
||
Cron schedules are represented as tuples of 7 values, a string representation, followed | ||
by 6 bitmaps representing matching timestamps. Bitmaps are represented as any byte sequence. | ||
|
||
@codeblock`[string-rep minutes hours day-of-month month day-of-week seconds]` | ||
|
||
Note that we have second precision here as opposed to minute precision. | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "cron") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{:title "ev-utils" | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
Module for parallel execution utilities with Janet. | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "ev-utils") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
{:title "Formatting" | ||
{:title "fmt" | ||
:author "Calvin Rose" | ||
:license "MIT" | ||
:template "mdzdoc/main.html" | ||
:order 2} | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
Provides a way to format Janet code strings and files. | ||
|
||
## Strings | ||
## Examples | ||
|
||
### Strings | ||
|
||
@codeblock[janet]``` | ||
(import spork/fmt) | ||
|
||
(fmt/format "(def a\n 3 )") => @"(def a\n 3)\n" | ||
``` | ||
|
||
## Files | ||
### Files | ||
|
||
@codeblock[janet]``` | ||
(import spork/fmt) | ||
|
||
(fmt/format-file "main.janet") | ||
``` | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "fmt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{:title "generators" | ||
:author "Z. D. Smith" | ||
:license "BSD3" | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
A @strong[generator] is an iterable data structure which yields individual values whenever called, potentially until its internal values are exhausted, at which point it's considered @i[dead]. | ||
|
||
This operation makes them very useful for: | ||
|
||
@ul{@li{Asynchronous behaviour} | ||
@li{Memory-sensitive applications, where it's not necessary to keep an entire sequence in memory at once} | ||
@li{Infinite sequences}} | ||
|
||
NB: Certain functions (specifically @code`run` and @code`to-array`) will create an infinite loop if their argument is an infinite generator! | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "generators") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{:title "getline" | ||
:template "mdzdoc/main.html"} | ||
--- | ||
|
||
Module for fiber-based sequence combinators rather than array-based combinators, as are in the core library. | ||
|
||
## Reference | ||
|
||
@api-docs("../../spork" "getline") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.