[gambit-list] Gambit universal library in the browser
Marc Feeley
feeley at iro.umontreal.ca
Tue Mar 24 22:49:38 EDT 2020
With the latest commit the Gambit universal library can be used in the browser… it is as simple as:
% make _gambit.js
% gsc/gsc -:= -target js -exe -o webapp.js webapp.scm
% open webapp.html
webapp.scm:
(declare (extended-bindings))
(define (document.write html)
(##inline-host-statement "document.write(g_scm2host(@1@));" html))
(document.write "<h1>Hello world!</h1>")
webapp.html:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>webapp</title>
</head>
<body>
<script type="text/javascript" src="webapp.js"></script>
</body>
</html>
More information about the Gambit-list
mailing list