Crates.io | flowstdlib |
lib.rs | flowstdlib |
version | 0.142.0 |
source | src |
created_at | 2018-01-29 20:46:05.350605 |
updated_at | 2023-09-28 17:35:55.882296 |
description | The standard library of functions and flows for 'flow' programs |
homepage | http://andrewdavidmackenzie.github.io/flow/ |
repository | https://github.com/andrewdavidmackenzie/flow/ |
max_upload_size | |
id | 48829 |
size | 155,493 |
flowstdlib
Libraryflowstdlib
is a standard library of functions and flows for flow
programs to use.
flowstdlib
contains the following modules:
In order for the compiler to be able to find the library's flow
and function
definitions, the directory containing
this library must be in the default location ($HOME/.flow/lib
), be part of FLOW_LIB_PATH
or specified using an
instance of the -L
command line option to flowc
,
NOTE: That flows are compiled down to a graph of functions at compile time, and do not exist at runtime.
Libraries like flowstdlib
are built using flowc
, specifying the library root folder as the source url.
This builds a directory tree (in target/{lib_name}
) of all required files for a portable library, including:-
manifest.json
manifest of the libraries functions and where the implementations (.wasm files) can be found.
This is used by the Runtime to be able to load it.Flow libraries such as flowstdlib
have a dual nature. They can compiled and linked natively to a binary such
as flowr
, or when compiled by flowc
all the functions implementations are compiled to
.wasm
WASM files.
flowr
offers the -n/--native
option for the flowstdlib
to be used natively. When used, functions it
contains will be run natively (machine code), as opposed to WASM implementations of the functions.
If the -n/--native
option is not used, and the library manifest (manifest.json
) is found by the flow
runner (e.g. flowr
) at runtime (using default location, FLOW_LIB_PATH
or -L
), then the manifest is read and
the functions WASM implementations found and loaded.
When a job is executed that requires one of these library functions, the WASM implementation is run.
There are no features to enable.