<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Syntactic Sugar</title>
	<atom:link href="http://friggeri.net/feed" rel="self" type="application/rss+xml" />
	<link>http://friggeri.net</link>
	<description>Adrien Friggeri's blog</description>
	<pubDate>Fri, 04 Jul 2008 12:14:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6-bleeding2</generator>
	<language>en</language>
			<item>
		<title>Following Trackbacks</title>
		<link>http://friggeri.net/blog/2008/07/04/following-trackbacks</link>
		<comments>http://friggeri.net/blog/2008/07/04/following-trackbacks#comments</comments>
		<pubDate>Fri, 04 Jul 2008 12:14:48 +0000</pubDate>
		<dc:creator>Adrien Friggeri</dc:creator>
		
		<category><![CDATA[randomness]]></category>

		<category><![CDATA[diffusion]]></category>

		<category><![CDATA[trackbacks]]></category>

		<guid isPermaLink="false">http://friggeri.net/?p=137</guid>
		<description><![CDATA[It&#039;s been a really long time since I wrote an article but here I am again. For the last month, I&#039;ve been working on something awesome : trying to understand how information spreads on the internet. This basically involves a lot of graph theory, a little sociology and a huge amount of intuition.
What I call [...]]]></description>
			<content:encoded><![CDATA[<p>It&#039;s been a really long time since I wrote an article but here I am again. For the last month, I&#039;ve been working on something awesome : trying to understand how information spreads on the internet. This basically involves a lot of graph theory, a little sociology and a huge amount of intuition.</p>
<p>What I call <em>information diffusion</em> is barely a tree which nodes are web pages/articles and let u, v be two nodes of the tree, if v is a child of u, then the information posted on v was first read on u. The root being the original source of information (or at least the first observable occurrence).</p>
<p>The difficult part is to try and build such a tree. There are several papers on the subject, but most of them reconstruct the tree, using semantic wizardry : take a blog network, identify <em>subjects</em> (whatever it may mean) and using statistics and temporal information, try to guess the path the rumor/buzz/information took. While this method is OK and gives result, I&#039;m not convinced this is the best way of doing things. I strongly believe that whatever are the results one wants to see, there is a way to reconstruct the diffusion to fit those specific results, and this might influence the measurement.</p>
<p>Then I thought that on blogs we had this wonderful concept called <strong>trackback</strong>. A couple of weeks ago I firmly believed that you could actually track the diffusion of an information just by looking at the trackbacks. The idea was pretty simple : I made the assumption that if blogger B reads something on blogger B&#039;s website, he&#039;ll create a trackback.</p>
<p>So I wrote a few lines of python and using the <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy50ZWNobm9yYXRpLmNvbQ==">Technorati</a> <acronym title="Application Programming Interface">API</acronym> I built a few trees. In each of those, the nodes are the articles, and there is an (directed) edge between two nodes if the target has made a trackback to the source.</p>
<p><a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ZyaWdnZXJpLm5ldC93cC1jb250ZW50L3VwbG9hZHMvMjAwOC8wNy95b3V0dWJlLnBuZw=="><img src="http://friggeri.net/wp-content/uploads/2008/07/youtube-150x150.png" alt="" title="youtube" width="150" height="150" class="alignright size-thumbnail wp-image-138" style="margin-left:1em;"/></a> Here is an example : I looked at how the announcement of <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbQ==">YouTube</a>&#039;s acquisition by <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29t">Google</a> spread from two different sources. The obvious thing is that the tree is really large and not deep at all. And this is not an artifact, I have quite a lot of data on other information trackbacks and they all follow the same pattern : almost everybody makes a trackback to the source, and there are extremely rare occurrences of trackbacks to another article.</p>
<p>I started wondering where I made a mistake, and after some reflexion I came to the conclusion that there is a very simple yet enlightening explanation : things do not work that way at all, trackbacks do not capture information diffusion. </p>
<p>I&#039;ll give you a real life illustration : let&#039;s say you have a friend and that this guy tells you something like &#034;Hey, I saw an awesome video on YouTube yesterday, blablabla&#034;. Let&#039;s assume that you&#039;re interested, you&#039;ll go and watch the video and when you&#039;ll talk about it, you&#039;ll <strong>never</strong> say : &#034;One of my pals told me he saw this video on YouTube, check it out&#034; ; you&#039;ll directly cite the original source. This is exactly what happens on the internet.</p>
<p>Moreover, there is another important thing to consider : when blog A tracks back to blog B, there usually a link on blog B to blog A. And if blog B is <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy50ZWNoY3J1bmNoLmNvbQ==">TechCrunch</a> (or any other huge blog), it&#039;s fair to assume that a little traffic will leak to blog A. This is an incentive to track back to highly visited blogs (which happen to be, in most cases, the source of the information).</p>
<p>You might wonder what I&#039;ll be doing now that I realized that the whole trackback stuff doesn&#039;t work out so well&#8230; I&#039;m planning on launching something quite interesting in the following weeks, which might help understanding how information flows from blog to blog, so stay tuned <img src='http://friggeri.net/wp-includes/images/smilies/icon_wink.jpg' alt=';)' class='wp-smiley' /></p> <img src="http://friggeri.net/wp-content/plugins/feed-statistics.php?view=1&post_id=137" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://friggeri.net/blog/2008/07/04/following-trackbacks/feed</wfw:commentRss>
		</item>
		<item>
		<title>Google treasure hunt</title>
		<link>http://friggeri.net/blog/2008/05/18/google-treasure-hunt</link>
		<comments>http://friggeri.net/blog/2008/05/18/google-treasure-hunt#comments</comments>
		<pubDate>Sun, 18 May 2008 00:20:15 +0000</pubDate>
		<dc:creator>Adrien Friggeri</dc:creator>
		
		<category><![CDATA[randomness]]></category>

		<category><![CDATA[algorithmics]]></category>

		<category><![CDATA[google]]></category>

		<category><![CDATA[treasure hunt]]></category>

		<guid isPermaLink="false">http://friggeri.net/?p=130</guid>
		<description><![CDATA[Google australia is holding a brain teasing treasure hunt. The first question looks like this: 

A robot is located at the top-left corner of a 53 x 32 grid. The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid. [...]]]></description>
			<content:encoded><![CDATA[<p>Google australia is holding a brain teasing <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3RyZWFzdXJlaHVudC5hcHBzcG90LmNvbS8=">treasure hunt</a>. The first question looks like this: </p>
<blockquote><p>
A robot is located at the top-left corner of a 53 x 32 grid. The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid. How many possible unique paths are there?
</p></blockquote>
<p>The first thing I thought about was calculating all the paths using dynamic programming and memoization:</p>
<p>Let P(w,h) be the number of paths the robot can take to go from to top left corner of an w x h grid to its bottom left corner. If the robot goes left, it has P(w-1, h) possible paths left, and if it goes down, it has P(w, h-1). Of course, P(w, 1) = P(1, h) = 1.</p>
<p>The second approach gives the same results, but is obtained in a completely different manner. In the first case, it&#039;s mainly algorithmic, whereas the second case is purely combinatorics and &#8212; I think &#8212; far more elegant.</p>
<p>In order for the robot to go from the top left corner of an w x h grid to its bottom left corner, it must go (w-1) times left, and (h-1) times down, which is a total of w+h-2 movements. The number of paths is then the number of way of choosing which of those movements are (for example) going left. That is, choosing w-1 elements out of a set of w+h-2, best known as the binomial coefficient C(w+h-2, w-1). Of course, to compute it, one would use the recurrence used in Pascal&#039;s triangle : C(n, k) = C(n-1, k) + C(n-1, k-1), with C(n,0) = 1 and C(0,k) = 0.</p>
<p>The really nice thing about this is that two different ideas lead to one same result (it&#039;s just a question of rewriting the recurrence). This is creativity <img src='http://friggeri.net/wp-includes/images/smilies/icon_wink.jpg' alt=';)' class='wp-smiley' /> </p>
<p>Just to give you an idea of the numbers involved here : on a 67&#215;51 grid, there are 2049503709637561751443717895527866 paths. Believe me: it&#039;s huge !</p> <img src="http://friggeri.net/wp-content/plugins/feed-statistics.php?view=1&post_id=130" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://friggeri.net/blog/2008/05/18/google-treasure-hunt/feed</wfw:commentRss>
		</item>
		<item>
		<title>Namespacing JavaScript</title>
		<link>http://friggeri.net/blog/2008/05/12/namespacing-javascript</link>
		<comments>http://friggeri.net/blog/2008/05/12/namespacing-javascript#comments</comments>
		<pubDate>Mon, 12 May 2008 10:38:05 +0000</pubDate>
		<dc:creator>Adrien Friggeri</dc:creator>
		
		<category><![CDATA[randomness]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[namespaces]]></category>

		<guid isPermaLink="false">http://friggeri.net/?p=129</guid>
		<description><![CDATA[One of the biggest drawbacks in JS is the lack of proper namespaces. Some have long used objects to avoid global pollution, but I think it&#039;s possible to go further. That&#039;s how I came with those two functions : 
/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;}.ch_code_container .head {color: #808080; width:99%; font-weight: [...]]]></description>
			<content:encoded><![CDATA[<p>One of the biggest drawbacks in <acronym title="JavaScript">JS</acronym> is the lack of proper namespaces. Some have long used objects to avoid global pollution, but I think it&#039;s possible to go further. That&#039;s how I came with those two functions : </p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;}.ch_code_container .head {color: #808080; width:99%; font-weight: bold; font-size:1.2em; color:rgb(234,234,218); background-color:#968148; border-bottom: 1px solid #968148; padding: 2px; }.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #8ac6f2;}.ch_code_container .kw2 {color: #cae682;}.ch_code_container .co1 {color: #99968b;}.ch_code_container .coMULTI {color: #99968b;}.ch_code_container .es0 {color: #e7f6da;}.ch_code_container .br0 {color: #8ac6f2;}.ch_code_container .st0 {color: #95e454;}.ch_code_container .nu0 {color: #e5786d;}.ch_code_container .re0 {color: #95e454;}</style>
<div class="ch_code_container" style="font-family: monospace;"><span class="br0">&#40;</span><span class="kw2">function</span> <span class="br0">&#40;</span>global<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; bundle = <span class="kw2">function</span> <span class="br0">&#40;</span><span class="kw3">name</span>, func<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">var</span> cur = global;<br />
&nbsp; &nbsp; &nbsp; <span class="kw2">var</span> name_arr = <span class="kw3">name</span>.<span class="me1">split</span><span class="br0">&#40;</span><span class="st0">&#039;.&#039;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>i = <span class="nu0">0</span>, ilen = name_arr.<span class="me1">length</span>; i != ilen; i++<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> n = name_arr<span class="br0">&#91;</span>i<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; cur = cur<span class="br0">&#91;</span>n<span class="br0">&#93;</span> = cur<span class="br0">&#91;</span>n<span class="br0">&#93;</span> || <span class="br0">&#123;</span><span class="br0">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>func<span class="br0">&#41;</span> func.<span class="me1">call</span><span class="br0">&#40;</span>cur<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span>;<br />
&nbsp; &nbsp; fetch = <span class="kw2">function</span><span class="br0">&#40;</span>imports, func<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">var</span> ob = <span class="br0">&#123;</span><span class="br0">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw2">var</span> inject_bundle = <span class="kw2">function</span> <span class="br0">&#40;</span><span class="kw3">name</span>, ob<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> name_arr = <span class="kw3">name</span>.<span class="me1">split</span><span class="br0">&#40;</span><span class="st0">&#039;.&#039;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> cur = <span class="kw1">eval</span><span class="br0">&#40;</span>name_arr<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>i = <span class="nu0">1</span>, ilen = name_arr.<span class="me1">length</span> - <span class="nu0">1</span>; i != ilen; i++<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> n = name_arr<span class="br0">&#91;</span>i<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cur = cur<span class="br0">&#91;</span>n<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> last = name_arr<span class="br0">&#91;</span>name_arr.<span class="me1">length</span> - <span class="nu0">1</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>last == <span class="st0">&#039;*&#039;</span><span class="br0">&#41;</span> <span class="kw1">for</span><span class="br0">&#40;</span>k <span class="kw1">in</span> cur<span class="br0">&#41;</span> ob<span class="br0">&#91;</span>k<span class="br0">&#93;</span> = cur<span class="br0">&#91;</span>k<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span> ob<span class="br0">&#91;</span>last<span class="br0">&#93;</span> = cur<span class="br0">&#91;</span>last<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw1">typeof</span> imports == <span class="st0">&#039;string&#039;</span><span class="br0">&#41;</span> inject_bundle<span class="br0">&#40;</span>imports, ob<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">else</span> <span class="kw1">for</span> <span class="br0">&#40;</span>k <span class="kw1">in</span> imports<span class="br0">&#41;</span> inject_bundle<span class="br0">&#40;</span>imports<span class="br0">&#91;</span>k<span class="br0">&#93;</span>, ob<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> func.<span class="me1">call</span><span class="br0">&#40;</span>ob<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span>;<br />
&nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="br0">&#40;</span><span class="kw2">this</span><span class="br0">&#41;</span></p>
</div>
<p><code>bundle</code> is used to create a new namespace, given as a string. If a function is passed as a second argument, then it is called, bounded to the namespace. For example, one could use the following : </p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;}.ch_code_container .head {color: #808080; width:99%; font-weight: bold; font-size:1.2em; color:rgb(234,234,218); background-color:#968148; border-bottom: 1px solid #968148; padding: 2px; }.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #8ac6f2;}.ch_code_container .kw2 {color: #cae682;}.ch_code_container .co1 {color: #99968b;}.ch_code_container .coMULTI {color: #99968b;}.ch_code_container .es0 {color: #e7f6da;}.ch_code_container .br0 {color: #8ac6f2;}.ch_code_container .st0 {color: #95e454;}.ch_code_container .nu0 {color: #e5786d;}.ch_code_container .re0 {color: #95e454;}</style>
<div class="ch_code_container" style="font-family: monospace;">bundle<span class="br0">&#40;</span><span class="st0">&#039;net.friggeri.foo.bar&#039;</span>, <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">bleh</span> = <span class="st0">&quot;I&#039;m a turtle !&quot;</span>;<br />
&nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
bundle<span class="br0">&#40;</span><span class="st0">&#039;net.friggeri.quux&#039;</span>, <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">a</span> = <span class="nu0">32</span>;<br />
&nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">b</span> = <span class="nu0">52</span>;<br />
&nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
<span class="kw3">print</span><span class="br0">&#40;</span>net.<span class="me1">friggeri</span>.<span class="me1">foo</span>.<span class="me1">bar</span>.<span class="me1">bleh</span><span class="br0">&#41;</span>;<br />
<span class="kw3">print</span><span class="br0">&#40;</span>net.<span class="me1">friggeri</span>.<span class="me1">quux</span>.<span class="me1">a</span> * net.<span class="me1">frigger</span>.<span class="me1">quux</span>.<span class="me1">b</span><span class="br0">&#41;</span>;</p>
</div>
<p>You might think (and you&#039;d be right) that having long names can be a pain (I would never use something like <code>net.friggeri.quux.a</code>). However, using the <code>fetch</code> function, you can populate an object with whatever slots in a given namespace. Then, using <code>with</code>, you can emulate some kind of pythonish <code>import</code> statement. An example might be useful at this point:</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;}.ch_code_container .head {color: #808080; width:99%; font-weight: bold; font-size:1.2em; color:rgb(234,234,218); background-color:#968148; border-bottom: 1px solid #968148; padding: 2px; }.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #8ac6f2;}.ch_code_container .kw2 {color: #cae682;}.ch_code_container .co1 {color: #99968b;}.ch_code_container .coMULTI {color: #99968b;}.ch_code_container .es0 {color: #e7f6da;}.ch_code_container .br0 {color: #8ac6f2;}.ch_code_container .st0 {color: #95e454;}.ch_code_container .nu0 {color: #e5786d;}.ch_code_container .re0 {color: #95e454;}</style>
<div class="ch_code_container" style="font-family: monospace;">fetch<span class="br0">&#40;</span><span class="br0">&#91;</span><br />
&nbsp; <span class="st0">&#039;net.friggeri.foo.bar&#039;</span>,<br />
&nbsp; <span class="st0">&#039;net.friggeri.quux.*&#039;</span><br />
<span class="br0">&#93;</span>,<br />
<span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="kw1">with</span><span class="br0">&#40;</span><span class="kw2">this</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw3">print</span><span class="br0">&#40;</span>bar.<span class="me1">bleh</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="kw3">print</span><span class="br0">&#40;</span>a*b<span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><span class="br0">&#125;</span><span class="br0">&#41;</span></p>
</div>
<p>The code is pretty ugly: I have to use <code>eval</code> at some point to make sure it still works if called in a nested function and I didn&#039;t find a way to avoid using <code>with</code> in the function passed to <code>fetch</code>. Of course it&#039;s possible to use a <code>this.bar.bleh</code> syntax, but the whole point of <em>fetching</em> the contents of the bundle is to avoid using such long variable names.</p>
<p>If you wish to expand this, or have any suggestions, you&#039;re welcome to comment.</p>
<p><strong>Update</strong> : I just realized that it could be simplified a lot with having <code>fetch</code> returning directly the object, allowing something like :</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;}.ch_code_container .head {color: #808080; width:99%; font-weight: bold; font-size:1.2em; color:rgb(234,234,218); background-color:#968148; border-bottom: 1px solid #968148; padding: 2px; }.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #8ac6f2;}.ch_code_container .kw2 {color: #cae682;}.ch_code_container .co1 {color: #99968b;}.ch_code_container .coMULTI {color: #99968b;}.ch_code_container .es0 {color: #e7f6da;}.ch_code_container .br0 {color: #8ac6f2;}.ch_code_container .st0 {color: #95e454;}.ch_code_container .nu0 {color: #e5786d;}.ch_code_container .re0 {color: #95e454;}</style>
<div class="ch_code_container" style="font-family: monospace;"><span class="kw1">with</span><span class="br0">&#40;</span>fetch<span class="br0">&#40;</span><span class="br0">&#91;</span><br />
&nbsp; <span class="st0">&#039;net.friggeri.foo.bar&#039;</span>,<br />
&nbsp; <span class="st0">&#039;net.friggeri.quux.*&#039;</span><br />
<span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw3">print</span><span class="br0">&#40;</span>bar.<span class="me1">bleh</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="kw3">print</span><span class="br0">&#40;</span>a*b<span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></p>
</div>
<p>This is a very good example where having an <em>all functional</em> approach might not be the path to follow. <img src='http://friggeri.net/wp-includes/images/smilies/icon_wink.jpg' alt=';)' class='wp-smiley' /></p> <img src="http://friggeri.net/wp-content/plugins/feed-statistics.php?view=1&post_id=129" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://friggeri.net/blog/2008/05/12/namespacing-javascript/feed</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript Shell Scripting</title>
		<link>http://friggeri.net/blog/2008/05/08/javascript-shell-scripting</link>
		<comments>http://friggeri.net/blog/2008/05/08/javascript-shell-scripting#comments</comments>
		<pubDate>Thu, 08 May 2008 21:56:27 +0000</pubDate>
		<dc:creator>Adrien Friggeri</dc:creator>
		
		<category><![CDATA[randomness]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[xjs]]></category>

		<guid isPermaLink="false">http://friggeri.net/?p=128</guid>
		<description><![CDATA[A few days ago, Peter Michaux posted a very promising article concerning xjs. I&#039;ve long wanted to be able to use JS to write shell scripts (as one would do using bash, python or perl) but it lacked several important features. 
Peter has added a File module which wraps Java file operations, and I see [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3BldGVyLm1pY2hhdXguY2E=">Peter Michaux</a> posted a very promising article concerning <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3BldGVyLm1pY2hhdXguY2EvYXJ0aWNsZS83ODIz">xjs</a>. I&#039;ve long wanted to be able to use <acronym title="JavaScript">JS</acronym> to write shell scripts (as one would do using bash, python or perl) but it lacked several important features. </p>
<p>Peter has added a File module which wraps Java file operations, and I see this as the first step towards taking <acronym title="JavaScript">JS</acronym> out of web development. Let&#039;s face it, <acronym title="JavaScript">JS</acronym> is really present in browsers, <acronym title="Server Side JavaScript">SSJS</acronym> is taking off very slowly and even though a few apps use <acronym title="JavaScript">JS</acronym> for scripting, it&#039;s still not mainstream.</p>
<p>The way I dream of JavaScript&#039;s future ? As a general purpose scripting language. This means that several things have to be done. First, an easy way of binding whatever library to <acronym title="JavaScript">JS</acronym>. Second, a CPAN like repository dedicated to <acronym title="JavaScript">JS</acronym>. There is absolutely no control on how would evolve the latter. The former, however, can be conceived right now.</p>
<p>I&#039;m not really sure if I agree with Peter&#039;s choice of Rhino instead of SpiderMonkey, but I guess he has more experience with Java than with C &#8212; which is quite the opposite of my own <s>mis</s>conceptions. I guess there are pros and cons for each of the choices, but I wonder if it&#039;ll be easy to port generic C libraries to <acronym title="JavaScript">JS</acronym> using Rhino. I must clarify something at this point : I have a deep hatred of Java &#8212; it&#039;s a kind of zealous religion &#8212; and everything that comes near it appears like obscure magic to me.</p>
<p>Nevertheless, I really wish a lot of good things to xjs, and I hope that Peter will take into account the fact that an easy mechanism for porting library is a must-have.</p> <img src="http://friggeri.net/wp-content/plugins/feed-statistics.php?view=1&post_id=128" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://friggeri.net/blog/2008/05/08/javascript-shell-scripting/feed</wfw:commentRss>
		</item>
		<item>
		<title>VI in JavaScript</title>
		<link>http://friggeri.net/blog/2008/05/06/vi-in-javascript</link>
		<comments>http://friggeri.net/blog/2008/05/06/vi-in-javascript#comments</comments>
		<pubDate>Tue, 06 May 2008 11:40:42 +0000</pubDate>
		<dc:creator>Adrien Friggeri</dc:creator>
		
		<category><![CDATA[randomness]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://friggeri.net/?p=127</guid>
		<description><![CDATA[Completely useless but nevertheless awesome : jsvi is an implementation of Vi in Javascript which support several useful features, among those visual lines are really appreciated. I&#039;m not quite sure how this may be used in everyday life, but I&#039;m sure it could be adapted to replace textareas (without filling the whole page), allowing us [...]]]></description>
			<content:encoded><![CDATA[<p>Completely useless but nevertheless awesome : <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2dwbC5pbnRlcm5ldGNvbm5lY3Rpb24ubmV0L3ZpLw==">jsvi</a> is an implementation of Vi in Javascript which support several useful features, among those visual lines are really appreciated. I&#039;m not quite sure how this may be used in everyday life, but I&#039;m sure it could be adapted to replace textareas (without filling the whole page), allowing us to use more efficient text inputs than all the cluttered <em>What You Get Is All But What You Want</em> stuff we find nowadays.</p>
<p>One huge drawback : the <code>:emacs</code> command, why is this even implemented ?</p>
<p>A cool addition would be an implementation of auto completion, like the one I developed in <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ZyaWdnZXJpLm5ldC9ibG9nLzIwMDcvMTIvMTYvamltLXRoZS1qYXZhc2NyaXB0LW1vZGFsLWZyYW1ld29yaw==">Jim</a>.</p> <img src="http://friggeri.net/wp-content/plugins/feed-statistics.php?view=1&post_id=127" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://friggeri.net/blog/2008/05/06/vi-in-javascript/feed</wfw:commentRss>
		</item>
		<item>
		<title>Emulating catchall, getter and setter in JS</title>
		<link>http://friggeri.net/blog/2008/05/02/emulating-catchall-getter-and-setter-in-js</link>
		<comments>http://friggeri.net/blog/2008/05/02/emulating-catchall-getter-and-setter-in-js#comments</comments>
		<pubDate>Fri, 02 May 2008 14:44:14 +0000</pubDate>
		<dc:creator>Adrien Friggeri</dc:creator>
		
		<category><![CDATA[randomness]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://friggeri.net/?p=126</guid>
		<description><![CDATA[Getters and Setters are cool stuff, so is the notion of catchall. And, if it&#039;s a nice feature, it has to be implemented or emulated. I don&#039;t have nothing much to say about this except that I did it and that it works. The syntax isn&#039;t really nice, but it&#039;s usable. I used the same [...]]]></description>
			<content:encoded><![CDATA[<p>Getters and Setters are <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Vqb2huLm9yZy9ibG9nL2phdmFzY3JpcHQtZ2V0dGVycy1hbmQtc2V0dGVycy8=">cool stuff</a>, so is the notion of catchall. And, if it&#039;s a nice feature, it has to be implemented or emulated. I don&#039;t have nothing much to say about this except that I did it and that it works. The syntax isn&#039;t really nice, but it&#039;s usable. I used the same examples used <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2RldmVsb3Blci5tb3ppbGxhLm9yZy9lbi9kb2NzL0NvcmVfSmF2YVNjcmlwdF8xLjVfR3VpZGU6Q3JlYXRpbmdfTmV3X09iamVjdHM6RGVmaW5pbmdfR2V0dGVyc19hbmRfU2V0dGVycw==">here</a>.</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;}.ch_code_container .head {color: #808080; width:99%; font-weight: bold; font-size:1.2em; color:rgb(234,234,218); background-color:#968148; border-bottom: 1px solid #968148; padding: 2px; }.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #8ac6f2;}.ch_code_container .kw2 {color: #cae682;}.ch_code_container .co1 {color: #99968b;}.ch_code_container .coMULTI {color: #99968b;}.ch_code_container .es0 {color: #e7f6da;}.ch_code_container .br0 {color: #8ac6f2;}.ch_code_container .st0 {color: #95e454;}.ch_code_container .nu0 {color: #e5786d;}.ch_code_container .re0 {color: #95e454;}</style>
<div class="ch_code_container" style="font-family: monospace;"><span class="kw2">function</span> CGSobject <span class="br0">&#40;</span>catchall<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw2">var</span> o = <span class="kw2">function</span> <span class="br0">&#40;</span>k,v<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>v<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">var</span> curv = o.<span class="me1">content</span><span class="br0">&#91;</span>k<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span>curv &amp;&amp; curv.<span class="me1">set</span> &amp;&amp; curv.<span class="me1">set</span>.<span class="me1">call</span><span class="br0">&#40;</span>o.<span class="me1">content</span>,v<span class="br0">&#41;</span><span class="br0">&#41;</span> || <span class="br0">&#40;</span>o.<span class="me1">content</span><span class="br0">&#91;</span>k<span class="br0">&#93;</span> = v<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">var</span> v = o.<span class="me1">content</span><span class="br0">&#91;</span>k<span class="br0">&#93;</span> || o.<span class="me1">catchall</span><span class="br0">&#40;</span>k<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="br0">&#40;</span>v.<span class="me1">get</span> &amp;&amp; v.<span class="me1">get</span>.<span class="me1">call</span><span class="br0">&#40;</span>o.<span class="me1">content</span><span class="br0">&#41;</span><span class="br0">&#41;</span> || v;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
&nbsp; o.<span class="me1">content</span> = <span class="br0">&#123;</span><span class="br0">&#125;</span>;<br />
&nbsp; o.<span class="me1">catchall</span> = catchall || <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="kw1">return</span> <span class="kw2">null</span> <span class="br0">&#125;</span>;<br />
&nbsp; <span class="kw1">return</span> o;<br />
<span class="br0">&#125;</span></p>
<p>
<span class="kw2">var</span> o = CGSobject<span class="br0">&#40;</span><span class="kw2">function</span> <span class="br0">&#40;</span>x<span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="kw1">return</span> x<span class="nu0">+1</span>; <span class="br0">&#125;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// basic set</span><br />
o<span class="br0">&#40;</span><span class="st0">&quot;a&quot;</span>, <span class="nu0">7</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// basic get</span><br />
<span class="kw3">print</span><span class="br0">&#40;</span>o<span class="br0">&#40;</span><span class="st0">&quot;a&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// -&gt; 7</span></p>
<p><span class="co1">// getter</span><br />
o<span class="br0">&#40;</span><span class="st0">&quot;b&quot;</span>, <span class="br0">&#123;</span>get: <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="kw1">return</span> <span class="kw2">this</span>.<span class="me1">a</span><span class="nu0">+1</span>;<span class="br0">&#125;</span><span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
<span class="kw3">print</span><span class="br0">&#40;</span>o<span class="br0">&#40;</span><span class="st0">&quot;b&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// -&gt; 8</span></p>
<p><span class="co1">// setter</span><br />
o<span class="br0">&#40;</span><span class="st0">&quot;c&quot;</span>, <span class="br0">&#123;</span>set: <span class="kw2">function</span> <span class="br0">&#40;</span>x<span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="kw2">this</span>.<span class="me1">a</span> = x / <span class="nu0">2</span> <span class="br0">&#125;</span><span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
o<span class="br0">&#40;</span><span class="st0">&quot;c&quot;</span>, <span class="nu0">50</span><span class="br0">&#41;</span>;<br />
<span class="kw3">print</span><span class="br0">&#40;</span>o<span class="br0">&#40;</span><span class="st0">&quot;a&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// -&gt; 25</span></p>
<p><span class="co1">// catchall</span><br />
<span class="kw3">print</span><span class="br0">&#40;</span>o<span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// -&gt; 3</span><br />
<span class="kw3">print</span><span class="br0">&#40;</span>o<span class="br0">&#40;</span><span class="st0">&quot;foo &quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// -&gt; &quot;foo 1&quot;</span></p>
</div> <img src="http://friggeri.net/wp-content/plugins/feed-statistics.php?view=1&post_id=126" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://friggeri.net/blog/2008/05/02/emulating-catchall-getter-and-setter-in-js/feed</wfw:commentRss>
		</item>
		<item>
		<title>What Server Side JavaScript needs</title>
		<link>http://friggeri.net/blog/2008/05/02/what-server-side-javascript-needs</link>
		<comments>http://friggeri.net/blog/2008/05/02/what-server-side-javascript-needs#comments</comments>
		<pubDate>Fri, 02 May 2008 11:30:49 +0000</pubDate>
		<dc:creator>Adrien Friggeri</dc:creator>
		
		<category><![CDATA[randomness]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[server side]]></category>

		<category><![CDATA[ssjs]]></category>

		<guid isPermaLink="false">http://friggeri.net/?p=125</guid>
		<description><![CDATA[A few of use are convinced that SSJS is the way of the future, in terms of elegance and simplicity (using just one language for both client and server), etc. However, if we wish that one day JS beat PHP, there are several conditions.
First of all, I think the main drawback is inertia. PHP is [...]]]></description>
			<content:encoded><![CDATA[<p>A few of use are convinced that <acronym title="Server Side JavaScript">SSJS</acronym> is the way of the future, in terms of elegance and simplicity (using just one language for both client and server), etc. However, if we wish that one day <acronym title="JavaScript">JS</acronym> beat <acronym title="Pre-Hypertext Processing">PHP</acronym>, there are several conditions.</p>
<p>First of all, I think the main drawback is inertia. <acronym title="Pre-Hypertext Processing">PHP</acronym> is currently the way to go in web development (even though a few still use <acronym title="Active Server Pages">ASP</acronym>, <acronym title="Common Gateway Interface">CGI</acronym>, etc.). In order to counter the inertia, any new server side language has to be as good as <acronym title="Pre-Hypertext Processing">PHP</acronym> (not so difficult to do), as easy to learn and have exciting new features.</p>
<p>Python and <acronym title="Practical Extraction and Report Language">Perl</acronym> have been around for quite some time, without becoming dominant, so I guess that they won&#039;t in the future. </p>
<p>Some said that RoR was that alternative, and let&#039;s face it : it&#039;s trendy among Mac geeks using textmate&#8230;  Not that I have anything against this, but those developers live in another world: RoR has basically several flaws which can&#039;t be overcome. First, it doesn&#039;t scale. Second, it doesn&#039;t have a C-like syntax, and this has a psychological impact on devs coming from the <acronym title="Pre-Hypertext Processing">PHP</acronym> world. Third, it&#039;s <em>yet another language</em> to learn. Fourth, it didn&#039;t play well under Apache until recently. The reason why some guys switched to RoR could be summed up to three points: the <acronym title="Model, View, Controller">MVC</acronym> model, the Active Record pattern and scaffolding.</p>
<p>All those ideas are nice, but it&#039;s not enough for RoR to be the <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3N0ZXZlLXllZ2dlLmJsb2dzcG90LmNvbS8yMDA3LzAyL25leHQtYmlnLWxhbmd1YWdlLmh0bWw=">Next Big Language</a>.  <acronym title="Server Side JavaScript">SSJS</acronym> is exploding right now, with quite a number of <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9TZXJ2ZXJfc2lkZV9qYXZhc2NyaXB0">solutions</a> being developed. However, most of those are bloated and are either ports of <acronym title="Pre-Hypertext Processing">PHP</acronym> or RoR to <acronym title="JavaScript">JS</acronym>. The only one which takes it to another level is <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hcHRhbmEuY29tL2pheGVyLw==">Jaxer</a>, which is a nice concept, but is intrinsically unscalable: how can one imagine having hundred thousands instances of <acronym title="Document Object Model">DOM</acronym> trees being manipulated at the same time on the server and being delivered quickly ?</p>
<p>I believe that the <acronym title="JavaScript">JS</acronym> strength resides not only in the fact that it&#039;s usable on the client, but also because it&#039;s prototype based. For example, Active Record is something nice for class based object orientation, but I believe that there are much simpler approaches using prototypes.</p>
<p>Nevertheless, unless someone comes up with some revolutionnary features for <acronym title="Server Side JavaScript">SSJS</acronym>, I&#039;m afraid that it&#039;ll stay a niche language (on the server).</p> <img src="http://friggeri.net/wp-content/plugins/feed-statistics.php?view=1&post_id=125" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://friggeri.net/blog/2008/05/02/what-server-side-javascript-needs/feed</wfw:commentRss>
		</item>
		<item>
		<title>This is the future</title>
		<link>http://friggeri.net/blog/2008/04/30/this-is-the-future</link>
		<comments>http://friggeri.net/blog/2008/04/30/this-is-the-future#comments</comments>
		<pubDate>Wed, 30 Apr 2008 21:03:13 +0000</pubDate>
		<dc:creator>Adrien Friggeri</dc:creator>
		
		<category><![CDATA[randomness]]></category>

		<category><![CDATA[future]]></category>

		<guid isPermaLink="false">http://friggeri.net/?p=121</guid>
		<description><![CDATA[According to this article, a team at HP Labs have developed a new circuit element (the memristor). I&#039;m not really into physics, but basically it allows persistant storage of data: if you flow the charge in one direction, the resistance increases, if you flow it the other way round, it decreases.
I won&#039;t detail more than [...]]]></description>
			<content:encoded><![CDATA[<p>According to this <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cud2lyZWQuY29tL2dhZGdldHMvMjAwOC8wNC9zY2llbnRpc3RzLXByb3YuaHRtbA==">article</a>, a team at HP Labs have developed a new circuit element (the memristor). I&#039;m not really into physics, but basically it allows persistant storage of data: if you flow the charge in one direction, the resistance increases, if you flow it the other way round, it decreases.</p>
<p>I won&#039;t detail more than that, as the article and its comments give a lot more information that I&#039;d be able to. From times to times, I read something and I just think <em>we&#039;re living in the future, this will be everywhere, eventually</em>.</p> <img src="http://friggeri.net/wp-content/plugins/feed-statistics.php?view=1&post_id=121" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://friggeri.net/blog/2008/04/30/this-is-the-future/feed</wfw:commentRss>
		</item>
		<item>
		<title>[whatever] in JavaScript</title>
		<link>http://friggeri.net/blog/2008/04/29/whatever-in-javascript</link>
		<comments>http://friggeri.net/blog/2008/04/29/whatever-in-javascript#comments</comments>
		<pubDate>Tue, 29 Apr 2008 12:02:52 +0000</pubDate>
		<dc:creator>Adrien Friggeri</dc:creator>
		
		<category><![CDATA[randomness]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://friggeri.net/?p=110</guid>
		<description><![CDATA[Those last days, there has been a lot of fuss all around about Orto and HotRuby. I&#039;ve also heard of a project of OCaml bytecode interpreter in JS, though I have no link for it at this time. Having some Java/Ruby/OCaml bytecode interpreted in JavaScript is quite nice, but I just can&#039;t see what&#039;s new/interesting [...]]]></description>
			<content:encoded><![CDATA[<p>Those last days, there has been a lot of fuss all around about Orto and <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2hvdHJ1YnkuYWNjZWxhcnQuanAv">HotRuby</a>. I&#039;ve also heard of a project of <acronym title="Objective Caml">OCaml</acronym> bytecode interpreter in <acronym title="JavaScript">JS</acronym>, though I have no link for it at this time. Having some Java/Ruby/<acronym title="Objective Caml">OCaml</acronym> bytecode interpreted in JavaScript is quite nice, but I just can&#039;t see what&#039;s new/interesting about that.</p>
<p>There are quite a few other languages for which a <acronym title="JavaScript">JS</acronym> interpreter is available: <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5xdWl0ZWJhc2ljLmNvbS8=">Basic</a>, <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jcm9ja2ZvcmQuY29tL2phdmFzY3JpcHQvc2NoZW1lLmh0bWw=">Scheme</a>, <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5qb2VnYW5sZXkuY29tL2NvZGUvanNsaXNwLmh0bWw=">Lisp</a>, <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2lvY3RsLm9yZy9sb2dpYy9wcm9sb2ctbGF0ZXN0">Prolog</a>. Even Javascript can be interpreted in <acronym title="JavaScript">JS</acronym> using <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2x4ci5tb3ppbGxhLm9yZy9tb3ppbGxhL3NvdXJjZS9qcy9uYXJjaXNzdXMv">Narcissus</a>. If this is not enough for you, I can add <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2p1c3RpY2UubG95b2xhLmVkdS8lN0VtY29mZmV5L3ByLzVrL2kuaHRtbA==">Brainfuck</a> or even other <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zYWZhbHJhLmNvbS9wcm9ncmFtbWluZy9lc290ZXJpYy1sYW5ndWFnZXMvaW50ZXJwcmV0ZXJzLw==">esoteric languages</a>.</p>
<p>I guess you&#039;ll say that all of those bring nothing interesting to the browser and that using compiled bytecode instead of parsing/interpreting source code is much faster. The latter can be easily forgotten, what about an <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3RpbWhhdGNoLmNvbS9wcm9qZWN0cy9qc2Fzc2VtYmx5Lw==">x86</a> interpreter ?</p>
<p>Nevertheless, what is the easiest thing to write ?</p>
<ul>
<li>plain JavaScript, with a powerful library such as <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2pxdWVyeS5jb20=">JQuery</a></li>
<li>some bloated Java using cluttered <acronym title="Graphical User Interface">GUI</acronym> tools which were not built to output web components</li>
</ul>
<p>A few years ago, writing some JavaScript meant dealing with cross browser issues. Today, <acronym title="JavaScript">JS</acronym> is much more friendly, thanks to a lot of libraries. Moreover, I&#039;m pretty sure the next move will be <acronym title="Server Side JavaScript">SSJS</acronym>, is there a reason (other than <em>because I can</em>) for porting Java/Ruby to <acronym title="JavaScript">JS</acronym> ? </p> <img src="http://friggeri.net/wp-content/plugins/feed-statistics.php?view=1&post_id=110" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://friggeri.net/blog/2008/04/29/whatever-in-javascript/feed</wfw:commentRss>
		</item>
		<item>
		<title>Memories</title>
		<link>http://friggeri.net/blog/2008/04/16/memories</link>
		<comments>http://friggeri.net/blog/2008/04/16/memories#comments</comments>
		<pubDate>Wed, 16 Apr 2008 02:40:32 +0000</pubDate>
		<dc:creator>Adrien Friggeri</dc:creator>
		
		<category><![CDATA[randomness]]></category>

		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://friggeri.net/?p=108</guid>
		<description><![CDATA[About 16 years ago, I got my first computer which was a Tandon running Windows 3.1. My dad, who used to use it for work had brought back home a Digital station and had no use for the old machine anymore. Anyway, that&#039;s how I discovered the joy of MS-DOS when I was not even [...]]]></description>
			<content:encoded><![CDATA[<p>About 16 years ago, I got my first computer which was a Tandon running Windows 3.1. My dad, who used to use it for work had brought back home a Digital station and had no use for the old machine anymore. Anyway, that&#039;s how I discovered the joy of <acronym title="Microsoft">MS</acronym>-DOS when I was not even 7 years old. Actually, I was not <strong>that</strong> geek, my main activity on the computer were two games: Sim City and Populous.</p>
<p>A year later, in 1993, my mum brought back a Compaq running Windows 3.11 with a <acronym title="Compact Disc">CD</acronym>-ROM drive. I never used that machine, because at that time I spent my time on a little game on my dad&#039;s computer. That same year, my dad came back from the US with a brand new game: Doom. The day I tried it, I had a revelation: I could not stand FPS.</p>
<p>In 1996, my parents bought a new computer, a Pentium Pro 200 Gateway, with a 17&#034; monitor and Windows 95. Six months later we had an Internet access. I remember that the first thing I searched using AltaVista was <em>Lego</em>, followed by <em>Star Wars</em>&#8230; Some of my parent&#039;s friends told us about a software called ICQ, and that was the beginning of a long story. When I was not chatting, I used to play to Civilization II, Myst and Warcraft.</p>
<p>In 1997, I remember playing a demo of a gore game which I fell in love with: GTA. I acquired the game and spent long hours tweaking it, which was real fun. I also spent numerous hours on Age of Empires, but I was too lazy to not use cheat codes. This was my last RTS experience.</p>
<p>A few years later, around 1999, we got a cable connection. Internet became something different: this permanent extension of existence. Terrifying. In April I downloaded my first mp3 from a chinese web page hosted on Geocities and discovered Napster a few months later. Google arrived in my life and I never used another search engine since. In the mean time, I started having some fun with <acronym title="Active Server Pages">ASP</acronym> and VBScript, and this was my first programming experience.</p>
<p>By the end of 2000, I spent my time playing GTA II. I got a free domain name on NameZero and created Copkilla.net and hosted something which was meant to be a fansite. And I was still using the Gateway&#8230;</p>
<p>The next year, I bought my very own computer and I discovered T4C, my first MMORPG experience, and became an addict. I spent my life online: when I was not playing, I was on some T4C forum. I spent almost 4 years on that game, and in 2003 became Game Master and eventually Admin of a french official server. No need to say that my whole life turned around that game. </p>
<p>In 2003, a friend sold me a motherboard with a PIV and a GeForce V for ~20€, which was a really cheap upgrade. I got my <em>baccalauréat</em> and went to <em>classe préparatoire</em> and I had to choose between computer sciences and engineering as an option. I obviously took computer science, and this is how I met Caml and functional programming.</p>
<p>During the summer of 2004 and 2005 I worked at <a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5tb25zaWV1cnByaXguY29tLw==">MonsieurPrix.com</a>/<a href="http://friggeri.net/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5rZWxrb28uY29tLw==">Kelkoo.com</a>. The first time I wrote a robot to scrape Amazon&#039;s catalog and insert it in the products database, the second time a robot to submit loads of keywords into Google Adwords, both projects were written using <acronym title="Active Server Pages">ASP</acronym>.</p>
<p>By the end of 2005 I launched my personal blog, which was a mere conglomerate of thoughts, poems and such. I started tweaking my WordPress install and got familiar with xhtml and <acronym title="Cascading Style Sheets">CSS</acronym>.</p>
<p>In 2006, I entered the <em>Ecole Normale Supérieure de Lyon</em> and discovered a whole new world: Linux. In september I bought the HP laptop I am currently using and installed an Ubuntu on it. I then learned a few new languages: <acronym title="Objective Caml">OCaml</acronym>, C, C++, a little bit of Python, <acronym title="Pre-Hypertext Processing">PHP</acronym>. I started using vim as my text editor, ion3 as my window manager and became a CLI fanatic. I got contaminated by the <em>dual screen sickness</em>.</p>
<p>In June 2007 I abandoned my personal blog and decided to have a more technical one, this was the birth of Syntactic Sugar. I discovered Duels and launched what would be its unique fansite for 6 months. In October I finally switched to Debian and installed a server in my studio, in order to have all my web development, a few <em>screens</em>, etc. permanently available. In December I fell in love with JavaScript and prototype based programming. More recently, I translated this whole blog in English, and here we are.</p>
<p>That&#039;s all for now. I can&#039;t really guarantee that the timeline is exact, but it seems that the dates are correct. I&#039;ll try to post a follow up in 10 years <img src='http://friggeri.net/wp-includes/images/smilies/icon_biggrin.jpg' alt=':D' class='wp-smiley' /></p> <img src="http://friggeri.net/wp-content/plugins/feed-statistics.php?view=1&post_id=108" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://friggeri.net/blog/2008/04/16/memories/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
