<html><body><div style="color:#000; background-color:#fff; font-family:garamond, new york, times, serif;font-size:12pt"><div><span>Marc,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: garamond,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: garamond,new york,times,serif; background-color: transparent; font-style: normal;"><span>   Thanks for the example.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: garamond,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: garamond,new york,times,serif; background-color: transparent; font-style: normal;"><span>   When I ran it, I got the following:</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family:
 garamond,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div>steve@steve-Satellite-L555D ~ $ js fib.js<br>js: uncaught JavaScript runtime exception: TypeError: Cannot find function real-time-milliseconds in object [object Object].<br><br>I'm running Gambit 4.6.7 on a 64-bit Linux Mint 14.<br><br><br>Steve<br><div><br></div>  <div style="font-family: garamond, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Marc Feeley <feeley@iro.umontreal.ca><br> <b><span style="font-weight: bold;">To:</span></b> Mikael <mikael.rcv@gmail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> gambit-list@iro.umontreal.ca <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, September 16, 2013 9:29 PM<br>
 <b><span style="font-weight: bold;">Subject:</span></b> Re: [gambit-list] Efficient Compilation of Tail Calls and    Continuations to JavaScript<br> </font> </div> <div class="y_msg_container"><br><br>On 2013-09-09, at 9:33 AM, Mikael <<a ymailto="mailto:mikael.rcv@gmail.com" href="mailto:mikael.rcv@gmail.com">mikael.rcv@gmail.com</a>> wrote:<br><br>> Awesome.<br>> <br>> For reference, is the implementation of Gambit2JS available anywhere?<br>> <br><br>Yes.  It is in the standard release of Gambit.  You need to use the option "-target js" to gsc.  For example:<br><br>% cat fib.scm<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>% gsc -c -target js fib.scm<br>% js fib.js<br>832040<br>2035<br><br>Marc<br><br>_______________________________________________<br>Gambit-list mailing list<br><a ymailto="mailto:Gambit-list@iro.umontreal.ca" href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br><a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br><br><br></div> </div> </div>  </div></body></html>