From 4b80604ac52649d9b430b4cbaa9eefb334001b2a Mon Sep 17 00:00:00 2001 From: Dmitry Kurinskiy Date: Fri, 25 Jun 2021 10:20:16 +0000 Subject: [PATCH] GitBook: [master] 32 pages modified --- SUMMARY.md | 10 +++--- language/basics.md | 58 ++++++++++++++++++++++++++++++++++ language/operators/README.md | 2 +- language/operators/parallel.md | 2 +- runtimes/README.md | 12 +++++++ runtimes/aqua-vm.md | 2 ++ 6 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 language/basics.md create mode 100644 runtimes/README.md create mode 100644 runtimes/aqua-vm.md diff --git a/SUMMARY.md b/SUMMARY.md index 673fe29..453309d 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -7,6 +7,7 @@ * [Debugging And Testing](getting-started/debugging-and-testing.md) * [Tools](getting-started/tools.md) * [Language](language/README.md) + * [Basics](language/basics.md) * [Types](language/types.md) * [Values](language/variables.md) * [Topology](language/topology.md) @@ -15,18 +16,19 @@ * [Conditional](language/operators/conditional.md) * [Parallel](language/operators/parallel.md) * [Iterative](language/operators/iterative.md) + * [Abilities & Services](language/abilities-and-services.md) + * [CRDT Streams](language/crdt-streams.md) + * [Imports & exports](language/statements-1.md) * [Expressions](language/expressions/README.md) * [Header](language/expressions/header.md) * [Functions](language/expressions/functions.md) * [Services](language/expressions/services.md) * [Type definitions](language/expressions/type-definitions.md) * [Overrideable constants](language/expressions/overrideable-constants.md) - * [CRDT Streams](language/crdt-streams.md) - * [Abilities & Services](language/abilities-and-services.md) - * [Imports & exports](language/statements-1.md) +* [Runtimes](runtimes/README.md) + * [Aqua VM](runtimes/aqua-vm.md) * [Aqua Patterns](aqua-patterns.md) * [Library \(BuiltIns\)](library-builtins.md) -* [Aqua VM](aqua-vm.md) * [Appendix](appendix.md) * [Foundations: π-calculus](foundations-p-calculus.md) diff --git a/language/basics.md b/language/basics.md new file mode 100644 index 0000000..ff251a2 --- /dev/null +++ b/language/basics.md @@ -0,0 +1,58 @@ +# Basics + +Aqua is an opinionated domain-specific language with colons and indentation. + +```text +-- Comments begin with double-dash, ends on the end of line +func foo(): -- Comments are allowed almost everywhere + -- Body of the block expression is indented + bar(5) +``` + +Values in Aqua have types. Types of values are designated by a colon, like in function arguments definition below. Type of return \(yielded when a function is executed\) is denoted by an arrow pointing to the right. + +Yielding is denoted by an arrow pointing to the left. + +```text +-- Define a function that yields a string +func bar(arg: i16) -> string: + -- Call a function + smth(arg) + + -- Yield a value from a function + x <- smth(arg) + + -- Return a yielded results from a function + <- "return literal" +``` + +Subsequent sections explain the main parts of Aqua. + +Data: + +* [Types](types.md) +* [Values of that types](variables.md) + +Execution: + +* [Topology](topology.md) – how to express where the code should be executed +* [Execution flow](operators/) – control structures + +Computations: + +* [Abilities & Services](abilities-and-services.md) + +Advanced parallelism: + +* [CRDT Streams](crdt-streams.md) + +Code management: + +* [Imports & exports](statements-1.md) + +Reference: + +* [Expressions](expressions/) + + + diff --git a/language/operators/README.md b/language/operators/README.md index d4196d8..adc0984 100644 --- a/language/operators/README.md +++ b/language/operators/README.md @@ -2,5 +2,5 @@ Aqua's main goal is to express how the execution flows: moves from peer to peer, forks to parallel flows and then joins back, uses data from one step in another. -As the foundation of Aqua is based on π-calculus, finally flow is decomposed into sequential \(seq, .\), conditional \(xor, ^\), parallel \(par, \|\) computations and iterations based on data \(!P\). +As the foundation of Aqua is based on π-calculus, finally flow is decomposed into sequential \(`seq`, `.`\), conditional \(`xor`, `+`\), parallel \(`par`, `|`\) computations and iterations based on data \(`!P`\). diff --git a/language/operators/parallel.md b/language/operators/parallel.md index 13898bf..9324d3a 100644 --- a/language/operators/parallel.md +++ b/language/operators/parallel.md @@ -116,7 +116,7 @@ What will happen when execution comes to `baz`? Actually, the script will be executed twice: first time it will be sent from `peer1`, and second time – from `peer2`. Or another way round: `peer2` then `peer1`, we don't know who is faster. -When execution will get to `baz` for the first time, [Aqua VM](../../aqua-vm.md) will realize that it lacks some data that is expected to be computed above in the parallel branch. And halt. +When execution will get to `baz` for the first time, [Aqua VM](../../runtimes/aqua-vm.md) will realize that it lacks some data that is expected to be computed above in the parallel branch. And halt. After the second branch executes, VM will be woken up again, reach the same piece of code and realize that now it has enough data to proceed. diff --git a/runtimes/README.md b/runtimes/README.md new file mode 100644 index 0000000..a98e509 --- /dev/null +++ b/runtimes/README.md @@ -0,0 +1,12 @@ +--- +description: How to run Aqua +--- + +# Runtimes + +Okay, we have Aqua code. How to run it? + +TypeScript, JS, pure AIR. + +Reference to AquaVM. + diff --git a/runtimes/aqua-vm.md b/runtimes/aqua-vm.md new file mode 100644 index 0000000..ec6c770 --- /dev/null +++ b/runtimes/aqua-vm.md @@ -0,0 +1,2 @@ +# Aqua VM +