# Aqua Language
## Overview
## Example
## Language Concepts
### Comments
Aqua supports a single type of comments in the form of two dashes (--).
```elm
-- this is a comment
-- and this is another comment
```
Question: do we have block comments `{- bla bla bla -}` ?
### Literals & Data Types
Aqua's types are bound bythe Wasm Interfact Types and defined [here](https://github.com/fluencelabs/aqua/blob/main/types/src/main/scala/aqua/types/Type.scala).
#### scalar types
* integers: u32, u64, s32, s64
* floats: f32, f64
* number ??
* bool
* string
#### ?
* ProductType
* ArrowType -- model composable relationships between two types (callback ?)
### Keywords
[source](https://github.com/fluencelabs/aqua/blob/main/parser/src/main/scala/aqua/parser/lexer/Token.scala):
### Keywords
#### import
Imports one file to another
`import "some_file.aqua"`
#### data
Uses to describe a structure/schema of a type. One `data` could be used in another
```
data RecordType:
fields: []Field
id: u64
name: string
```
#### alias
An alias of a type
```
alias PeerId : string
```
#### service
Describes entrypoints and types for interaction with a service
```
service ServiceName("peer-id-of-service-holder"):
functionName: u32, string, SomeType -> ReturnType
anotherFunction: u8, []string -> string
```
#### %init_peer_id%
PeerId of an initiator of the call
#### on
Describes topology of calls. Indicates at which address the next calls will be executed
```
on "peer_id":
CallService(...)
...
```
After `on` block the topological transition will take a step back
#### via
If a path to a recipient have more then one nodes you can use `via` to describe it
```
on "peer_id" via "sub_peer_id" via "another_peer_id":
...
```
#### par
Marks pairs of instructions that execution flow will run in parallel. A flow won't wait if these instructions won't be executed if there will be no usage of results that was executed.
```
...
someFunc()
par anotherFunc() -- here someFunc and anotherFunc will be executed in parallel and execution won't wait for results
...
```
```
r1 <- someFunc()
par r2 <- anotherFunc() -- here execution will be in parallel
thirdFunc(r1, r2) -- all results will be expected here
```
It is possible to use `par` with `fold`, all iterations will be called in parallel:
```
for p <- peers par:
SomeThing.call()
SomeThing.call2()
```
#### if, else, otherwise
The if statement executes a statement if a specified condition is truthy. If the condition is falsy, another statement can be executed. Supports only `==`, `!=` or just bool type statement
```
if number == 1:
Service.call("it is 1")
else:
Service.call("it is not 1")
```
#### * -- a sign that marks stream types: `someStream: *string`
#### = -- assignment
#### == -- equality
#### != -- negation of equality
#### : -- a sign that marks the beginning of a new block
#### -- -- comment
#### -> -- an arrow where left side are arguments types and left side is return type
#### <- -- an arrow where right side is a call and left side is a result of a call
is there division, /, gt, >, lt, < ? anything else?
do we have the access and flattening ($, !) operators ?
### Syntax Convenience Methods
[source](https://github.com/fluencelabs/aqua/blob/7512648cd08935a5c69b193704ac5b96f684a938/model/src/main/scala/aqua/model/transform/BodyConfig.scala)
#### getDataSrv
#### callbackSrv
#### errorHandlingSrv
#### error -- error message
#### response -- service return
#### relay -- publicly accessible peer
### ...