Repository navigation
Conversation
Functions can return a stream<T>, its items listed with @value, written as the caller reads them. Streams of integers, floats or bool can continue with items generated by an @expression, a closure in a subset of Rust, from the items before them, the function's arguments, and their position. - stream<T> results: an empty stream from any function, a stream with items from an async function, written by a task lifted with a callback, nothing added to components without streams - @expression closures over the previous items, starting from the @value items, or from the function's arguments, as items or as inputs read by name or through $init, with $call for the closure's parameters and $i for the position - typed expressions: literals typed by context, `as` casts, wrapping operators (+% -% *% /% %% <<% >>% **% -%), `**` for powers, methods, `let` and `let mut` bindings, assignments, `if`, `while` loops, and arrays or to_le_bytes/to_be_bytes generating several items at once - a stream ends when its next item can't be represented, as Rust's checked arithmetic would fail, or runs until the reader closes it - at most one @value and one @expression per doc comment - a tree-sitter grammar for expressions, tested against the same corpus as the parser, and a specification for language servers, with a guide in docs/expressions.md - math streams: odd, even, arithmetic, geometric, fibonacci, factorial, harmonic, figurate and prime, and new atomics and random components - test-cli, composing test-cli-core with the data components, to call their functions from the command line with wasmtime run, reading streams as stdin asks Signed-off-by: Scott Andrews <scott@andrews.me>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Functions can return a stream, its items listed with @value, written as
the caller reads them. Streams of integers, floats or bool can continue with
items generated by an @expression, a closure in a subset of Rust, from the
items before them, the function's arguments, and their position.
from an async function, written by a task lifted with a callback, nothing
added to components without streams
items, or from the function's arguments, as items or as inputs read by
name or through $init, with $call for the closure's parameters and $i for
the position
ascasts, wrappingoperators (+% -% *% /% %% <<% >>% **% -%),
**for powers, methods,letandlet mutbindings, assignments,if,whileloops, and arraysor to_le_bytes/to_be_bytes generating several items at once
arithmetic would fail, or runs until the reader closes it
the parser, and a specification for language servers, with a guide in
docs/expressions.md
harmonic, figurate and prime, and new atomics and random components
functions from the command line with wasmtime run, reading streams as
stdin asks