From fae17fbc77efac8ee788b87109aed99ae593fc1f Mon Sep 17 00:00:00 2001 From: acheronfail Date: Fri, 22 Dec 2023 19:12:31 +1100 Subject: [PATCH] add nim --- .github/workflows/ci.yml | 6 ++++++ count.nim | 7 +++++++ justfile | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 count.nim diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7def2d2..94ca98b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: - java - julia - kotlin + - nim - node - perl - php @@ -72,6 +73,11 @@ jobs: juliaup add release + wget -qO choosenim.sh https://nim-lang.org/choosenim/init.sh + bash ./choosenum.sh -y + echo "/root/.nimble/bin" >> $GITHUB_PATH + export PATH="/root/.nimble/bin:$PATH" + curl -fsSL https://crystal-lang.org/install.sh | sudo bash mkdir -p /opt/zig && cd $_ diff --git a/count.nim b/count.nim new file mode 100644 index 0000000..1af8e6f --- /dev/null +++ b/count.nim @@ -0,0 +1,7 @@ +import os, strutils + +var i: int = 0 +let target = parseInt(paramStr(1)) +while i < target: + i = (i + 1) or 1 +echo i diff --git a/justfile b/justfile index 8a80a4f..d35ca00 100644 --- a/justfile +++ b/justfile @@ -124,3 +124,7 @@ build-julia: (_check "julia") build-coffeescript: (_check "coffee") echo 'coffee ./count.coffee {{i}}' > CMD + +build-nim: (_check "nim") + nim compile --opt:speed ./count.nim + echo './count {{i}}' > CMD