Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Big performance improvement for compiled libraries by allowing cross …
…assembly method references. Compiled libraries are now loaded from disk, and not memory anymore. Add optimizer pass to eliminate tail calls if the callee can be proven to be non-recursive. Udpate bootfile. git-tfs-id: [https://tfs.codeplex.com:443/tfs/TFS02]$/IronScheme;C115179
- Loading branch information
Showing
16 changed files
with
9,464 additions
and
9,315 deletions.
There are no files selected for viewing
Binary file not shown.
685 changes: 344 additions & 341 deletions
685
IronScheme/IronScheme.Console/lib/ironscheme/typed/fixnums.sls
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
(library (foo2) | ||
(export run) | ||
(import | ||
(except (ironscheme) define + - < = time fx+ fx- fx<? fx=?) | ||
(ironscheme typed) | ||
(ironscheme syntax) | ||
(only (ironscheme datetime) measure) | ||
(rename (only (ironscheme typed fixnums) fx+ fx- fx<? fx=?) | ||
(fx+ +) | ||
(fx- -) | ||
(fx<? <) | ||
(fx=? =))) | ||
|
||
(define-syntax-case (define (name arg ...) body ...) | ||
#'(define: (name (arg : fixnum) ... -> fixnum) | ||
body ...)) | ||
|
||
(define-syntax-rule (time expr) | ||
(measure 100 expr)) | ||
|
||
(define (ack m n) | ||
(cond | ||
[(= m 0) (+ n 1)] | ||
[(= n 0) (ack (- m 1) 1)] | ||
[else (ack (- m 1) (ack m (- n 1)))])) | ||
|
||
(define (fib n) | ||
(if (< n 2) | ||
n | ||
(+ (fib (- n 1)) (fib (- n 2))))) | ||
|
||
(define (tak x y z) | ||
(if (not (< y x)) | ||
z | ||
(tak (tak (- x 1) y z) | ||
(tak (- y 1) z x) | ||
(tak (- z 1) x y)))) | ||
|
||
(define (run) | ||
(ack 3 1) | ||
(time (ack 3 9)) | ||
(fib 10) | ||
(time (fib 33)) | ||
(tak 18 12 6) | ||
(time (tak 21 16 6)) | ||
0)) | ||
(library (foo2) | ||
(export run) | ||
(import | ||
(except (ironscheme) define + - < = time fx+ fx- fx<? fx=?) | ||
(ironscheme typed core) | ||
(ironscheme syntax shorthand) | ||
(only (ironscheme datetime) measure) | ||
(rename (only (ironscheme typed fixnums) fx+ fx- fx<? fx=?) | ||
(fx+ +) | ||
(fx- -) | ||
(fx<? <) | ||
(fx=? =))) | ||
|
||
(define-syntax-rule (define (name arg ...) body ...) | ||
#'(define: (name (arg : fixnum) ... -> fixnum) | ||
body ...)) | ||
|
||
(define-syntax-rule (time expr) | ||
(measure 100 expr)) | ||
|
||
(define (ack m n) | ||
(cond | ||
[(= m 0) (+ n 1)] | ||
[(= n 0) (ack (- m 1) 1)] | ||
[else (ack (- m 1) (ack m (- n 1)))])) | ||
|
||
(define (fib n) | ||
(if (< n 2) | ||
n | ||
(+ (fib (- n 1)) (fib (- n 2))))) | ||
|
||
(define (tak x y z) | ||
(if (not (< y x)) | ||
z | ||
(tak (tak (- x 1) y z) | ||
(tak (- y 1) z x) | ||
(tak (- z 1) x y)))) | ||
|
||
(define (run) | ||
(ack 3 1) | ||
(time (ack 3 9)) | ||
(fib 10) | ||
(time (fib 33)) | ||
(tak 18 12 6) | ||
(time (tak 21 16 6)) | ||
0)) |
Oops, something went wrong.