Skip to content

Commit

Permalink
Ironscheme fixes (#71)
Browse files Browse the repository at this point in the history
* Fixes for IronScheme

* Update gitignore for dotnet and nuget stuff

* Update README.org

* Update README.org

Add note about IronScheme version

* Fix import
  • Loading branch information
leppie authored Jul 29, 2024
1 parent cdf40ef commit 8ed2d74
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
.mosh
.cache
outputs

.dotnet
.local/share/NuGet
11 changes: 5 additions & 6 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Schemes that should work:
- [[http://gambitscheme.org/wiki/index.php/Main_Page][GambitC]] (=gambitc=)
- [[http://practical-scheme.net/gauche/][Gauche]] (=gauche=)
- [[http://www.gnu.org/software/guile/][Guile]] (=guile=)
- [[https://github.com/leppie/IronScheme][IronScheme]] (=ironscheme=)
- [[https://github.com/IronScheme/IronScheme][IronScheme]] (=ironscheme=)
- [[http://www.gnu.org/software/kawa/][Kawa]] (=kawa=)
- [[http://www.larcenists.org/][Larceny]] (=larceny=)
- [[https://scheme.fail/][Loko]] (=loko=)
Expand Down Expand Up @@ -76,16 +76,15 @@ sudo raco pkg install --scope installation r7rs
#+END_SRC

*** IronScheme
Precompile system libraries (optional). It is still going to be slow.
#+BEGIN_SRC
echo "(compile-system-libraries)" | mono IronScheme.Console-v4.exe
#+END_SRC
Install the latest version of .NET Runtime (currently 9.0-preview, requires at least IronScheme 1.0.357) from https://dotnet.microsoft.com/en-us/download/dotnet .

The default binary for IronScheme (can be changed by exporting IRONSCHEME in your shell before running bench) is called =ironscheme=.

If you unpack IronScheme in your home, you can create a shell script like the following:
#+BEGIN_SRC
#!/bin/bash
mono ~/IronScheme/IronScheme.Console-v4.exe -nologo -emacs $*
export DOTNET_CLI_TELEMETRY_OPTOUT=1
dotnet ~/IronScheme/IronScheme.ConsoleCore.dll $*
#+END_SRC
and put that somewhere in your =$PATH=.
*** Stalin
Expand Down
1 change: 0 additions & 1 deletion bench
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@ ironscheme_exec ()
sed -i -e 's/^(define (bitwise-and[[:blank:]].*).*$/#;(excluded/g' $1
sed -i -e 's/^(define (div[[:blank:]].*).*$/#;(excluded/g' $1
sed -i -e 's/^(define (mod[[:blank:]].*).*$/#;(excluded/g' $1
sed -i -e 's/^(define (partition[[:blank:]].*).*$/#;(excluded/g' $1

# R6RS compat failure: gcbench
# failures due to Mono: cpstak, fft, pi, pnpoly, quicksort
Expand Down
2 changes: 1 addition & 1 deletion inputs/matrix.input
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
((1 1 1 1 1) (1 1 1 1 -1) (1 1 1 -1 1)
(1 1 -1 1 1) (1 -1 1 1 -1) (1 -1 -1 -1 1))
((1 1 1 1 1) (1 1 1 1 -1) (1 1 1 -1 1)
(1 1 -1 1 1) (1 -1 1 1 1) (1 -1 -1 -1 -1)))))
(1 1 -1 1 1) (1 -1 1 1 1) (1 -1 -1 -1 -1)))
24 changes: 23 additions & 1 deletion src/IronScheme-prelude.scm
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
(import (except (ironscheme) time) (srfi :19) (srfi :112))
(import
(except (ironscheme) time define-record-type partition)
(rename (only (ironscheme) define-record-type) (define-record-type r6rs:define-record-type))
(srfi :19)
(srfi :112))

(define-syntax define-record-type
;; Simplistic R7RS to R6RS define-record-type transformation.
(syntax-rules ()
((define-record-type name
(make-name param ...)
name?
(field-name field-ref field-set!)
...)
(r6rs:define-record-type (name make-name name?)
(protocol
(lambda (new)
(lambda (param ...)
(new param ...))))
(fields
(mutable field-name field-ref field-set!)
...)))))

(define (exact-integer? i)
(and (integer? i) (exact? i)))
(define (square x)
Expand Down

0 comments on commit 8ed2d74

Please sign in to comment.