Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
sml2scm (version 0.0) Eijiro Sumii (sumii@is.s.u-tokyo.ac.jp) http://www.is.s.u-tokyo.ac.jp/~sumii/pub/ Sun 25 Oct 15:25:23 JST 1998 INTRODUCTION ============ This is a source-to-source translator from core SML (SML without modules) to Scheme. It is implemented on the basis of The ML Kit Version 1. The compiler in The ML Kit translates core SML to an extension of the lambda calculus. I hacked it to pretty-print the lambda expressions as scheme programs. For details of The ML Kit Version 1, see README.orig and: http://www.diku.dk/research-groups/topps/activities/kit2/mlkit1.html WARNING ======= This implementation is rather immature. It may have many flaws. If you find any serious flaw (not mentioned below), I'll appreciate your report, though I'm not sure whether I can fix it. KNOWN FLAWS =========== o Many features (e.g., I/O, real number operations, etc.) are unimplemented. o Scheme codes generated by sml2scm are unreadable. o Translation of some data types (e.g. lists, pairs, etc) are mysterious. For example, ["foo", "bar", "hoge"] is translated to (vector (vector "foo" (vector (vector "bar" (vector (vector "hoge" (vector '() 1)) 0)) 0)) 0) instead of '("foo" "bar" "hoge"). This is due to the internal representation of the original compiler. o You can't use any values with flexible record types, e.g. #3, #foo, (fn {bar: int, ...} => bar), etc. This is an essential flaw in the original compiler, and not easy to fix. o Scheme codes generated by sml2scm are multi-thread unsafe, especially in exception handling. INSTALLATION ============ (0) tar vzxf sml2scm-0.0.tar.gz (1) cd sml2scm-0.0/src/ (2) Edit Makefile. Set NJSML to your SML/NJ (preferably version 0.93) with The Edinburgh SML Library. (3) make (4) mv kit sml2scm/sml2scm USAGE ===== (1) cd sml2scm-0.0/src/sml2scm/ (2) ./sml2scm (3) Type `eval ()' for interactive session, or `evalFile "filename"' for batch translation. (4) Copy & paste the Scheme program between `; sml2scm BEGIN' and `; sml2scm END'. Before executing the Scheme program, you have to load "sml2scm.scm" and "prelude.scm". ACKNOWLEDGMENTS =============== I'm grateful for The ML Kit, of course. :) I'd also like to thank the members of Yonezawa & Kobayashi Laboratory for their assistance.