GitBook: [master] 32 pages modified

This commit is contained in:
Dmitry Kurinskiy 2021-06-25 10:20:16 +00:00 committed by gitbook-bot
parent 44cfd39420
commit 4b80604ac5
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
6 changed files with 80 additions and 6 deletions

View File

@ -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)

58
language/basics.md Normal file
View File

@ -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/)

View File

@ -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`\).

View File

@ -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.

12
runtimes/README.md Normal file
View File

@ -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.

2
runtimes/aqua-vm.md Normal file
View File

@ -0,0 +1,2 @@
# Aqua VM