Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/acton.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/sh

wget -q -O - https://apt.acton-lang.io/acton.gpg | sudo apt-key add -
echo "deb [arch=amd64] http://apt.acton-lang.io/ bullseye main" | sudo tee /etc/apt/sources.list.d/acton.list
sudo apt-get update
sudo apt-get install -qy acton
actonc --version
5 changes: 5 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
lang: [
acton,
c,
chapel,
cpp,
Expand Down Expand Up @@ -68,6 +69,9 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install acton
if: matrix.lang == 'acton'
run: ./.github/acton.sh
- name: Install rust stable
uses: actions-rs/toolchain@v1
if: matrix.lang == 'rust' || matrix.lang == 'wasm'
Expand Down Expand Up @@ -259,6 +263,7 @@ jobs:
with:
name: build
path: bench/build/
- run: ./.github/acton.sh
- run: ./.github/dotnet.sh
# - run: ./.github/graalvm.sh
# - run: ./.github/graalvm-node.sh
Expand Down
7 changes: 7 additions & 0 deletions bench/algorithm/helloworld/1.act
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

actor main(env):
if len(env.argv) > 1:
print("Hello world %s!" % env.argv[1])
else:
print("Hello world !")
await async env.exit(0)
57 changes: 57 additions & 0 deletions bench/algorithm/pidigits/1.act
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Acton port of https://github.com/actonlang/Programming-Language-Benchmarks/blob/main/bench/algorithm/pidigits/4.py
actor main(env):
n = int(env.argv[1])

var tmp1 = 0
var tmp2 = 0

var acc = 0
var den = 1
var num = 1

def extract_Digit(nth):
tmp1 = num * nth
tmp2 = tmp1 + acc
tmp1 = tmp2 // den

return tmp1

def eliminate_Digit(d):
acc = acc - den * d
acc = acc * 10
num = num * 10

def next_Term(k):
k2=k*2+1
acc = acc + num * 2
acc = acc * k2
den = den * k2
num = num * k

var i=0
var k=0
var res = ""
while i<n:
k+=1
next_Term(k)

if num > acc:
continue

d=extract_Digit(3)
if d!=extract_Digit(4):
continue

res += chr(48+d)
i += 1
if i % 10 == 0:
print("%s\t:%d" % (res, i))
res = ""
eliminate_Digit(d)
remainder = i % 10
if remainder != 0:
spaces = ""
for j in range(0, (10-(len(res))), 1):
spaces += " "
print("%s%s\t:%d" % (res, spaces, i))
await async env.exit(0)
19 changes: 19 additions & 0 deletions bench/bench_acton.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
lang: acton
problems:
- name: helloworld
source:
- 1.act
- name: pidigits
source:
- 1.act
source_rename_to: app.act
environments:
- os: linux
compiler: actonc
compiler_version_command: actonc --version
version: latest
build: actonc app.act
after_build:
- mv app out
out_dir: out
run_cmd: app