<div dir="ltr"><span style="font-size:13px">I did that two days ago and built from scratch.  Are you talking about something after that?</span><div style="font-size:13px"><br></div><div style="font-size:13px">Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 2, 2015 at 8:26 AM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You have to pull the latest version from the github repo.<br>
<span class="HOEnZb"><font color="#888888"><br>
Marc<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On Feb 1, 2015, at 11:35 PM, Blake McBride <<a href="mailto:blake@mcbride.name">blake@mcbride.name</a>> wrote:<br>
><br>
> Here is the result of your example:<br>
><br>
> $ gsc -c -target js f1.scm<br>
> $ node f1.js<br>
><br>
> /home/blake/gambit/f1.js:448<br>
>   print(obj);<br>
>   ^<br>
> ReferenceError: print is not defined<br>
>     at gambit_println (/home/blake/gambit/f1.js:448:3)<br>
>     at gambit_bb1_println (/home/blake/gambit/f1.js:323:3)<br>
>     at gambit_trampoline (/home/blake/gambit/f1.js:348:10)<br>
>     at Object.<anonymous> (/home/blake/gambit/f1.js:688:1)<br>
>     at Module._compile (module.js:456:26)<br>
>     at Object.Module._extensions..js (module.js:474:10)<br>
>     at Module.load (module.js:356:32)<br>
>     at Function.Module._load (module.js:312:12)<br>
>     at Function.Module.runMain (module.js:497:10)<br>
>     at startup (node.js:119:16)<br>
> $<br>
><br>
><br>
> In any case, here is a simple example and instructions on how to run the code in a JS shell and in the browser.  If you want to use non-primitive predefined Scheme library functions (such as equal?, append, map, write, etc) you will need to look into univ-lib .  The goal is to have all of this neatly packaged in gsc so that one invocation of gsc will do all that is necessary.  One issue is linking… should the .js file contain all of the application code including Scheme libraries, or should it contain just the code for the compiled file (so that it can be dynamically loaded by the web page)?  Both should be supported with an appropriate compile flag.<br>
><br>
> Marc<br>
><br>
><br>
> ;; File: fib.scm<br>
> ;;<br>
> ;; compile with: gsc -c -target js fib.scm<br>
> ;;<br>
> ;; execute with: d8 fib.js<br>
> ;;<br>
> ;; or use it in an HTML page like this:<br>
> ;;<br>
> ;; <!DOCTYPE html><br>
> ;; <html><br>
> ;; <head><br>
> ;;     <title>fib</title><br>
> ;;     <script type="text/javascript"><br>
> ;;         function print(x) { console.log(x); }<br>
> ;;     </script><br>
> ;;     <script type="text/javascript" src="fib.js"></script><br>
> ;; </head><br>
> ;; <body></body><br>
> ;; </html><br>
><br>
> (declare<br>
>   (standard-bindings)<br>
>   (extended-bindings)<br>
>   (not safe)<br>
>   (fixnum)<br>
>   (block)<br>
> )<br>
><br>
> (define (fib n)<br>
><br>
>   (define (fib n)<br>
>     (if (< n 2)<br>
>         n<br>
>         (+ (fib (- n 1))<br>
>            (fib (- n 2)))))<br>
><br>
>   (fib n))<br>
><br>
> (define start (real-time-milliseconds))<br>
><br>
> (println (fib 30))<br>
><br>
> (define end (real-time-milliseconds))<br>
><br>
> (println (- end start))<br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>