<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">Chibi Scheme and Spock both run in the browser. You can build Chibi Scheme with a WASM target; Spock is written in JavaScript.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 18, 2023 at 3:15 PM Winston W <<a href="mailto:winston@nitidbit.com">winston@nitidbit.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Gambit List—<br>
<br>
I'm searching for a way to write Lisp and have it run on a web browser as WASM, i.e. avoiding JS. I was hoping Gambit Scheme might be the key, by compiling Lisp —> (Gambit compiler) —> C —> (Clang) —> wasm. But I'm encountering problems. My current issue is the 'gambit.h' file checks for lots of things including `setjmp` which doesn't exist in WASM. Below is my test situation. Does anybody think this endeavor of compiling Gambit -> wasm can work? Or are there any other ways to write Lisp and execute it as Wasm?<br>
<br>
---<br>
<br>
```<br>
;; fib.scm<br>
(define (square x)<br>
(expt x 2))<br>
```<br>
<br>
```<br>
% gsc -c fib<br>
```<br>
<br>
produces a fib.c file. Then:<br>
<br>
```<br>
% clang --target=wasm32 -O1 -Wno-deprecated-declarations -Wno-unused -Wno-write-strings -Wdisabled-optimization -fwrapv -fno-strict-aliasing -fno-math-errno -fomit-frame-pointer -fPIC -fno-common -D___SINGLE_HOST -D___DONT_HAVE_MATH_H -D___DONT_HAVE_SETJMP_H -D___DONT_HAVE_SIGNAL_H -D___DONT_HAVE_WCHAR_H -I"/opt/homebrew/Cellar/gambit-scheme/4.9.3_2/v4.9.3/include" fib.c<br>
```<br>
<br>
Gives this error:<br>
```<br>
In file included from fib.c:36:<br>
/opt/homebrew/Cellar/gambit-scheme/4.9.3_2/v4.9.3/include/gambit.h:8012:5: error: unknown type name 'jmp_buf'<br>
jmp_buf buf;<br>
^<br>
1 error generated.<br>
make: *** [fib.o] Error 1<br>
```<br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca" target="_blank">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://mailman.iro.umontreal.ca/cgi-bin/mailman/listinfo/gambit-list" rel="noreferrer" target="_blank">https://mailman.iro.umontreal.ca/cgi-bin/mailman/listinfo/gambit-list</a><br>
</blockquote></div>