mirror of
https://github.com/fluencelabs/aqua-book
synced 2025-04-24 23:22:13 +00:00
1.3 KiB
1.3 KiB
Basics
Aqua is an opinionated domain-specific language. It's structured with significant indentation.
-- Comments begin with double-dash, ends on the end of line
func foo(): -- Comments can follow the code
-- Body of the block expression is indented
bar(5)
Values in Aqua have types. Types of values are designated by a colon :
, like in the function arguments definition below. The 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 <-
.
-- 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:
Execution:
- Topology – how to express where the code should be executed
- Execution flow – control structures
Computations:
Advanced parallelism:
Code management:
Reference: