diff options
| author | s-ol <s+removethis@s-ol.nu> | 2025-08-04 22:08:41 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-08-04 22:27:26 +0000 |
| commit | 875b51ccc9e8891bd2b4d44a6c42a8e4d78f355b (patch) | |
| tree | 30c2f51f7e0f85ad7f082930e39375c19c43f8b9 /docs/reference | |
| parent | docs/reference: update comments, literals sections (diff) | |
| download | alive-875b51ccc9e8891bd2b4d44a6c42a8e4d78f355b.tar.gz alive-875b51ccc9e8891bd2b4d44a6c42a8e4d78f355b.zip | |
docs: small fixes in guide and reference
Diffstat (limited to 'docs/reference')
| -rw-r--r-- | docs/reference/02_evaltime-and-runtime.md | 34 | ||||
| -rw-r--r-- | docs/reference/04-2_pure-operators.md | 4 |
2 files changed, 17 insertions, 21 deletions
diff --git a/docs/reference/02_evaltime-and-runtime.md b/docs/reference/02_evaltime-and-runtime.md index e718cf3..16b33f5 100644 --- a/docs/reference/02_evaltime-and-runtime.md +++ b/docs/reference/02_evaltime-and-runtime.md @@ -1,22 +1,18 @@ -So far, `alv` may seem a lot like any other programming language - you write -some code, save the file, and it runs, printing some output. "What about the -'continuously running' aspect from the introduction?", you may ask yourself. - -So far, we have only seen *evaltime* execution in alv - but there is also -*runtime* behavior. At *evaltime*, that is whenever there is change to the -source code, `alv` behaves similar to a Lisp. This is the part we have seen -so far. But once one such *eval cycle* has executed, *runtime* starts, and -`alv` behaves like a dataflow system like [PureData][pd], [Max/MSP][max] or -[vvvv][vvvv]. - -What looked so far like static constants are actually *streams* of values. -Whenever an input to an operator changes, the operator (may) update and respond -with a change to its output as well. To see this in action, we need to start -with a changing value. Number literals like `1` and `2`, which we used so far, -are *evaltime constant*, which means simply that they will never update. Since -all inputs to our [math/+][] operator are *evaltime constant*, the result is -constant as well. To get some *runtime* activity, we have to introduce a -side-effect input from somewhere outside the system. +Execution in `alv` is split into two phases - *evaltime* and *runtime*. + +At *evaltime*, that is whenever there is change to the source code, `alv` +behaves similar to a Lisp. But once one such *eval cycle* has executed, +*runtime* starts, and `alv` behaves like a dataflow system like +[PureData][pd], [Max/MSP][max] or [vvvv][vvvv]. + +Every alive expression returns a *stream* of values. Whenever an input to an +operator changes, the operator (may) update and respond with a change to its +output as well. To see this in action, we need to start with a changing value. +Number literals like `1` and `2`, are *evaltime constant*, which means simply +that they will never update. Since all inputs to our [math/+][] operator are +*evaltime constant*, the result is constant as well. To get some *runtime* +activity, we have to introduce a side-effect input from somewhere outside the +system. The [time/][] module contains a number of operators whose outputs update over time. Lets take a look at [time/tick][]: diff --git a/docs/reference/04-2_pure-operators.md b/docs/reference/04-2_pure-operators.md index b3bdf42..2239f02 100644 --- a/docs/reference/04-2_pure-operators.md +++ b/docs/reference/04-2_pure-operators.md @@ -10,9 +10,9 @@ mixed between all kinds of results, subject to the following rules: - If any of the inputs is a !-stream, the output is also an !-stream and will only fire when the input stream does. All other inputs will be sampled at that moment. At most one !-stream is allowed as an input. -- Otherwise, if there are one more ~-streams in the inputs, the output will +- Otherwise, if there is at least one ~-stream in the inputs, the output will also be a ~-stream and will be updated whenever any of the inputs changes. -- Otherwise the output is a constant. +- Otherwise (if all inputs are constants) the output is a constant. The input and output *types* are defined by the concrete Op. |
