Re: [Haskell-cafe] New demo/test program for Yhc Javascript backend
It would be really helpful if you could include this (and other) examples in an /examples directory under src/translator/js in the yhc darcs distribution, with working makefiles that validate against the buildbot. Something seems a bit off for me, probably forgot a tilde somewheres. t. 2007/11/17, Dimitry Golubovsky [EMAIL PROTECTED]: Hi, For those of you who are interested in using Haskell in client-side web application programming: I have added a new demo/test program to this Wiki page (Does it leak?): http://haskell.org/haskellwiki/Yhc/Javascript This demo program shows some progress made since the first announcement of Yhc Javascript backend (Core to Javascript converter) was made about a year ago. Please test the demo for functionality and memory leaks in various browsers. Your feedback is appreciated. The demo program is self-contained (does not require any Haskell libraries beyond those included with Yhc). There is a darcs repo: http://www.golubovsky.org/repos/wsptest/ from which this demo program along with Makefile can be obtained if anybody wants to play with the code. Thanks. -- Dimitry Golubovsky Anywhere on the Web ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] New demo/test program for Yhc Javascript backend
2007/11/26, Dimitry Golubovsky [EMAIL PROTECTED]: Thomas, All published examples (source, html) go into web/jsdemos subdirectory (from the root of the Yhc repo source tree). right; it would be nice to have a makefile (or makefiles) there that works out of the box, rather than relying on the wiki http://haskell.org/haskellwiki/Yhc/Javascript/Users_guide#Building_and_installation_on_Unix which, among other things, requires cleaning up tabs for the formatting to work. Even if it can't be incorporated into the buildbot, it would be nice to have some working make examples to orient one's self. Secondly, with regards to your cps changes, are you aware of *any* demos that will compile from head? I want to get going with this because I have a situation where ycr2js would be really useful for an in-house project, client side table filtering on large tables. Maybe I should say a bit about this as well so you can tell me if this seems realistic, I'll write a separate email about that. t. Not all of them may be compilable at the moment though (and some will never be compilable in the future, just kept there for historic reasons - that's why they are not being tested by the buildbot). I am currently going through transition from plain CPS to Cont monad, so regular monadic notation can be used instead of CPS. However I am experiencing memory leaks in MSIE (try the EchoM example) which I did not expect to happen (never had them in plain CPS). If I cannot fix that I'll roll back to plain CPS. On 11/26/07, Thomas Hartman [EMAIL PROTECTED] wrote: It would be really helpful if you could include this (and other) examples in an /examples directory under src/translator/js -- Dimitry Golubovsky Anywhere on the Web ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] New demo/test program for Yhc Javascript backend
Fair enough, I can wait for a couple of days. You might want to fix [EMAIL PROTECTED]:~/haskell-installs/yhc-install/yhc/src/translator/js/testdarcs whatsnew { hunk ./src/translator/js/test/Makefile 12 - $(YHC) -includes ../lib/haskell -linkcore $ + $(YHC) --includes ../lib/haskell --linkcore $ } immediately though. This is the only makefile for the javascript stuff in the repo, and it doesn't work because of - instead of --. Given your darcs log message that the javascript compiler would be broken I initially assumed that was the reason and not a flags change. More questions. So okay, it builds, I have Test1.html. It's a blank file with a bunch of javascript. I have firebug, so I can ask execute stuff in the javascript console. But I can't figure out what to execute. factorial isn't there, nor sumlst... none of the interesting looking functions? So what is this supposed to do? And can I change the makefile so that at least it generates javascript where I can execute the interesting functions in the firebug console? thomas. 2007/11/26, Dimitry Golubovsky [EMAIL PROTECTED]: Thomas, OK, let's try to get on the same page regarding where the project is. The Javascript generator is maybe not optimal, but it works. DOM bindings are generated from W3C's IDL files, so everything DOM provides may be used by Haskell programs, whether in CPS notation, or monadic, this will become clear, which form to use, in the near future. The recent HsWTKDemo works well in major browsers (FF, MSIE, Opera) except for Safari, but this is probably a hard case due to the lack of debugging information. If you look at its source http://darcs.haskell.org/yhc/web/jsdemos/HsWTKDemo.hs (no, you cannot compile it at the moment because it is plain CPS) you may see some stuff related to static page layout definition in declarative way (look for upcntW, factW, etc.) This part is almost finalized wrt notation. What's left undecided is whether to use plain CPS notation, or monadic notation for parts of the code that involve imperative stuff (see e. g. updateD function where node's children are replaced in order to update what's displayed). This all works perfectly in plain CPS. Understanding that nowadays Monads are mainstream, I am trying to adopt monadic notation based on the Cont monad instead of plain CPS. I ran one example (EchoM) on MSIE and noticed memory leaks on each user's action. However when the page is unloaded, MSIE shrinks in size which is a good sign. I think I know where the cause is, tonight I'll try to fix it. If unsuccessful, I'll probably unroll all monadic changes. Next steps are: 1. Finalize the code notation for static layout and imperative part and check the base library into the Yhc repo 2. Generate haddock documentation 3. Write a better documentation for developers 4. Set up a web service that would allow everybody to submit their Haskell source and generate HTML page with Javascript in response; this I think can be done based on the hpaste program (backed by Happs). Just for now, you have to wait a couple days while I am straightening the monadic thing out. I'd appreciate if you look at the code of HsWTKDemo and give me your impressions about notation, etc. Thank you. -- Dimitry Golubovsky Anywhere on the Web ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] New demo/test program for Yhc Javascript backend
This is very cool! I will definitely be playing with this. Safari 3.0.2 for windows gives an error though: Maximum call stack size exceeded. http://darcs.haskell.org/yhc/web/jsdemos/HsWTKDemo.html Line: 87 Sometimes it gives the same error but instead of line 87 with line 314, and other times line 224 or 422 Are you aware of this issue? Thanks On Nov 17, 2007 8:32 AM, Dimitry Golubovsky [EMAIL PROTECTED] wrote: Hi, For those of you who are interested in using Haskell in client-side web application programming: I have added a new demo/test program to this Wiki page (Does it leak?): http://haskell.org/haskellwiki/Yhc/Javascript This demo program shows some progress made since the first announcement of Yhc Javascript backend (Core to Javascript converter) was made about a year ago. Please test the demo for functionality and memory leaks in various browsers. Your feedback is appreciated. The demo program is self-contained (does not require any Haskell libraries beyond those included with Yhc). There is a darcs repo: http://www.golubovsky.org/repos/wsptest/ from which this demo program along with Makefile can be obtained if anybody wants to play with the code. Thanks. -- Dimitry Golubovsky Anywhere on the Web ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] New demo/test program for Yhc Javascript backend
Bit, On Nov 18, 2007 8:41 AM, Bit Connor [EMAIL PROTECTED] wrote: Safari 3.0.2 for windows gives an error though: Maximum call stack size exceeded. http://darcs.haskell.org/yhc/web/jsdemos/HsWTKDemo.html Line: 87 This is in fact a huge progress for Safari ;) Year ago, Safari on Mac gave some weird error message Type Error line 1. See http://osdir.com/ml/lang.haskell.yhc/2006-11/msg00033.html The problem is, I am not sure how it enumerates lines. Lines around 87 (ran with pr -n): 83 var consStr = function (s) { 84 if (s.length == 0) { 85 return new HSEOL (); 86 } else { 87 var hdc = mkChar (s.charCodeAt (0)); 88 return new HSCons (hdc, s.length 1 ? s.substring (1) : consStr ()); 89 }; 90 }; Nothing suspicious because mkChar is a wrapper around the Number constructor. Line 314: 312 function NEG_D(a) { 313 return -(exprEval(a)); 314 } and so on. Sometimes it gives the same error but instead of line 87 with line 314, and other times line 224 or 422 But does it at least display the widgets? Or do these errors appear as you press buttons/type anything? Are you aware of this issue? Now I am ;) But to me not being an expert in Safari, these error messages do little help (or if at least I knew what actual lines they meant)... Thanks. -- Dimitry Golubovsky Anywhere on the Web ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe