Created
September 1, 2013 06:56
-
-
Save SaitoAtsushi/6402761 to your computer and use it in GitHub Desktop.
R6RS 向けベンチマーク (http://www.larcenists.org/benchmarks2009.html) を sagittarius で動かすためのパッチ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: bench | |
=================================================================== | |
--- bench (リビジョン 6659) | |
+++ bench (作業コピー) | |
@@ -1,4 +1,4 @@ | |
-#! /usr/bin/env bash | |
+#!/usr/bin/env bash | |
# For running R6RS benchmarks. | |
# | |
@@ -91,10 +91,11 @@ | |
# For both Solaris and Linux machines. | |
- LARCENY=${LARCENY:-"../../../larceny"} | |
+ LARCENY=${LARCENY:-"larceny.bin"} | |
PETIT=${PETIT:-"../../../petit-larceny"} | |
- PLTR6RS=${PLTR6RS:-"plt-r6rs"} | |
+ PLTR6RS=${PLTR6RS:-"Racket"} | |
YPSILON=${YPSILON:-"ypsilon"} | |
+ SAGITTARIUS=${SAGITTARIUS:-"sash"} | |
MOSH=${MOSH:-"mosh"} | |
PETITE=${PETITE:-"petite"} | |
@@ -119,6 +120,7 @@ | |
petite for Petite Chez | |
plt for PLT Scheme | |
ypsilon for Ypsilon | |
+ sagittarius for Sagittarius Scheme | |
all for all of the above | |
<benchmark> is the name of the benchmark(s) to run: | |
@@ -189,13 +191,12 @@ | |
larceny_comp () | |
{ | |
- echo "(import (larceny compiler)) (compile-file \"$1\")" \ | |
-| time "${LARCENY}" -err5rs -- -e "(repl-prompt values)" | |
+ : | |
} | |
larceny_exec () | |
{ | |
- time "${LARCENY}" --nocontract --r6rs --program "$1" < "$2" | |
+ time "${LARCENY}" -r6rs -program "$1" < "$2" | |
} | |
petit_comp () | |
@@ -234,6 +235,19 @@ | |
} | |
# ----------------------------------------------------------------------------- | |
+# Definitions specific to Sagittarius Scheme | |
+ | |
+sagittarius_comp () | |
+{ | |
+ : | |
+} | |
+ | |
+sagittarius_exec () | |
+{ | |
+ time "${SAGITTARIUS}" -n "$1" < "$2" | |
+} | |
+ | |
+# ----------------------------------------------------------------------------- | |
# Definitions specific to PLT Scheme | |
plt_comp () | |
@@ -256,7 +270,7 @@ | |
ypsilon_exec () | |
{ | |
- time "${YPSILON}" "$1" < "$2" | |
+ time "${YPSILON}" --heap-limit=1000 "$1" < "$2" | |
} | |
# ----------------------------------------------------------------------------- | |
@@ -409,6 +423,16 @@ | |
EXECCOMMANDS="" | |
;; | |
+sagittarius)NAME='Sagittarius' | |
+ COMP=sagittarius_comp | |
+ EXEC=sagittarius_exec | |
+ COMPOPTS="" | |
+ EXTENSION="sch" | |
+ EXTENSIONCOMP="sch" | |
+ COMPCOMMANDS="" | |
+ EXECCOMMANDS="" | |
+ ;; | |
+ | |
esac | |
{ | |
Index: src/dynamic.sch | |
=================================================================== | |
--- src/dynamic.sch (リビジョン 6659) | |
+++ src/dynamic.sch (作業コピー) | |
@@ -3,6 +3,9 @@ | |
(rnrs io simple) | |
(rnrs mutable-pairs)) | |
+(define (keyword->symbol e) | |
+ (string->symbol (string-append ":" (keyword->string e)))) | |
+ | |
;;; DYNAMIC -- Obtained from Andrew Wright. | |
;; Fritz's dynamic type inferencer, set up to run on itself | |
@@ -126,6 +129,8 @@ | |
(dynamic-parse-action-string-const e)) | |
((symbol? e) | |
(dynamic-parse-action-symbol-const e)) | |
+ ((keyword? e) | |
+ (dynamic-parse-action-symbol-const (keyword->symbol e))) | |
((vector? e) | |
(dynamic-parse-action-vector-const (map dynamic-parse-datum (vector->list e)))) | |
((pair? e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment