pollrobots / scheme Goto Github PK
View Code? Open in Web Editor NEWAn R7RS Scheme implemented in WebAssembly
License: MIT License
An R7RS Scheme implemented in WebAssembly
License: MIT License
implement and test assq
from the base library
implement and test boolean?
from the base library
implement and test assv
from the base library
implement and test bytevector-length
from the base library
implement and test bytevector?
from the base library
implement and test boolean=?
from the base library
In particular this is a problem with < in some circumstances it will delete all text from and including that character. I assume this is an html sanitizing issue.
implement and test call-with-values
from the base library
implement and test call-with-current-continuation
from the base library
implement and test bytevector-copy
from the base library
implement and test cadr
from the base library
I'm assuming that monaco is being brought in rather than being pulled from the CDN. Obviously this is bad.
implement and test bytevector-u8-set!
from the base library
implement and test binary-port?
from the base library
This doesn't work
> (define (y x) (if (= 1 x) 'y 'n))
> (y 1)
y
> (y 0)
y
This works though
> (define a 0)
> (if (= 1 a) 'y 'n)
n
> (set! a 1)
> (if (= 1 a) 'y 'n)
y
implement and test caar
from the base library
This is an example that helped me find an error in BiwaScheme and its call/cc implementation biwascheme/biwascheme#257. Here is the code. You can use it to test your implementation:
(call/cc (lambda (return)
(let ((n 5)
(result (list))
(k #f))
(set! result (append result (list (call/cc (lambda (return)
(set! k return)
"Hello")))))
(when #t
(if (zero? n)
(return result))
(set! n (- n 1))
(k (string-append "Hello <" (number->string n) ">"))))))
It should return:
("Hello <0>")
All elements are implemented but git weird:
<error args 4>
It should raise/return an error instead
implement and test call-with-port
from the base library
implement and test bytevector-u8-ref
from the base library
implement and test bytevector-copy!
from the base library
implement and test call/cc
from the base library
> (define fact
(lambda (x)
(letrec ((inner (lambda (a n)
(if (= n 1)
a
(inner (* a n) (- n 1))))))
(inner 1 x))))
> (/ (fact 14))
RuntimeError: unreachable
at grisu-2-digit-gen (http://localhost:8080/wasm/scheme.wasm:wasm-function[268]:0xbbce)
at grisu-2 (http://localhost:8080/wasm/scheme.wasm:wasm-function[269]:0xbce9)
at real->string (http://localhost:8080/wasm/scheme.wasm:wasm-function[272]:0xbf91)
at print-real (http://localhost:8080/wasm/scheme.wasm:wasm-function[136]:0x7002)
at print (http://localhost:8080/wasm/scheme.wasm:wasm-function[123]:0x6bd4)
at SchemeRuntime.print (http://localhost:8080/main.849f9b53fd62eda874cf.js:189304:22)
at SchemeRuntime.evalInput (http://localhost:8080/main.849f9b53fd62eda874cf.js:189533:18)
at SchemeRuntime.processLine (http://localhost:8080/main.849f9b53fd62eda874cf.js:189500:26)
at App.onInput (http://localhost:8080/main.849f9b53fd62eda874cf.js:191345:41)
at Object.onInput (http://localhost:8080/main.849f9b53fd62eda874cf.js:191396:291)
implement and test bytevector
from the base library
implement and test begin
from the base library
i.e 1+1e-2i
should parse to 1+0.01i
This is caused by the complex parser splitting the string on the rightmost sign character
Output from display should not be colorized, but when print is called to print the result of an eval, that should be colorized
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.