<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/9.9.9" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: It can&#8217;t be so hard&#8230;</title>
	<link>http://www.panoramio.com/blog/it-cant-be-so-hard/</link>
	<description>Development of Panoramio, a mash-up of Google Maps and geopositioned photos</description>
	<pubDate>Tue, 06 Jan 2009 13:18:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=9.9.9</generator>

	<item>
		<title>by: jameson</title>
		<link>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-17454</link>
		<pubDate>Fri, 09 Nov 2007 21:54:50 +0000</pubDate>
		<guid>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-17454</guid>
					<description>Her. Bobby knew wascoming. Mindy yes, i can and slowly pressed &lt;a href="http://jennaanal.2usite.com" rel="nofollow"&gt;jenna jameson anal&lt;/a&gt; his body. Was right. Let &lt;a href="http://jennavideos.xforum.se" rel="nofollow"&gt;jenna jameson videos&lt;/a&gt;  her fingers wrapped around and a diligent mechanic. She looks up.</description>
		<content:encoded><![CDATA[<p>Her. Bobby knew wascoming. Mindy yes, i can and slowly pressed <a href="http://jennaanal.2usite.com" rel="nofollow">jenna jameson anal</a> his body. Was right. Let <a href="http://jennavideos.xforum.se" rel="nofollow">jenna jameson videos</a>  her fingers wrapped around and a diligent mechanic. She looks up.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Joaquín Cuenca Abela</title>
		<link>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-133</link>
		<pubDate>Tue, 03 Jan 2006 21:03:31 +0000</pubDate>
		<guid>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-133</guid>
					<description>Yes, but you still have to manually annotate what you're going to use, and what do you provide in each file.

And besides that, it will only work on those frameworks that provide such functions.</description>
		<content:encoded><![CDATA[<p>Yes, but you still have to manually annotate what you&#8217;re going to use, and what do you provide in each file.</p>
<p>And besides that, it will only work on those frameworks that provide such functions.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Brad Neuberg</title>
		<link>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-132</link>
		<pubDate>Sun, 01 Jan 2006 15:44:43 +0000</pubDate>
		<guid>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-132</guid>
					<description>If you layer a packaging system over JavaScript, as Dojo has with it's dojo.provide and dojo.require methods, then the problem you are trying to solve becomes much easier.</description>
		<content:encoded><![CDATA[<p>If you layer a packaging system over JavaScript, as Dojo has with it&#8217;s dojo.provide and dojo.require methods, then the problem you are trying to solve becomes much easier.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Joaquín Cuenca Abela</title>
		<link>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-131</link>
		<pubDate>Thu, 29 Dec 2005 22:27:25 +0000</pubDate>
		<guid>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-131</guid>
					<description>For people following this, I completed the evaluation of all the statements and expression, except for functions declarations / calls and constructors.

I rewrote the object framework, only to discover than I have made it not generic enough for host objects. So in short I screwed it. *Again!* It seems that I will need to use O'Caml objects after all.

At least I was able to implement the basic Object and Function objects (with their prototypes and constructors), so I will maybe be able to implement function calls and object constructors with the current framework.

Everything else seems to be working, with caveats, for instance I convert exception's objects to javascript strings, as I have not yet implemented these objects (but they are correctly throw / propagated / catched).

In the mean time, I managed to discover two bugs in SpiderMonkey. Brendan Eich being the incredible hacker he is, has already fixed one of them, and the other one seems to be in the pipeline.

I also discovered three bugs in the grammar published in mozilla's site. I have yet to email Waldemar about them.

I think that I will take a rest for a few days to work on some Panoramio features. And maybe even take a rest to do nothing... you know, to rest :-)

Cheers,</description>
		<content:encoded><![CDATA[<p>For people following this, I completed the evaluation of all the statements and expression, except for functions declarations / calls and constructors.</p>
<p>I rewrote the object framework, only to discover than I have made it not generic enough for host objects. So in short I screwed it. *Again!* It seems that I will need to use O&#8217;Caml objects after all.</p>
<p>At least I was able to implement the basic Object and Function objects (with their prototypes and constructors), so I will maybe be able to implement function calls and object constructors with the current framework.</p>
<p>Everything else seems to be working, with caveats, for instance I convert exception&#8217;s objects to javascript strings, as I have not yet implemented these objects (but they are correctly throw / propagated / catched).</p>
<p>In the mean time, I managed to discover two bugs in SpiderMonkey. Brendan Eich being the incredible hacker he is, has already fixed one of them, and the other one seems to be in the pipeline.</p>
<p>I also discovered three bugs in the grammar published in mozilla&#8217;s site. I have yet to email Waldemar about them.</p>
<p>I think that I will take a rest for a few days to work on some Panoramio features. And maybe even take a rest to do nothing&#8230; you know, to rest <img src='http://www.panoramio.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Cheers,
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Johan Sundström</title>
		<link>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-130</link>
		<pubDate>Wed, 28 Dec 2005 13:03:45 +0000</pubDate>
		<guid>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-130</guid>
					<description>Your work has lots of merit, and the automated leak detection is certainly another dazzling prospect. Thanks for the ecmascript hint; while I would not likely write that kind of code myself, it's a useful bit of knowledge to possess.

And happy holidays to you, too!</description>
		<content:encoded><![CDATA[<p>Your work has lots of merit, and the automated leak detection is certainly another dazzling prospect. Thanks for the ecmascript hint; while I would not likely write that kind of code myself, it&#8217;s a useful bit of knowledge to possess.</p>
<p>And happy holidays to you, too!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Joaquín Cuenca Abela</title>
		<link>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-129</link>
		<pubDate>Wed, 28 Dec 2005 10:47:31 +0000</pubDate>
		<guid>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-129</guid>
					<description>Hi Pablete &#38; Johan,

You are slightly overestimating gzip's abilities, but otherwise I mostly agree. Again, a compressor / pretty printer is the only thing I could do with a javascript parser, and I need it anyway for other things. It also yields a 2x compression, which is not entirely irrelevant.

But, if we forget about the compressor, I hope we will agree the linker / memory leak detector / "issue warnings on compatibily problems" projects are worth it. All them need a previous javascript parser.

You said that stripped versions of libraries can be done offline. That's the whole point (I don't want to do it online), but to do it *correctly* you need a javascript engine.

You can do some quick hack in ruby, perl (or caml, btw) that will work most of the time, in the same sense than you can use some regular expressions to do a quick compressor. It will not however cover all cases, and as today toolkits keep growing, your chances of hitting a bug trying to prune dead code in each toolkit will grow.

For things like a leak memory detector, there is no way around doing a full javascript engine. A quick &#38; dirty perl script will not cut it. And I don't know about you, but I'm using a personalized version of Google Maps code due to all the leaks of the original version. Maybe they have improved in .28 / .29, but anyway if Google is having problems attacking this problem with tradicional tools, then it means everybody has a problem. (And unfortunately is not as easy as just disconnecting all your event handlers on unload.)

Johan, the ecmascript conformance bug in google maps is that they do a (I think it is two, in fact) function declarations inside an if block, something as:

if (foo) { function bar() { return "hi" } alert(bar()) }

Function declarations are only legal in toplevel and directly in the block of another function declaraction, so this is illegal. As everybody else is handling this case, I also added it to my parser. (Btw, I already pointed out this problem to Google Maps guys.)

Oh, and I may even follow Pablete's advice and take some rest :-)

Happy holidays guys!</description>
		<content:encoded><![CDATA[<p>Hi Pablete &amp; Johan,</p>
<p>You are slightly overestimating gzip&#8217;s abilities, but otherwise I mostly agree. Again, a compressor / pretty printer is the only thing I could do with a javascript parser, and I need it anyway for other things. It also yields a 2x compression, which is not entirely irrelevant.</p>
<p>But, if we forget about the compressor, I hope we will agree the linker / memory leak detector / &#8220;issue warnings on compatibily problems&#8221; projects are worth it. All them need a previous javascript parser.</p>
<p>You said that stripped versions of libraries can be done offline. That&#8217;s the whole point (I don&#8217;t want to do it online), but to do it *correctly* you need a javascript engine.</p>
<p>You can do some quick hack in ruby, perl (or caml, btw) that will work most of the time, in the same sense than you can use some regular expressions to do a quick compressor. It will not however cover all cases, and as today toolkits keep growing, your chances of hitting a bug trying to prune dead code in each toolkit will grow.</p>
<p>For things like a leak memory detector, there is no way around doing a full javascript engine. A quick &amp; dirty perl script will not cut it. And I don&#8217;t know about you, but I&#8217;m using a personalized version of Google Maps code due to all the leaks of the original version. Maybe they have improved in .28 / .29, but anyway if Google is having problems attacking this problem with tradicional tools, then it means everybody has a problem. (And unfortunately is not as easy as just disconnecting all your event handlers on unload.)</p>
<p>Johan, the ecmascript conformance bug in google maps is that they do a (I think it is two, in fact) function declarations inside an if block, something as:</p>
<p>if (foo) { function bar() { return &#8220;hi&#8221; } alert(bar()) }</p>
<p>Function declarations are only legal in toplevel and directly in the block of another function declaraction, so this is illegal. As everybody else is handling this case, I also added it to my parser. (Btw, I already pointed out this problem to Google Maps guys.)</p>
<p>Oh, and I may even follow Pablete&#8217;s advice and take some rest <img src='http://www.panoramio.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Happy holidays guys!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Johan Sundström</title>
		<link>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-128</link>
		<pubDate>Wed, 28 Dec 2005 05:06:35 +0000</pubDate>
		<guid>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-128</guid>
					<description>It certainly does, and with lots of eager anticipation of any other bits or pieces to come out of either project.

I would have lots of use for a tool to do just custom formatting of code (and am a bit too lazy to hack any of the C parsers on offer today). An Ocaml first encounter for that would probably be lots of fun; it seems a very nice language to do really efficient code (my experience with the language mostly consists of the perspective given by Doug's Great Computer Language Shootout, where the Ocaml implementations on several benchmarks beat most other languages with a margin, including Pike, which is home environments to me).

You peaked my curiosity about the ecmascript conformance bug you found; any more detailry available on that topic?

\2. also sounds an amazingly useful prospect. I hope you'll post some notice about it, should you ever want co-developers on either of these "spin-off" projects.</description>
		<content:encoded><![CDATA[<p>It certainly does, and with lots of eager anticipation of any other bits or pieces to come out of either project.</p>
<p>I would have lots of use for a tool to do just custom formatting of code (and am a bit too lazy to hack any of the C parsers on offer today). An Ocaml first encounter for that would probably be lots of fun; it seems a very nice language to do really efficient code (my experience with the language mostly consists of the perspective given by Doug&#8217;s Great Computer Language Shootout, where the Ocaml implementations on several benchmarks beat most other languages with a margin, including Pike, which is home environments to me).</p>
<p>You peaked my curiosity about the ecmascript conformance bug you found; any more detailry available on that topic?</p>
<p>\2. also sounds an amazingly useful prospect. I hope you&#8217;ll post some notice about it, should you ever want co-developers on either of these &#8220;spin-off&#8221; projects.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: pablete</title>
		<link>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-127</link>
		<pubDate>Wed, 28 Dec 2005 01:41:32 +0000</pubDate>
		<guid>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-127</guid>
					<description>You are trying to solve the wrong problem. The javascripts you loaded on  a page are cached by the browser, so, there is no need to constantly reload them. You need speed for the first download, so use gzip with apache or lighttpd, this will give you 10x compression to your javascript files (plain text files). That's everything you need.
  With all due respect, you are solving a problem, only because the beauty of it.
  I think you need to rest a little bit, and take some days off. I am not beening ironic or worst. It's just an advice. I have been following your development since jose florido told me to, a while ago, and you have made an impressive work with panoramio. 
  
  By the way, your idea to make stripped versions of libraries you use for different cases (when you need only few functions) can be done offline just once, for particular cases, by some other simple languajes like ruby or perl. It's very good idea actually.


Cheers,</description>
		<content:encoded><![CDATA[<p>You are trying to solve the wrong problem. The javascripts you loaded on  a page are cached by the browser, so, there is no need to constantly reload them. You need speed for the first download, so use gzip with apache or lighttpd, this will give you 10x compression to your javascript files (plain text files). That&#8217;s everything you need.<br />
  With all due respect, you are solving a problem, only because the beauty of it.<br />
  I think you need to rest a little bit, and take some days off. I am not beening ironic or worst. It&#8217;s just an advice. I have been following your development since jose florido told me to, a while ago, and you have made an impressive work with panoramio. </p>
<p>  By the way, your idea to make stripped versions of libraries you use for different cases (when you need only few functions) can be done offline just once, for particular cases, by some other simple languajes like ruby or perl. It&#8217;s very good idea actually.</p>
<p>Cheers,
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Joaquín Cuenca Abela</title>
		<link>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-126</link>
		<pubDate>Tue, 27 Dec 2005 21:48:56 +0000</pubDate>
		<guid>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-126</guid>
					<description>Hi Johan,

As you can see, we are using mod_deflate (or mod_gunzip, I don't remember) right now.
I see that you have seen now my reply to your previous comment, so that kind of replies your question about the goal of this work.

I have several goals, and each stage brings a little tool useful by itself. I did not want to attack the big problem of doing a javascript linker or a javascript leak detector first, because they are quite daunting, and I want to have something to show if my motivation fails.

These are the tools I'm thinking of:

\1. With a parser, I can compress a bit the output, until now in a fully recoverable way. The new renaming is not fully recoverable, and thus it will be optional. Actually, even the "compress spaces" will be optional, leaving the choice of pretty printer / compressor in the user. (In the future I will myself use it to compress spaces, let newlines in place, don't rename.)

Given that I have not even compressed Panoramio's code (except by using mod_deflate), even when my tool can parse and rewrite correctly both, Panoramio's code and Google Maps' code, it should be pretty clear that I'm not trying to obfuscate anything. (But as I said, when I finish the pretty printer I will remove extra spaces.)

Btw, I have discovered an ecmascript conformance bug in Google Maps that every browser parses and execute as Google Maps' author expected.

\2. With a javascript engine, I can do extra tests in the code. For instance, I would love if it could say me "hey, here you are using foo, and that's not supported in IE5. Do bar to make it compatible.". Unfortunately I will have to clone the host objects to have useful warnings, and that will take a bit of time.

It's also mandatory for a leak detector, but again, I will need to mirror host objects. The only tool to help diagnose leaks that I am aware of is Joel's one, and it crashed when I tried to use it in Panoramio.
 
\3. Third tool will probably be the linker. I think the community has really a problem here. I'm always copying little functions like prototype's $ to not impose the burden of prototype on light pages. Or cutting debug code, that may statically be proven as unreachable. But as you say, it's not gonna be easy.

It is also an enjoyable learning experience. Last time I coded in O'Caml was years ago, and I'm rediscovering the language with this project. And even when I thought I mastered quite well javascript, I now have a much deeper understanding of it.

I hope this clears the "what are you trying to do here" question.

Cheers,</description>
		<content:encoded><![CDATA[<p>Hi Johan,</p>
<p>As you can see, we are using mod_deflate (or mod_gunzip, I don&#8217;t remember) right now.<br />
I see that you have seen now my reply to your previous comment, so that kind of replies your question about the goal of this work.</p>
<p>I have several goals, and each stage brings a little tool useful by itself. I did not want to attack the big problem of doing a javascript linker or a javascript leak detector first, because they are quite daunting, and I want to have something to show if my motivation fails.</p>
<p>These are the tools I&#8217;m thinking of:</p>
<p>\1. With a parser, I can compress a bit the output, until now in a fully recoverable way. The new renaming is not fully recoverable, and thus it will be optional. Actually, even the &#8220;compress spaces&#8221; will be optional, leaving the choice of pretty printer / compressor in the user. (In the future I will myself use it to compress spaces, let newlines in place, don&#8217;t rename.)</p>
<p>Given that I have not even compressed Panoramio&#8217;s code (except by using mod_deflate), even when my tool can parse and rewrite correctly both, Panoramio&#8217;s code and Google Maps&#8217; code, it should be pretty clear that I&#8217;m not trying to obfuscate anything. (But as I said, when I finish the pretty printer I will remove extra spaces.)</p>
<p>Btw, I have discovered an ecmascript conformance bug in Google Maps that every browser parses and execute as Google Maps&#8217; author expected.</p>
<p>\2. With a javascript engine, I can do extra tests in the code. For instance, I would love if it could say me &#8220;hey, here you are using foo, and that&#8217;s not supported in IE5. Do bar to make it compatible.&#8221;. Unfortunately I will have to clone the host objects to have useful warnings, and that will take a bit of time.</p>
<p>It&#8217;s also mandatory for a leak detector, but again, I will need to mirror host objects. The only tool to help diagnose leaks that I am aware of is Joel&#8217;s one, and it crashed when I tried to use it in Panoramio.</p>
<p>\3. Third tool will probably be the linker. I think the community has really a problem here. I&#8217;m always copying little functions like prototype&#8217;s $ to not impose the burden of prototype on light pages. Or cutting debug code, that may statically be proven as unreachable. But as you say, it&#8217;s not gonna be easy.</p>
<p>It is also an enjoyable learning experience. Last time I coded in O&#8217;Caml was years ago, and I&#8217;m rediscovering the language with this project. And even when I thought I mastered quite well javascript, I now have a much deeper understanding of it.</p>
<p>I hope this clears the &#8220;what are you trying to do here&#8221; question.</p>
<p>Cheers,
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Johan Sundström</title>
		<link>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-124</link>
		<pubDate>Tue, 27 Dec 2005 20:33:26 +0000</pubDate>
		<guid>http://www.panoramio.com/blog/it-cant-be-so-hard/#comment-124</guid>
					<description>gzip(1) is the best javascript compressor available, putting the HTTP standardized, content preserving, Content-Encoding:gzip functionality to excellent use. If it &lt;i&gt;is&lt;/i&gt; compression you're after, anyway, that is the best route to go. Innerjoin has a nice &lt;a href="http://www.innerjoin.org/apache-compression/howto.html" rel="nofollow"&gt;tutorial on methods of setting up Apache with mod_gunzip&lt;/a&gt;. (If it is actually the code obfuscation and "raising the bar on external code reuse" you seek, it would be &lt;i&gt;very&lt;/i&gt; pleasing on the eye to see it named/admitted as such.)

That said, I still find your work on a javascript linker theoretically interesting, even if it would need to be &lt;i&gt;very&lt;/i&gt; advanced to do true dependency analysis on code putting the dynamic capabilities of ecmascript to good use. I believe most frameworks today are rather naïvely coded, though, by people who write code in the "smallest common denominator" (between PHP and javascript, for instance) fashion, so it might be of some use.

If you ever plan on releasing it, I hope any variable, property, object and function renaming will be optional.</description>
		<content:encoded><![CDATA[<p>gzip(1) is the best javascript compressor available, putting the HTTP standardized, content preserving, Content-Encoding:gzip functionality to excellent use. If it <i>is</i> compression you&#8217;re after, anyway, that is the best route to go. Innerjoin has a nice <a href="http://www.innerjoin.org/apache-compression/howto.html" rel="nofollow">tutorial on methods of setting up Apache with mod_gunzip</a>. (If it is actually the code obfuscation and &#8220;raising the bar on external code reuse&#8221; you seek, it would be <i>very</i> pleasing on the eye to see it named/admitted as such.)</p>
<p>That said, I still find your work on a javascript linker theoretically interesting, even if it would need to be <i>very</i> advanced to do true dependency analysis on code putting the dynamic capabilities of ecmascript to good use. I believe most frameworks today are rather naïvely coded, though, by people who write code in the &#8220;smallest common denominator&#8221; (between PHP and javascript, for instance) fashion, so it might be of some use.</p>
<p>If you ever plan on releasing it, I hope any variable, property, object and function renaming will be optional.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
