Skip to content

main.aug ​

String processing benchmark · Source and specification

Files in this project

Code ​

aug
// aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
int iterations = 20000
int index = 0
int checksum = 0
while index < iterations:
    parts = "August,clear,local,checked".split(separator=",")
    for part in parts:
        checksum = checksum + part.length()
    index = index + 1
print(value=checksum)
aug
// aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
int iterations = 20000
int index = 0
int checksum = 0
while index < iterations {
    parts = "August,clear,local,checked".split(separator=",")
    for part in parts {
        checksum = checksum + part.length()
    }
    index = index + 1
}
print(value=checksum)

Compiled specification ​

Interactions and sequences

Startup ​

It sets iterations to 20000. It sets index and checksum separately, each to 0. While index is less than iterations, it sets parts to split on "August,clear,local,checked" with separator ",". For each part in a snapshot of parts, it increases checksum by the byte length of part. source

After the loop, it increases index by 1. After the loop, it prints checksum. source

Built-in operations follow the language reference.

Last updated:

The world runs on language