tag:blogger.com,1999:blog-3016981170905406325.post3288682653927052288..comments2024-03-22T05:35:31.155-07:00Comments on language agnostic: Javascript with a LispInaimathihttp://www.blogger.com/profile/14277727122990903016noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-3016981170905406325.post-62782548251853995862012-02-16T15:47:37.195-08:002012-02-16T15:47:37.195-08:00Thanks for the kind words.
About .js generation; ...Thanks for the kind words.<br /><br />About .js generation; that's the approach I usually take. It seems like an egregious waste of resources to have Hunchentoot generating a static file each time it needs to get served. <br /><br />If you want example (though by no means definitive) code, check out my <a href="https://github.com/Inaimathi/clomments" rel="nofollow">clomments</a> project on github. <a href="https://github.com/Inaimathi/clomments/blob/master/js-macros.lisp" rel="nofollow">js-macros.lisp</a> contains, among other things, a function called compile-js which is called in <a href="https://github.com/Inaimathi/clomments/blob/master/js.lisp" rel="nofollow">js.lisp</a> to generate the static file that finally gets served. <br /><br />In a production environment, you'd probably also want a lightweight HTTP server out in front of Hunchentoot serving up static content and proxying to your application for the dynamic parts.Inaimathihttps://www.blogger.com/profile/14277727122990903016noreply@blogger.comtag:blogger.com,1999:blog-3016981170905406325.post-10172987875135041472012-02-13T09:54:39.689-08:002012-02-13T09:54:39.689-08:00Your posts are great! Seeing practical usage of pa...Your posts are great! Seeing practical usage of parenscript is very informative.<br /><br />I wasn't sure if I wanted to use it in my project (cost vs benefit). But seeing the cool macros you've got going are making me seriously consider it.<br /><br />I think it'll help organize my JS. I can add a lisp macro that evaluates parenscript code and adds it to a ship-out file. Then hunchentoot serves up this file.<br /><br />That way all the modules in my project can locally define the javascript functions they need -- and at the end of the day they all appear in a single (minimized?) javascript file.<br /><br />Ditto for CSS ... =)Warren Wilkinsonhttps://www.blogger.com/profile/04257771704025500730noreply@blogger.com