aquavm/README.md

38 lines
913 B
Markdown
Raw Normal View History

2020-09-30 22:24:30 +03:00
# Aquamarine
2020-09-18 14:05:43 +03:00
Aquamarine is a distributed choreography language & platform
2020-09-30 22:24:30 +03:00
## AIR
The current version supports the following instructions:
- call
- par
- seq
- fold
- next
- null
2020-09-30 22:24:30 +03:00
## Examples
2020-09-30 22:28:56 +03:00
```lisp
(seq (
(call (%current_peer_id1% (local_service_id local_fn_name) () result_name_1))
(call (remote_peer_id (service_id fn_name) () result_name_2))
)),
2020-09-30 22:24:30 +03:00
```
This instruction sequence contains two call instructions in the sequential order:
2020-09-30 22:24:30 +03:00
1. call a function with `local_fn_name` name of a local service with `local_service_id` id and bind result to `result_name`
2. call a remote peer with `remote_peer_id` id
```lisp
(fold (Iterable i
(seq (
(call (%current_peer_id% (local_service_id local_fn_name) (i) acc[]))
(next i)
)
)))
```
This example is an analog of left fold. It iterates over `Iterable` and on each iteration calls `local_service_id` and puts result to `acc`.