<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Skydeck Blog - Latest Comments in ocamljs, OCaml to Javascript compiler</title><link>http://skydeck.disqus.com/</link><description>Mobile Caller ID</description><atom:link href="https://skydeck.disqus.com/ocamljs_ocaml_to_javascript_compiler/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 13 Oct 2008 12:32:40 -0000</lastBuildDate><item><title>Re: ocamljs, OCaml to Javascript compiler</title><link>http://skydeck.com/blog/programming/ocamljs-ocaml-to-javascript-compiler#comment-10293370</link><description>&lt;p&gt;Thanks Florian. I am working on a new release of ocamljs (see the Google Code link above) and will make sure this is fixed.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jake</dc:creator><pubDate>Mon, 13 Oct 2008 12:32:40 -0000</pubDate></item><item><title>Re: ocamljs, OCaml to Javascript compiler</title><link>http://skydeck.com/blog/programming/ocamljs-ocaml-to-javascript-compiler#comment-10293369</link><description>&lt;p&gt;Another try:&lt;/p&gt;&lt;p&gt;The code should compile to someting like&lt;/p&gt;&lt;p&gt;for (var i$60 = 1; i$60 &amp;lt;= 5; i$60++) (function() { var i$60$ = i$60; a$59 = $(_f(function (x$61) { return x$61 + i$60$; }), a$59)})();&lt;/p&gt;&lt;p&gt;instead of&lt;/p&gt;&lt;p&gt;for (var i$60 = 1; i$60 &amp;lt;= 5; i$60++)  a$59 = $(_f(function (x$61) { return x$61 + i$60; }), a$59);&lt;/p&gt;&lt;p&gt;Only functions, not blocks, are scopes in javascript.&lt;br&gt;The assers in Isaacs code should obviously be&lt;/p&gt;&lt;p&gt;assert ((a.(0) 3) == 8);&lt;br&gt;assert ((a.(1) 3) == 7);;&lt;/p&gt;&lt;p&gt;And print_int in ocamljs adds a newline that ocaml proper doesn't add.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Florian Hars</dc:creator><pubDate>Sat, 11 Oct 2008 17:27:47 -0000</pubDate></item><item><title>Re: ocamljs, OCaml to Javascript compiler</title><link>http://skydeck.com/blog/programming/ocamljs-ocaml-to-javascript-compiler#comment-10293368</link><description>&lt;p&gt;I made you a bug report but your submission form has eated it.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Florian Hars</dc:creator><pubDate>Sat, 11 Oct 2008 17:26:14 -0000</pubDate></item><item><title>Re: ocamljs, OCaml to Javascript compiler</title><link>http://skydeck.com/blog/programming/ocamljs-ocaml-to-javascript-compiler#comment-10293367</link><description>&lt;p&gt;"with" in javascript is absolutely evil. The code should compile to someting like&lt;/p&gt;&lt;p&gt;for (var i$60 = 1; i$60&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Florian Hars</dc:creator><pubDate>Sat, 11 Oct 2008 17:24:30 -0000</pubDate></item><item><title>Re: ocamljs, OCaml to Javascript compiler</title><link>http://skydeck.com/blog/programming/ocamljs-ocaml-to-javascript-compiler#comment-10293366</link><description>&lt;p&gt;Issac, thanks for the bug report. I will try to get a fix released soon.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jake</dc:creator><pubDate>Mon, 05 May 2008 13:02:22 -0000</pubDate></item><item><title>Re: ocamljs, OCaml to Javascript compiler</title><link>http://skydeck.com/blog/programming/ocamljs-ocaml-to-javascript-compiler#comment-10293365</link><description>&lt;p&gt;Nice stuff, thanks very much for implementing it.  In the interest of making it even nicer, here's a bug report.  It looks like there is a bug with support for closures, that could be fixed using the JS 'with' construct.  For details, search for "(with" in &lt;a href="http://blogs.bl0rg.net/netzstaub/2005/03/09/javascript-experiences-tooltips/" rel="nofollow noopener" target="_blank" title="http://blogs.bl0rg.net/netzstaub/2005/03/09/javascript-experiences-tooltips/"&gt;http://blogs.bl0rg.net/netz...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;let foo() =&lt;br&gt;  let a = ref [] in&lt;br&gt;  for i = 1 to 5 do&lt;br&gt;    a := (fun x -&amp;gt; x + i) :: !a;&lt;br&gt;  done;&lt;br&gt;  Array.of_list !a;;&lt;/p&gt;&lt;p&gt;let foo_test() =&lt;br&gt;  let a = foo() in&lt;br&gt;  assert ((a.(0) 3) == 4);&lt;br&gt;  assert ((a.(1) 3) == 5);;&lt;/p&gt;&lt;p&gt;foo_test();;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Issac Trotts</dc:creator><pubDate>Mon, 05 May 2008 01:27:41 -0000</pubDate></item><item><title>Re: ocamljs, OCaml to Javascript compiler</title><link>http://skydeck.com/blog/programming/ocamljs-ocaml-to-javascript-compiler#comment-10293364</link><description>&lt;p&gt;I just read the source code; it is very clean. However, there is some documentation on the internals in the OCaml-Java project; see&lt;/p&gt;&lt;p&gt;  &lt;a href="http://cadmium.x9c.fr/downloads.html" rel="nofollow noopener" target="_blank" title="http://cadmium.x9c.fr/downloads.html"&gt;http://cadmium.x9c.fr/downl...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Your snippet manager would be useful in ocamljs since minimizing the resulting Javascript is important for web apps.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jake</dc:creator><pubDate>Fri, 12 Oct 2007 13:36:02 -0000</pubDate></item><item><title>Re: ocamljs, OCaml to Javascript compiler</title><link>http://skydeck.com/blog/programming/ocamljs-ocaml-to-javascript-compiler#comment-10293363</link><description>&lt;p&gt;Wow! I just downloaded it and this seems a top quality work.&lt;/p&gt;&lt;p&gt;Did you have access to some documentation on the internals of the ocaml compiler or did you just read the source code?&lt;/p&gt;&lt;p&gt;In case you had access to docs, could you please tell me what you had to do to obtain it?&lt;br&gt;If you just read the source would you like to write some documents (a tutorial or a blog post or whatever you like) explaining a bit the internals of the compiler?&lt;/p&gt;&lt;p&gt;I'm working on a snippet manager to ease the distribution and reuse of ocaml code and to reduce the size of the binary by linking only those pieces of libraries that are used in your application and not the whole module. We already have a working prototype implementation using ocamldoc but we need to access the internals of the compiler to get a better tool. Our snippet manager will be released as free software.&lt;br&gt;If you are interested I can provide you further details.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Massimiliano</dc:creator><pubDate>Fri, 12 Oct 2007 06:13:37 -0000</pubDate></item></channel></rss>