diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91a1092..60c303c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,28 +25,30 @@ jobs: - 08_ruby - 09_forth - 10_lua - - 11_php - - 12_erlang - - 13_crystal - - 14_scala - - 15_csharp - - 16_coffeescript - - 17_kotlin - - 18_java - - 19_deno - - 20_node - - 21_go - - 22_bun - - 23_fortran - - 24_rust - - 25_cpp-clang - - 26_cpp-gcc - - 27_c-clang - - 28_c-gcc - - 29_nim - - 30_pascal - - 31_zig - - 32_assembly + - 11_ocaml + - 12_php + - 13_erlang + - 14_crystal + - 15_scala + - 16_csharp + - 17_coffeescript + - 18_kotlin + - 19_java + - 20_deno + - 21_node + - 22_go + - 23_bun + - 24_fortran + - 25_rust + - 26_cpp-clang + - 27_cpp-gcc + - 28_c-clang + - 29_c-gcc + - 30_nim + - 31_pascal + - 32_zig + - 33_assembly + - 34_ocaml runs-on: ubuntu-latest container: image: acheronfail/count diff --git a/Dockerfile b/Dockerfile index 355247d..506f13c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London" RUN apt-get update && apt-get install -y \ bc build-essential clang curl default-jdk default-jre erlang fp-compiler gdb \ ghc lldb gforth gfortran git gnu-smalltalk gnucobol3 golang jq kotlin lua5.4 \ - mono-complete moreutils nasm php ruby scala swi-prolog tar tcl unzip wget \ - xz-utils \ + mono-complete moreutils nasm ocaml php ruby scala swi-prolog tar tcl unzip \ + wget xz-utils \ && apt-get clean RUN curl -fSL https://deb.nodesource.com/setup_lts.x | bash - \ && apt-get install -y nodejs \ @@ -41,6 +41,6 @@ RUN cd && curl -fSL "$(curl -fSL https://ziglang.org/download/index.json | jq -r && rm zig.tar.xz ENV PATH="/root/.zig:$PATH" -RUN cargo install max_rss --version 0.4.0 +RUN cargo install max_rss --version 0.4.1 WORKDIR /var/count diff --git a/count.ml b/count.ml new file mode 100644 index 0000000..6712f48 --- /dev/null +++ b/count.ml @@ -0,0 +1,7 @@ +let () = + let target = int_of_string Sys.argv.(1) in + let rec loop i = + if i < target + then loop ((i + 1) lor 1) + else Printf.printf "%d\n" i + in loop 0 diff --git a/justfile b/justfile index d146897..e3cf6ca 100644 --- a/justfile +++ b/justfile @@ -16,7 +16,7 @@ docker-sh: # NOTE: there are issues if you try to build this on an arm macbook via rosetta emulation # - mono fails to install (https://github.com/mono/mono/issues/21423) -# - getting erlang version segfaults +# - running anything with erlang segfaults docker-build: docker build --progress=plain --platform 'linux/amd64' -t {{tag}} . @@ -320,3 +320,7 @@ build-csharp: (_check "mcs mono") && (_size "count.exe") (_sizet "bytecode") mono --version | head -1 >> VERSION mcs -o+ ./count.cs echo 'mono ./count.exe {{i}}' > CMD + +build-ocaml: (_check "ocaml") + ocaml --version > VERSION + echo 'ocaml ./count.ml {{i}}' > CMD