From 2ac4c961fe6ac8a5040fc842bd1b45520277046e Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Thu, 7 Jan 2021 23:16:56 +0200
Subject: [PATCH] Updates.

Changes I had laying around but didn't commit. The README should be
readable now.
---
 .gitignore             |  2 ++
 Dockerfile             | 11 +++++++++--
 LICENSE => LICENSE.txt |  0
 Makefile               | 15 +++++++++++----
 README.rst             | 13 +++++++++++--
 docker-compose.yml     |  8 ++++++--
 6 files changed, 39 insertions(+), 10 deletions(-)
 rename LICENSE => LICENSE.txt (100%)

diff --git a/.gitignore b/.gitignore
index 3cc1bed..914048e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,5 @@ a.out
 *.pyc
 __pycache__/*
 *.swp
+prime
+go
diff --git a/Dockerfile b/Dockerfile
index 8d76979..52d5715 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,7 +3,11 @@ ENV LEIN_VERSION=2.5.3
 ENV LEIN_ROOT=value
 WORKDIR /tmp
 RUN apt-get update && \
-    apt-get install -y python \
+    apt-get install -y python-dev \
+                       python-pip \
+                       build-essential \
+                       llvm3.7-dev \
+                       python-numpy \
                        python3 \
                        pypy \
                        lua5.1 \
@@ -18,8 +22,10 @@ RUN apt-get update && \
                        clojure1.6 \
                        tcl \
                        time \
+                       golang \
                        wget && \
     mkdir /tmp/leiningen && \
+    pip install numba && \
     wget --quiet https://github.com/technomancy/leiningen/archive/$LEIN_VERSION.tar.gz -O - | \
     tar -xz -C /tmp/leiningen/ --strip-components=1 && \
     mv /tmp/leiningen/bin/lein-pkg /usr/local/bin/lein && \
@@ -27,7 +33,8 @@ RUN apt-get update && \
     wget --quiet \
         https://github.com/technomancy/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.zip \
         -O /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar && \
-    rm -rf rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 COPY ./ /benchmark
 WORKDIR /benchmark
 RUN make
diff --git a/LICENSE b/LICENSE.txt
similarity index 100%
rename from LICENSE
rename to LICENSE.txt
diff --git a/Makefile b/Makefile
index 400d567..c7af45a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,13 @@
 .PHONY: all test clean c clojure
-ROUNDS = 100000
+ROUNDS ?= 100000
 
-all: c clojure
+.PHONY: all
+all: c clojure go
 
+.PHONY: c
 c: a.out
 
+.PHONY: clojure
 clojure: target/uberjar
 
 target/uberjar:
@@ -13,10 +16,14 @@ target/uberjar:
 a.out:
 	gcc --std=c99 -Wall -lm -O3 prime.c
 
+.PHONY: clean
 clean:
-	- rm -fr a.out __pycache__
-	cd prime.clj; lein clean
+	git clean -fdX
 
+go: prime.go
+	go build -o go prime.go
+
+.PHONY: all
 test: all
 	@ time -f "%C : %E seconds" ./a.out $(ROUNDS) > /dev/null
 	@ time -f "%C : %E seconds" java -jar prime.clj/target/uberjar/*-standalone.jar $(ROUNDS) > /dev/null
diff --git a/README.rst b/README.rst
index 8fd4205..496b3a5 100644
--- a/README.rst
+++ b/README.rst
@@ -21,22 +21,25 @@ Added languages
 Usage
 -----
 Build:
+
 .. code:: shell
 
     make
 
 Clean:
+
 .. code:: shell
 
     make clean
 
 Test:
+
 .. code:: shell
 
     make test
 
-Also, Docker and Docker Compose are supported (so just run :code:
-`docker-compose up`).
+Also, Docker and Docker Compose are supported (so just run
+:code:`docker-compose up`).
 
 History
 -------
@@ -46,3 +49,9 @@ structure. But I had difficulties expressing what I wanted so I first wrote the
 program in Python. After I had the program written in both languages I did the
 obvious thing, I timed them. From there on Barak implemented the program in PHP
 and we implemented it in C. We hope to have many more languages tested.
+
+License
+-------
+
+This software is licensed under the BSD 3-clause license (see the
+:code:`LICENSE.txt` file).
diff --git a/docker-compose.yml b/docker-compose.yml
index f44205e..e2f40e1 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,2 +1,6 @@
-testbed:
-    build: ./
+---
+version: '3'
+services:
+  estbed:
+    build:
+      context: ./
-- 
GitLab