aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Sato <shinnya.sato@gmail.com>2022-04-27 16:59:00 +0900
committerShinya Sato <shinnya.sato@gmail.com>2022-04-27 16:59:00 +0900
commitd5b1f9b78b7fe4590cf91d72772d3c773d7daed1 (patch)
treec71e5f12b2733bb0e3ef65734e6ff5a685a1c989
parent4508b877a0312ff0feeba6287e1224ed3d0e0a4a (diff)
parent2de302bcb3fa7e12c83a58909232a527c4d5372e (diff)
downloadinpla-d5b1f9b78b7fe4590cf91d72772d3c773d7daed1.tar.gz
inpla-d5b1f9b78b7fe4590cf91d72772d3c773d7daed1.zip
Merge branch 'develop'
-rw-r--r--README.md12
-rw-r--r--comparison/Haskell/ack3-11.hs3
-rw-r--r--comparison/Haskell/bsort-40000.hs2
-rw-r--r--comparison/Haskell/fib38.hs3
-rw-r--r--comparison/Haskell/isort-40000.hs7
-rw-r--r--comparison/Haskell/qsort-800000.hs4
-rw-r--r--comparison/Inpla/src/bsort-40000-reuse.in1
-rw-r--r--comparison/Inpla/src/bsort-40000.in1
-rw-r--r--comparison/Inpla/src/fib-38-reuse.in7
-rw-r--r--comparison/Inpla/src/fib-38.in7
-rw-r--r--comparison/Inpla/src/isort-40000-reuse.in2
-rw-r--r--comparison/Inpla/src/isort-40000.in2
-rw-r--r--comparison/Inpla/src/qsort-800000-reuse.in3
-rw-r--r--comparison/Inpla/src/qsort-800000.in3
-rw-r--r--comparison/Python/isort-40000.py2
-rw-r--r--comparison/Python/msort-800000.py1
-rw-r--r--comparison/Python/qsort-800000.py3
-rw-r--r--comparison/SML/ack3-11.sml1
-rw-r--r--comparison/SML/bsort-40000.sml2
-rw-r--r--comparison/SML/isort-40000.sml1
-rw-r--r--comparison/SML/msort-800000.sml3
-rw-r--r--src/.#-emacsI0w9oW1
22 files changed, 9 insertions, 62 deletions
diff --git a/README.md b/README.md
index f608dad..43dcc55 100644
--- a/README.md
+++ b/README.md
@@ -12,12 +12,12 @@ Inpla is a multi-threaded parallel interpreter of interaction nets. Once you wri
| | Haskell | OCaml | SML | Python | Inpla8 | Inpla8r |
| -------------- | :------: | :------: | :----: | :----: | :------: | :------: |
-| ack(3,11) | 2.31 | 0.46 | **0.41** | - | 0.82 | 0.70 |
-| fib 38 | 1.60 | **0.15** | 0.26 | 8.49 | 0.38 | 0.40 |
-| bsort 40000 | 34.81 | 35.52 | 11.17 | 76.72 | 3.03 | **2.42** |
-| isort 40000 | **0.02** | 7.44 | 2.97 | 36.63 | 1.18 | 1.18 |
-| qsort 800000 | **0.15** | - | 1.16 | 97.30 | 0.61 | 0.35 |
-| msort 800000 | 0.46 | - | 1.00 | 98.27 | 0.48 | **0.35** |
+| ack(3,11) | [2.31](comparison/Haskell/ack3-11.hs) | [0.46](comparison/OCaml/ack3_11.ml) | [**0.41**](comparison/SML/ack3-11.sml) | [-](comparison/Python/ack3-11.py) | [0.82](comparison/Inpla/src/ack-stream_3-11.in) | [0.70](comparison/Inpla/src/ack-stream_3-11-reuse.in) |
+| fib 38 | [1.60](comparison/Haskell/fib38.hs) | [**0.15**](comparison/OCaml/fib38.ml) | [0.26](comparison/SML/fib38.sml) | [8.49](comparison/Python/fib38.py) | [0.38](comparison/Inpla/src/fib-38.in) | [0.40](comparison/Inpla/src/fib-38-reuse.in) |
+| bsort 40000 | [34.81](comparison/Haskell/bsort-40000.hs) | [35.52](comparison/OCaml/bsort40000.ml) | [11.17](comparison/SML/bsort-40000.sml) | [76.72](comparison/Python/bsort-40000.py) | [3.03](comparison/Inpla/src/bsort-40000.in) | [**2.42**](comparison/Inpla/src/bsort-40000-reuse.in) |
+| isort 40000 | [**0.02**](comparison/Haskell/isort-40000.hs) | [7.44](comparison/OCaml/isort40000.ml) | [2.97](comparison/SML/isort-40000.sml) | [36.63](comparison/Python/isort-40000.py) | [1.18](comparison/Inpla/src/isort-40000.in) | [1.18](comparison/Inpla/src/isort-40000-reuse.in) |
+| qsort 800000 | [**0.15**](comparison/Haskell/qsort-800000.hs) | [-](comparison/OCaml/qsort800000.ml) | [1.16](comparison/SML/qsort-800000.sml) | [97.30](comparison/Python/qsort-800000.py) | [0.61](comparison/Inpla/src/qsort-800000.in) | [0.35](comparison/Inpla/src/qsort-800000-reuse.in) |
+| msort 800000 | [0.46](comparison/Haskell/msort-800000.hs) | [-](comparison/OCaml/msort800000.ml) | [1.00](comparison/SML/msort-800000.sml) | [98.27](comparison/Python/msort-800000.py) | [0.48](comparison/Inpla/src/msort-800000.in) | [**0.35**](comparison/Inpla/src/msort-800000-reuse.in) |
- **Comparison in execution time** with other implementations: **Haskell** (GHC version 8.10.7), **OCaml** (ocamlopt, the native-code compiler, version 4.08.1), **Standard ML of New Jersey** v110.74 (interpreter mode) and **Python** 3.8.5 in execution time.
diff --git a/comparison/Haskell/ack3-11.hs b/comparison/Haskell/ack3-11.hs
index 7c8f350..45b2853 100644
--- a/comparison/Haskell/ack3-11.hs
+++ b/comparison/Haskell/ack3-11.hs
@@ -4,6 +4,3 @@ ack m n = ack (m-1) (ack m (n-1))
main = print $ (ack 3 11)
-
-
-
diff --git a/comparison/Haskell/bsort-40000.hs b/comparison/Haskell/bsort-40000.hs
index 1940917..401ceaf 100644
--- a/comparison/Haskell/bsort-40000.hs
+++ b/comparison/Haskell/bsort-40000.hs
@@ -22,7 +22,6 @@ main = print $ bsort [3,2,8,5]
-}
-
randomList :: Int -> IO([Int])
randomList 0 = return []
randomList n = do
@@ -31,7 +30,6 @@ randomList n = do
return (r:rs)
-
main = do
list <- randomList 40000
let sorted = bsort list
diff --git a/comparison/Haskell/fib38.hs b/comparison/Haskell/fib38.hs
index 96040eb..658d228 100644
--- a/comparison/Haskell/fib38.hs
+++ b/comparison/Haskell/fib38.hs
@@ -4,6 +4,3 @@ fib n = fib (n - 2) + fib (n - 1)
main = print $ fib 38
-
-
-
diff --git a/comparison/Haskell/isort-40000.hs b/comparison/Haskell/isort-40000.hs
index f834d00..1abc148 100644
--- a/comparison/Haskell/isort-40000.hs
+++ b/comparison/Haskell/isort-40000.hs
@@ -1,5 +1,5 @@
{-
-(* http://www.codecodex.com/wiki/Insertion_sort#Standard_ML *)
+http://www.codecodex.com/wiki/Insertion_sort#Standard_ML
-}
import System.Random
@@ -25,12 +25,7 @@ randomList n = do
return (r:rs)
-
main = do
list <- randomList 40000
let sorted = isort list
print (take 10 sorted)
-
-
-
-
diff --git a/comparison/Haskell/qsort-800000.hs b/comparison/Haskell/qsort-800000.hs
index 492efef..2a9d60d 100644
--- a/comparison/Haskell/qsort-800000.hs
+++ b/comparison/Haskell/qsort-800000.hs
@@ -3,7 +3,6 @@
-}
import System.Random
-
qsort [] = []
qsort [x] = [x]
qsort (x:xs) = (qsort left) ++ [x] ++ (qsort right)
@@ -16,7 +15,6 @@ part pivot (x:xs)
where
(below, above) = part pivot xs
-
{-
main = print $ qsort [3,2,8,5]
-}
@@ -29,9 +27,7 @@ randomList n = do
return (r:rs)
-
main = do
list <- randomList 800000
let sorted = qsort list
print (take 10 sorted)
-
diff --git a/comparison/Inpla/src/bsort-40000-reuse.in b/comparison/Inpla/src/bsort-40000-reuse.in
index 8b6a386..3abd0ec 100644
--- a/comparison/Inpla/src/bsort-40000-reuse.in
+++ b/comparison/Inpla/src/bsort-40000-reuse.in
@@ -11,7 +11,6 @@ B(ret, int x) >< (int y):ys
-
const LIST_ELEM=40000;
MkRandList(ret) >< (int n)
diff --git a/comparison/Inpla/src/bsort-40000.in b/comparison/Inpla/src/bsort-40000.in
index 0120900..d0a5e1c 100644
--- a/comparison/Inpla/src/bsort-40000.in
+++ b/comparison/Inpla/src/bsort-40000.in
@@ -11,7 +11,6 @@ B(ret, int x) >< (int y):ys
-
const LIST_ELEM=40000;
MkRandList(ret) >< (int n)
diff --git a/comparison/Inpla/src/fib-38-reuse.in b/comparison/Inpla/src/fib-38-reuse.in
index 6b3d32b..e56fabd 100644
--- a/comparison/Inpla/src/fib-38-reuse.in
+++ b/comparison/Inpla/src/fib-38-reuse.in
@@ -4,13 +4,6 @@ Fib(r) >< (int n)
| n == 1 => r~1
| _ => Fib(cnt1)~(n-1), Fib(cnt2)~(n-2), (*L)Add(r,cnt2)~cnt1;
-/* Add is realised as built-in.
-Addd(r,n) >< (int m)
-=> Addd2(r,m) ~ n;
-
-Addd2(r,int m) >< (int n)
-=> r~(m+n);
-*/
Fib(r)~38;
r;
diff --git a/comparison/Inpla/src/fib-38.in b/comparison/Inpla/src/fib-38.in
index a79eb5b..925f5ff 100644
--- a/comparison/Inpla/src/fib-38.in
+++ b/comparison/Inpla/src/fib-38.in
@@ -4,13 +4,6 @@ Fib(r) >< (int n)
| n == 1 => r~1
| _ => Add(r,cnt2)~cnt1, Fib(cnt1)~(n-1), Fib(cnt2)~(n-2);
-/*
-Addd(r,n) >< (int m)
-=> Addd2(r,m) ~ n;
-
-Addd2(r,int m) >< (int n)
-=> r~(m+n);
-*/
Fib(r)~38;
r;
diff --git a/comparison/Inpla/src/isort-40000-reuse.in b/comparison/Inpla/src/isort-40000-reuse.in
index 00f0ecc..3e7e2d2 100644
--- a/comparison/Inpla/src/isort-40000-reuse.in
+++ b/comparison/Inpla/src/isort-40000-reuse.in
@@ -18,5 +18,3 @@ MkRandList(ret) >< (int n)
MkRandList(cnt)~(LIST_ELEM),
IS(ret)~cnt;
ret;
-
-
diff --git a/comparison/Inpla/src/isort-40000.in b/comparison/Inpla/src/isort-40000.in
index ff831a3..295f6f4 100644
--- a/comparison/Inpla/src/isort-40000.in
+++ b/comparison/Inpla/src/isort-40000.in
@@ -18,5 +18,3 @@ MkRandList(ret) >< (int n)
MkRandList(cnt)~(LIST_ELEM),
IS(ret)~cnt;
ret;
-
-
diff --git a/comparison/Inpla/src/qsort-800000-reuse.in b/comparison/Inpla/src/qsort-800000-reuse.in
index 8bf7a83..810e446 100644
--- a/comparison/Inpla/src/qsort-800000-reuse.in
+++ b/comparison/Inpla/src/qsort-800000-reuse.in
@@ -7,9 +7,6 @@ QS(ret) >< (int x):xs =>
// Note: `Append' is implemented as built-in.
-// Apnd(ret, a)~b --> ret ~ b@a
-//Apnd(ret, a) >< [] => ret~a;
-//Apnd(ret, a) >< x:xs => ret~(x:cnt), Apnd(cnt, a)~xs;
Part(int x, a, b) >< [] => a~(*L)[], b~(*R)[];
Part(int x, a, b) >< (int y):ys
diff --git a/comparison/Inpla/src/qsort-800000.in b/comparison/Inpla/src/qsort-800000.in
index e8913e8..8226655 100644
--- a/comparison/Inpla/src/qsort-800000.in
+++ b/comparison/Inpla/src/qsort-800000.in
@@ -7,9 +7,6 @@ QS(ret) >< (int x):xs =>
// Note: `Append' is implemented as built-in.
-// Apnd(ret, a)~b --> ret ~ b@a
-//Apnd(ret, a) >< [] => ret~a;
-//Apnd(ret, a) >< x:xs => ret~(x:cnt), Apnd(cnt, a)~xs;
Part(int x, a, b) >< [] => a~[], b~[];
Part(int x, a, b) >< (int y):ys
diff --git a/comparison/Python/isort-40000.py b/comparison/Python/isort-40000.py
index 6fbadb7..0bfc577 100644
--- a/comparison/Python/isort-40000.py
+++ b/comparison/Python/isort-40000.py
@@ -20,5 +20,3 @@ def mkRandList(n):
a = mkRandList(40000)
insert_sort(a)
#print(a)
-
-
diff --git a/comparison/Python/msort-800000.py b/comparison/Python/msort-800000.py
index f8b8bd1..fcb89e1 100644
--- a/comparison/Python/msort-800000.py
+++ b/comparison/Python/msort-800000.py
@@ -51,6 +51,5 @@ def mkRandList ( n ):
return a
a = mkRandList(800000)
-#a = mkRandList(8)
mergeSort(a)
#print(a)
diff --git a/comparison/Python/qsort-800000.py b/comparison/Python/qsort-800000.py
index 9a75977..b58bf1c 100644
--- a/comparison/Python/qsort-800000.py
+++ b/comparison/Python/qsort-800000.py
@@ -29,6 +29,5 @@ def mkRandList ( n ):
return a
a = mkRandList(800000)
-#a = mkRandList(8)
b = quickSort(a)
-#print(a)
+#print(b)
diff --git a/comparison/SML/ack3-11.sml b/comparison/SML/ack3-11.sml
index f1ea7f2..4668ddb 100644
--- a/comparison/SML/ack3-11.sml
+++ b/comparison/SML/ack3-11.sml
@@ -2,5 +2,4 @@ fun ack 0 n = n+1
| ack m 0 = ack (m-1) 1
| ack m n = ack (m-1) (ack m (n-1));
-
ack 3 11;
diff --git a/comparison/SML/bsort-40000.sml b/comparison/SML/bsort-40000.sml
index 48c3eb4..e892f09 100644
--- a/comparison/SML/bsort-40000.sml
+++ b/comparison/SML/bsort-40000.sml
@@ -26,5 +26,3 @@ end;
bsort (mkRandList 40000);
-
-
diff --git a/comparison/SML/isort-40000.sml b/comparison/SML/isort-40000.sml
index 973d6e6..a851dbd 100644
--- a/comparison/SML/isort-40000.sml
+++ b/comparison/SML/isort-40000.sml
@@ -8,7 +8,6 @@ fun insertsort [] = []
in insert(x, insertsort xs)
end;
-
(* mkRandList *)
local
val nextInt = Random.randRange(1,10000);
diff --git a/comparison/SML/msort-800000.sml b/comparison/SML/msort-800000.sml
index 2a33649..9209685 100644
--- a/comparison/SML/msort-800000.sml
+++ b/comparison/SML/msort-800000.sml
@@ -28,8 +28,6 @@ fun msort [] = []
end;
-
-
(* mkRandList *)
local
val nextInt = Random.randRange(1,10000);
@@ -42,4 +40,3 @@ end;
msort (mkRandList 800000);
-
diff --git a/src/.#-emacsI0w9oW b/src/.#-emacsI0w9oW
new file mode 100644
index 0000000..3ad3e07
--- /dev/null
+++ b/src/.#-emacsI0w9oW
@@ -0,0 +1 @@
+shinya@DESKTOP-O24CQQG.11248:1646292363 \ No newline at end of file