• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A categorical programming language


Commit MetaInfo

修订版08f8e5d64c1756b567b874d8fd61effbf748eb89 (tree)
时间2021-09-24 11:26:25
作者Corbin <cds@corb...>
CommiterCorbin

Log Message

Create a new Nix-assembled entrypoint.

更改概述

差异

--- /dev/null
+++ b/cammy.sh
@@ -0,0 +1,36 @@
1+#!@bash@/bin/bash
2+
3+set -eux -o pipefail
4+
5+export CHICKEN_REPOSITORY_PATH=@CHICKEN_REPOSITORY_PATH@
6+export CHICKEN_INCLUDE_PATH=@CHICKEN_INCLUDE_PATH@
7+
8+frame="@frame@/bin/frame"
9+jelly="@jelly@/bin/jelly"
10+movelist="@movelist@/bin/movelist"
11+
12+# Configure a temporary directory.
13+tmpdir=$(mktemp -d)
14+
15+# Get the hive and the program to compile.
16+hive="$1"
17+input="$2"
18+
19+fullname=$(basename -- $input)
20+name="${fullname%.*}"
21+
22+# Pull from the frame and clarify the jelly.
23+<$input $frame $hive | $jelly >"$tmpdir/program.cammy"
24+cat "$tmpdir/program.cammy"
25+
26+# Typecheck with movelist.
27+ty=$($movelist type-check <"$tmpdir/program.cammy")
28+
29+# Compute the final piece.
30+sed -i -e 's,case,cammy-case,g' -e 's,cons,cammy-cons,g' -e 's,map,cammy-map,g' "$tmpdir/program.cammy"
31+cat stub.scm <(echo '(cammy-run') "$tmpdir/program.cammy" <(echo "'$ty)") >"$tmpdir/$name.scm"
32+# Compile with Chicken.
33+@chicken@/bin/csc -static -O3 -o "$name" "$tmpdir/$name.scm"
34+
35+# Clean up temporary files.
36+rm -r "$tmpdir"
--- a/eggs.nix
+++ b/eggs.nix
@@ -16,20 +16,6 @@ rec {
1616 ];
1717 };
1818
19- mini-kanren = eggDerivation {
20- name = "mini-kanren-1.2.0";
21-
22- src = fetchegg {
23- name = "mini-kanren";
24- version = "1.2.0";
25- sha256 = "0zwwgkqan4gxqr80vjf4k3x6qr2m4j4dczdxkfxkchdwmmgp7r8m";
26- };
27-
28- buildInputs = [
29- srfi-1
30- ];
31- };
32-
3319 r7rs = eggDerivation {
3420 name = "r7rs-1.0.5";
3521
@@ -60,6 +46,20 @@ rec {
6046 ];
6147 };
6248
49+ srfi-128 = eggDerivation {
50+ name = "srfi-128-0.11";
51+
52+ src = fetchegg {
53+ name = "srfi-128";
54+ version = "0.11";
55+ sha256 = "1lq513l0lniyih9xar1jfpan4iazp39lj6bsp8cn7yllbki5xhkf";
56+ };
57+
58+ buildInputs = [
59+ srfi-13
60+ ];
61+ };
62+
6363 srfi-13 = eggDerivation {
6464 name = "srfi-13-0.3.2";
6565
@@ -116,6 +116,20 @@ rec {
116116 ];
117117 };
118118
119+ srfi-160 = eggDerivation {
120+ name = "srfi-160-0.5.3";
121+
122+ src = fetchegg {
123+ name = "srfi-160";
124+ version = "0.5.3";
125+ sha256 = "033j5c25s7xr6in4z4w8kqj2xy69bd254ilf7c0nal020pb2yp2r";
126+ };
127+
128+ buildInputs = [
129+ srfi-128
130+ ];
131+ };
132+
119133 srfi-189 = eggDerivation {
120134 name = "srfi-189-0.1";
121135
--- a/eggs.scm
+++ b/eggs.scm
@@ -1,5 +1,5 @@
1-srfi-6
21 srfi-144
2+srfi-160
33 srfi-189
44 matchable
55 stb-image-write
--- a/jelly/src/main.rs
+++ b/jelly/src/main.rs
@@ -40,6 +40,9 @@ fn main() -> std::io::Result<()> {
4040 // Needed with pair-precompose as a special case.
4141 rw!("pair-factor"; "(pair ?r ?r)" => "(comp ?r (pair id id))"),
4242
43+ // Turn braided products into symmetric products.
44+ rw!("pair-braiding-symm"; "(comp (pair snd fst) (pair snd fst))" => "id"),
45+
4346 // free for left
4447 rw!("left-elim-case"; "(comp left (case ?f ?g))" => "?f"),
4548 // free for right
--- a/movelist/default.nix
+++ b/movelist/default.nix
@@ -18,7 +18,7 @@ in pkgs.stdenv.mkDerivation {
1818 src = ./.;
1919
2020 buildPhase = ''
21- csc -O3 -o movelist movelist.scm
21+ csc -static -O3 -o movelist movelist.scm
2222 '';
2323
2424 installPhase = ''
--- a/shell.nix
+++ b/shell.nix
@@ -12,7 +12,7 @@ in pkgs.stdenv.mkDerivation {
1212 gdb
1313 # debugging stub.scm
1414 chicken rlwrap ] ++
15- (with eggs; [ srfi-144 srfi-189 mini-kanren ]) ++ [
15+ (with eggs; [ srfi-144 srfi-160 srfi-189 stb-image-write ]) ++ [
1616 # maintaining movelist/
1717 egg2nix
1818 # maintaining frame/