<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Il y a du thé renversé au bord de la table &#187; OCaml</title>
	<atom:link href="http://dutherenverseauborddelatable.wordpress.com/category/ocaml/feed/" rel="self" type="application/rss+xml" />
	<link>http://dutherenverseauborddelatable.wordpress.com</link>
	<description>Adventure! Excitement! Wonders! Random thoughts by David Rajchenbach-Teller!</description>
	<lastBuildDate>Thu, 20 Jun 2013 09:22:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dutherenverseauborddelatable.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Il y a du thé renversé au bord de la table &#187; OCaml</title>
		<link>http://dutherenverseauborddelatable.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dutherenverseauborddelatable.wordpress.com/osd.xml" title="Il y a du thé renversé au bord de la table" />
	<atom:link rel='hub' href='http://dutherenverseauborddelatable.wordpress.com/?pushpress=hub'/>
		<item>
		<title>JavaScript, this static language (part 1)</title>
		<link>http://dutherenverseauborddelatable.wordpress.com/2011/10/20/javascript-this-static-language-part-1/</link>
		<comments>http://dutherenverseauborddelatable.wordpress.com/2011/10/20/javascript-this-static-language-part-1/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 13:31:36 +0000</pubDate>
		<dc:creator>yoric</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[In English / En anglais]]></category>
		<category><![CDATA[Informatique / Computer science]]></category>
		<category><![CDATA[OCaml]]></category>
		<category><![CDATA[Recherche / Research]]></category>
		<category><![CDATA[Sûreté / Security]]></category>
		<category><![CDATA[Société]]></category>
		<category><![CDATA[closure compiler]]></category>
		<category><![CDATA[eval]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[lambda-calculus]]></category>
		<category><![CDATA[ml]]></category>
		<category><![CDATA[safety]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[static analysis]]></category>
		<category><![CDATA[static typing]]></category>
		<category><![CDATA[type inference]]></category>
		<category><![CDATA[typing]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[web applications]]></category>

		<guid isPermaLink="false">http://dutherenverseauborddelatable.wordpress.com/?p=957</guid>
		<description><![CDATA[tl;dr JavaScript is a dynamic language. However, by borrowing a few pages from static languages – and a few existing tools – we can considerable improve reliability and maintainability. « Writing one million lines of code of JavaScript is simply impossible » (source: speaker in a recent open-source conference) JavaScript is a dynamic language – [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=957&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h2 style="text-align:justify;">tl;dr</h2>
<p style="text-align:justify;">JavaScript is a dynamic language. However, by borrowing a few pages from static languages – and a few existing tools – we can considerable improve reliability and maintainability.</p>
<h2 style="text-align:justify;">« Writing one million lines of code of JavaScript is simply impossible »</h2>
<p style="text-align:right;">(source: speaker in a recent open-source conference)</p>
<p style="text-align:justify;">JavaScript is a dynamic language – a very dynamic one, in which programs can rewrite themselves, objects may lose or gain methods through side-effects on themselves on on their prototypes, and, more generally, nothing is fixed.</p>
<p style="text-align:justify;">And dynamic languages are fun. They make writing code simple and fast. They are vastly more suited to prototyping than static languages. Dynamism also makes it possible to write extremely powerful tools that can perform JIT translation from other syntaxes, add missing features to existing classes and functions and more generally fully customize the experience of the developer.</p>
<p style="text-align:justify;">Unfortunately, such dynamism comes with severe drawbacks. Safety-minded developers will tell you that, because of this dynamism, they simply cannot trust any snippet, as this snippet may behave in a manner that does not match its source code. They will conclude that you cannot write safe, or even modular, applications in JavaScript.</p>
<p style="text-align:justify;">Many engineering-minded developers will also tell you that they simply cannot work in JavaScript, and they will not have much difficulty finding examples of situations in which the use of a dynamic language in a complex project can, effectively, kill the project. If you do not believe them, consider a large codebase, and the (rather common) case of a large transversal refactoring, for instance to replace an obsolete API by a newer one. Do this in Java (or, even better, in a more modern mostly-static language such as OCaml, Haskell, F# or Scala), and you can use the compiler to automatically and immediately spot any place where the API has not been updated, and will spot a number of errors that you may have made with the refactoring. Even better, if the API was designed to be safe-by-design, the compiler will automatically spot even complex errors that you may have done during refactoring, including calling functions/methods in the wrong order, or ownership errors. Do the same in JavaScript and, while your code will be written faster, you should expect to be hunting bugs weeks or even months later.</p>
<p style="text-align:justify;">I know that the Python community has considerably suffered from such problems during version transitions. I am less familiar with the world of PHP, but I believe this is no accident that Facebook is progressively arming itself with PHP static analysis tools. I also believe that this is no accident that Google is now <a title="First look at Google Dart" href="http://dutherenverseauborddelatable.wordpress.com/2011/10/13/first-look-at-google-dart/" target="_blank">introducing a typed language as a candidate replacement for JavaScript</a>.</p>
<p style="text-align:justify;">That is because today is the turn of JavaScript, or if not today, surely tomorrow. I have seen applications consisting in hundreds of thousands of lines of JavaScript. And if just maintaining these applications is not difficult enough, the rapid release cycles of both  Mozilla and Chrome, mean that external and internal APIs are now changing every six weeks. This means breakage. And, more precisely, this means that we need new tools to help us predict breakages and help developers (both add-on developers and browser contributors) react before these breakages hit their users.</p>
<p style="text-align:justify;">So let&#8217;s do something about it. Let&#8217;s make <em>our</em> JavaScript a strongly, statically typed language!</p>
<p style="text-align:justify;">Or let&#8217;s do something a little smarter.</p>
<h2 style="text-align:justify;">JavaScript, with discipline</h2>
<p style="text-align:justify;">At this point, I would like to ask readers to please kindly stop preparing tar and feathers for me. I realize fully that JavaScript is a dynamic language and that turning it into a static language will certainly result in something quite disagreeable to use. Something that is verbose, has lost most of the power of JavaScript, and gained no safety guarantees.</p>
<p style="text-align:justify;">Trust me on this, there is a way to obtain the best of both worlds, without sacrificing anything. Before discussing the manner in which we can attain this, let us first set objectives that we can hope to achieve with a type-disciplined JavaScript.</p>
<h3 style="text-align:justify;">Finding errors</h3>
<p style="text-align:justify;">The main benefit of strong, static typing, is that it helps find errors.</p>
<ul>
<li style="text-align:justify;">Even the simplest analyses can find <em>all</em> syntax errors, <em>all</em> unbound variables, <em>all</em> variables bound several times and consequently almost all scoping errors, which can already save considerable time for developers. Such an analysis requires no human intervention from the developer besides, of course, fixing any error that has been thus detected. As a bonus, in most cases, the analysis can suggest fixes.</li>
<li style="text-align:justify;">Similarly trivial forms of analysis can also detect suspicious calls to break or continue, weird uses of <code>switch()</code>, suspicious calls to private fields of objects, as well as suspicious occurrences of <code>eval</code> – in my book, eval is always suspicious.</li>
<li style="text-align:justify;">Slightly more sophisticated analyses can find <em>most occurrences</em> of functions or methods invoked with the wrong number of arguments. Again, this is without human intervention. With type annotations/documentation, we can move from <em>most occurrences</em> to <em>all occurrences</em>.</li>
<li style="text-align:justify;">This same analysis, when applied to public APIs, can provide developers with more informations regarding how their code can be (mis)used.</li>
<li style="text-align:justify;">At the same level of complexity, analysis can find <em>most</em> erroneous access to fields/methods, suspicious array traversals, suspicious calls to iterators/generators, etc. Again, with type annotations/documentation, we can move from <em>most</em> to <em>all</em>.</li>
<li>Going a little further in complexity, analysis can find fragile uses of <code>this</code>, uncaught exceptions, etc.</li>
</ul>
<h3></h3>
<h3>Types as documentation</h3>
<p style="text-align:justify;">Public APIs must be documented. This is true in any language, no matter where it stands on the static/dynamic scale. In static languages, one may observe how documentation generation tools insert type information, either from annotations provided by the user (as in Java/JavaDoc) or from type information inferred by the compiler (as in OCaml/OCamlDoc). But look at the documentation of Python, Erlang or JavaScript libraries and you will find the exact same information, either clearly labelled or hidden somewhere in the prose: every single value/function/method comes with a form of type signature, whether formal or informal.</p>
<p style="text-align:justify;">In other words, type information is a critical piece of documentation. If JavaScript developers provide explicit type annotations along with their public APIs, they have simply advanced the documentation, not wasted time. Even better, if such type can be automatically inferred from the source code, this piece of documentation can be automatically written by the type-checker.</p>
<h3 style="text-align:justify;">Types as QA metric</h3>
<p style="text-align:justify;">While disciples of type-checking tend to consider typing as something boolean, the truth is more subtle: it quite possible that one piece of code does not pass type-checking while the rest of the code does. Indeed, with advanced type systems that do not support decidable type inference, this is only to be expected.</p>
<p style="text-align:justify;">The direct consequence is that type-checking can be seen as a spectrum of quality. A code can be seen as <em>failing</em> if the static checking phrase can detect evident errors, typically unbound values or out-of-scope break, continue, etc. Otherwise, every attempt to type a value that results in a type error is a hint of poor QA practice that can be reported to the developer. This yields a percentage of values that can be typed – obtain 100% and get a QA stamp of approval for this specific metric.</p>
<h2 style="text-align:justify;"></h2>
<h2>Typed JavaScript, in practice</h2>
<p style="text-align:justify;">Most of the previous paragraphs are already possible in practice, with existing tools. Indeed, I have personally experienced using JavaScript static type checking as a bug-finding tool and a QA metric. On the first day, this technique has helped me find both plenty of dead code and 750+ errors, with only a dozen false positives.</p>
<p style="text-align:justify;">For this purpose, I have used Google&#8217;s <a href="http://www.slideshare.net/pascallouis/type-checking-javascript" target="_blank">Closure Compiler</a>. This tool detects errors, supports a simple vocabulary for documentation/annotations, fails only if very clear errors are detected (typically syntax errors) and provides as metric a percentage of well-typed code. It does not accept JavaScript 1.7 yet, unfortunately, but this can certainly be added.</p>
<p style="text-align:justify;">I also know of existing academic work to provide static type-checking for JavaScript, although I am unsure as to the maturity of such works.</p>
<p>Finally, Mozilla is currently working on a different type inference mechanism for JavaScript. While this mechanism is not primarily aimed at finding errors, my personal intuition is that it may be possible to repurpose it.</p>
<h2></h2>
<h2>What&#8217;s next?</h2>
<p style="text-align:justify;">I hope that I have convinced you of the interest of investigating manners of introducing static, strong type-checking to JavaScript. In a second part, I will detail how and where I believe that this can be done in Mozilla.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dutherenverseauborddelatable.wordpress.com/957/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dutherenverseauborddelatable.wordpress.com/957/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=957&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dutherenverseauborddelatable.wordpress.com/2011/10/20/javascript-this-static-language-part-1/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/26385ab59b5a13c50262c302a3bcd17c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yoric</media:title>
		</media:content>
	</item>
		<item>
		<title>Goodbye MLstate, goodbye Opa</title>
		<link>http://dutherenverseauborddelatable.wordpress.com/2011/09/06/goodbye-mlstate-goodbye-opa/</link>
		<comments>http://dutherenverseauborddelatable.wordpress.com/2011/09/06/goodbye-mlstate-goodbye-opa/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 15:36:40 +0000</pubDate>
		<dc:creator>yoric</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[In English / En anglais]]></category>
		<category><![CDATA[Informatique / Computer science]]></category>
		<category><![CDATA[OCaml]]></category>
		<category><![CDATA[OPA]]></category>
		<category><![CDATA[Recherche / Research]]></category>
		<category><![CDATA[actors]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[mlstate]]></category>
		<category><![CDATA[opalang]]></category>
		<category><![CDATA[r&d]]></category>
		<category><![CDATA[resignation]]></category>
		<category><![CDATA[scalability]]></category>

		<guid isPermaLink="false">http://dutherenverseauborddelatable.wordpress.com/?p=917</guid>
		<description><![CDATA[Tides come and tides go. Two years ago, I accepted to join MLstate, to take lead of the R&#38;D group, and turn Opa from a promising early-stage demo into a world-class technology. And I am happy to say that we succeeded. Certainly, there are still many things that we would like to improve in Opa, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=917&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Tides come and tides go.</p>
<p style="text-align:justify;">Two years ago, I accepted to join MLstate, to take lead of the R&amp;D group, and turn Opa from a promising early-stage demo into a world-class technology. And I am happy to say that we succeeded. Certainly, there are still many things that we would like to improve in Opa, but looking back on those two years, I am proud of the work we have accomplished, of the number of topics upon which we have pushed forward the state of the art, and even of many of the mistakes we have made, because they have expanded our understanding so much.</p>
<p style="text-align:justify;">Now, after two years at MLstate, I am leaving. Our work is accomplished and I do not feel that I can contribute in any meaningful way to what MLstate has now become, nor that today&#8217;s MLstate can keep me excited and interested any longer. In the past few days, Opa has been featured on Lambda the Ultimate, on Hacker News and on Slashdot. Small and large high-tech companies have tried and enjoyed the technology. What better time than this to set sail and say goodbye to these two exciting years of my life?</p>
<p style="text-align:justify;">As of today, I am not the Head of Research &amp; Development, Chief Scientific Officer or Technological Evangelist at MLstate anymore. I will keep a distant eye on Opa, but I will not design or supervise its future versions. <a href="http://www.linkedin.com/pub/mathieu-baudet/9/6b0/a52">Mathieu Baudet</a>, our COO, is replacing me as the supervisor for the development of Opa, while <a href="http://adam-koprowski.net/">Adam Koprowski</a> is replacing me as Technological Evangelist. Mathieu is a very intelligent security researcher and I am sure that he will impose a new style to the Opa team, and Adam is a bright and enthusiastic researcher/developer, and certainly the best person at MLstate to carry on Opa advocacy.</p>
<p style="text-align:justify;">I would like to thank my University for supporting this foray into the exciting world of start-ups. I would like to thank our CEO for recruiting such a talented team. I would also like to thank Mehdi Ben Soltane, our CFO/HR director, who managed to do his job with a nice and welcome pinch of humor, even in the toughest of times. And mostly, I would like to thank all the R&amp;D team: Maxime Audouin, Mathieu Barbin, Vincent Benayoun, Anthonin Bonnefoy, Raja Boujbel, Quentin Bourgerie, Sébastien Briais, Valentin Gatien-Baron, Louis Gesbert, Nicolas Glondu, Hugo Heuzard, Adrien Jonquet, Mikolaj Konarski, Adam Koprowski, Laurent LeBrun, Sarah Maarek, Grégoire Makridis, François Pessaux, Guillem Rieu, Pascal Rigaux, Norman Scaife, Rudy Sicard, François-Régis Sinot, Cédric Soulas, Quickie Squeaky, Hugo Venturini, Frédéric Ye, and all our successive generations of interns[1]: you are the best team I have ever had the chance to join, it really was an honor and a pleasure working with you all and I hope that those among you who have chosen to remain in MLstate have as much fun working under Mathieu&#8217;s leadership as I had working with you all.</p>
<p style="text-align:justify;">Time to set sail! My next missive should arrive from the next port.</p>
<p style="text-align:justify;">[1] Sorry, I do not have the list of interns at hand. But do not worry, I enjoyed working with you, too <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dutherenverseauborddelatable.wordpress.com/917/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dutherenverseauborddelatable.wordpress.com/917/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=917&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dutherenverseauborddelatable.wordpress.com/2011/09/06/goodbye-mlstate-goodbye-opa/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/26385ab59b5a13c50262c302a3bcd17c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yoric</media:title>
		</media:content>
	</item>
		<item>
		<title>Opa advocacy</title>
		<link>http://dutherenverseauborddelatable.wordpress.com/2011/08/28/opa-advocacy/</link>
		<comments>http://dutherenverseauborddelatable.wordpress.com/2011/08/28/opa-advocacy/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 04:34:44 +0000</pubDate>
		<dc:creator>yoric</dc:creator>
				<category><![CDATA[In English / En anglais]]></category>
		<category><![CDATA[OCaml]]></category>
		<category><![CDATA[OPA]]></category>

		<guid isPermaLink="false">http://dutherenverseauborddelatable.wordpress.com/?p=913</guid>
		<description><![CDATA[Opa advocacy and tutorials have moved to their own, dedicated blog. The topics are now covered by Adam Koprowski. Thanks for handling this, Adam!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=913&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;">Opa advocacy and tutorials have moved to <a href="http://blog.opalang.org/">their own, dedicated blog</a>. The topics are now covered by Adam Koprowski. Thanks for handling this, Adam!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dutherenverseauborddelatable.wordpress.com/913/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dutherenverseauborddelatable.wordpress.com/913/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=913&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dutherenverseauborddelatable.wordpress.com/2011/08/28/opa-advocacy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/26385ab59b5a13c50262c302a3bcd17c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yoric</media:title>
		</media:content>
	</item>
		<item>
		<title>Opa on Lambda the Ultimate (and now Slashdot)</title>
		<link>http://dutherenverseauborddelatable.wordpress.com/2011/08/28/opa-on-lambda-the-ultimate/</link>
		<comments>http://dutherenverseauborddelatable.wordpress.com/2011/08/28/opa-on-lambda-the-ultimate/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 04:31:52 +0000</pubDate>
		<dc:creator>yoric</dc:creator>
				<category><![CDATA[In English / En anglais]]></category>
		<category><![CDATA[Informatique / Computer science]]></category>
		<category><![CDATA[OCaml]]></category>
		<category><![CDATA[OPA]]></category>
		<category><![CDATA[Recherche / Research]]></category>
		<category><![CDATA[hacker news]]></category>
		<category><![CDATA[lambda]]></category>
		<category><![CDATA[lambda the ultimate]]></category>
		<category><![CDATA[programming language]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[slashdot]]></category>

		<guid isPermaLink="false">http://dutherenverseauborddelatable.wordpress.com/?p=911</guid>
		<description><![CDATA[There is a nice discussion on Opa on Lambda the Ultimate forums. If you are not familiar with Lambda the Ultimate, know that this is the place for discussing new and exotic programming languages and programming concepts, so the simple fact of seeing a thread on LtU is something of an honor for us. See [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=911&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;">There is a <a href="http://lambda-the-ultimate.org/node/4336">nice discussion on Opa on Lambda the Ultimate forums</a>. If you are not familiar with <a href="http://lambda-the-ultimate.org/">Lambda the Ultimate</a>, know that this is <em>the</em> place for discussing new and exotic programming languages and programming concepts, so the simple fact of seeing a thread on LtU is something of an honor for us.</p>
<p style="text-align:justify;">See also</p>
<ul>
<li><a href="http://news.ycombinator.com/item?id=2925609">the Hacker News thread spawned by this LtU thread</a>;</li>
<li><a href="http://developers.slashdot.org/story/11/08/27/2115210/Announcing-Opa-Making-Web-Programming-Transparent">the Slashdot thread spawned by this LtU thread</a>.</li>
</ul>
<p style="text-align:justify;"><strong>Edit</strong> Added the Slashdot thread.</p>
<p style="text-align:justify;"><strong>Edit</strong> Gasp, Slashdot is down. Hey, GeekNet, if you need a scalable programming language for the next version of Slashcode, just ping us <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dutherenverseauborddelatable.wordpress.com/911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dutherenverseauborddelatable.wordpress.com/911/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=911&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dutherenverseauborddelatable.wordpress.com/2011/08/28/opa-on-lambda-the-ultimate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/26385ab59b5a13c50262c302a3bcd17c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yoric</media:title>
		</media:content>
	</item>
		<item>
		<title>Listing Opa applications</title>
		<link>http://dutherenverseauborddelatable.wordpress.com/2011/06/07/centralizing-opa-applications/</link>
		<comments>http://dutherenverseauborddelatable.wordpress.com/2011/06/07/centralizing-opa-applications/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 15:27:50 +0000</pubDate>
		<dc:creator>yoric</dc:creator>
				<category><![CDATA[Informatique / Computer science]]></category>
		<category><![CDATA[OCaml]]></category>
		<category><![CDATA[OPA]]></category>

		<guid isPermaLink="false">http://dutherenverseauborddelatable.wordpress.com/?p=898</guid>
		<description><![CDATA[Short update The opalang website now lists applications developed in Opa (registration required &#8211; part of the closed preview). If you are developing an application in Opa, please consider submitting this to the list.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=898&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;"><strong>Short update</strong> The <a href="http://opalang.org">opalang</a> website now lists <a href="http://opalang.org/protected/see.html">applications developed in Opa</a> (registration required &#8211; part of the closed preview). If you are developing an application in Opa, please consider submitting this to the list.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dutherenverseauborddelatable.wordpress.com/898/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dutherenverseauborddelatable.wordpress.com/898/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=898&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dutherenverseauborddelatable.wordpress.com/2011/06/07/centralizing-opa-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/26385ab59b5a13c50262c302a3bcd17c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yoric</media:title>
		</media:content>
	</item>
		<item>
		<title>Crowdsourcing the syntax</title>
		<link>http://dutherenverseauborddelatable.wordpress.com/2011/05/30/crowdsourcing-the-syntax/</link>
		<comments>http://dutherenverseauborddelatable.wordpress.com/2011/05/30/crowdsourcing-the-syntax/#comments</comments>
		<pubDate>Mon, 30 May 2011 10:22:24 +0000</pubDate>
		<dc:creator>yoric</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[In English / En anglais]]></category>
		<category><![CDATA[Informatique / Computer science]]></category>
		<category><![CDATA[OCaml]]></category>
		<category><![CDATA[OPA]]></category>
		<category><![CDATA[Recherche / Research]]></category>
		<category><![CDATA[Sûreté / Security]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[crowd]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wisdom]]></category>

		<guid isPermaLink="false">http://dutherenverseauborddelatable.wordpress.com/?p=841</guid>
		<description><![CDATA[Feedback from Opa testers suggests that we can improve the syntax and make it easier for developers new to Opa to read and write code. We have spent some time both inside the Opa team and with the testers designing two possible revisions to the syntax. Feedback on both possible revisions, as well as alternative [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=841&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;"><em>Feedback from Opa testers suggests that we can improve the syntax and make it easier for developers new to Opa to read and write code. We have spent some time both inside the Opa team and with the testers designing two possible revisions to the syntax. Feedback on both possible revisions, as well as alternative ideas, are welcome.</em></p>
<p style="text-align:justify;">A few days ago, we announced the <a href="http://www.opalang.org">Opa platform</a>, and I&#8217;m happy to announce that things are going very well. We have received numerous applications for the closed preview – we now have onboard people from Mozilla, Google and Twitter, to quote but a few, from many startups, and even from famous defense contractors – and I&#8217;d like to start this post by thanking all the applicants. It&#8217;s really great to have you guys &amp; gals and your feedback. We are still accepting applications, by the way.</p>
<p style="text-align:justify;">Speaking of feedback, we got plenty of it, too, on just about everything Opa, much of it on the syntax. This focus on syntax is only fair, as syntax is both the first thing a new developer sees of a language and something that they have to live with daily. And feedback on the syntax indicates rather clearly that our syntax, while being extremely concise, was perceived as too exotic by many developers.</p>
<p style="text-align:justify;">Well, we aim to please, so we have spent some time with our testers working on possible syntax revisions, and we have converged on two possible syntaxes. In this post, I will walk you through syntax changes. Please keep in mind that we are very much interested in feedback, so do not hesitate to contact us, either by leaving comments on this blog, by <a href="irc://irc.freenode.net/#opalang">IRC</a>, or at <a href="mailto:feedback@opalang.org">feedback@opalang.org</a> .</p>
<p style="text-align:justify;padding-left:30px;"><strong>Important note</strong>: that we will continue supporting the previous syntax for some time and we will provide tools to automatically convert from the previous syntax to the revised syntax.</p>
<p>Let me walk you through syntax changes.</p>
<p><span id="more-841"></span></p>
<h2>Edit</h2>
<ul>
<li>Fixed typoes.</li>
<li>Removed most comments from revised versions, they were redundant.</li>
</ul>
<h2>Hello, web</h2>
<h3>Original syntax</h3>
<pre class="brush: fsharp; title: ; notranslate">
start() = &lt;&gt;Hello, web!&lt;/&gt;
server = one_page_server(&quot;Hello&quot;, start)
</pre>
<p>or, equivalently,</p>
<pre class="brush: fsharp; title: ; notranslate">
server = one_page_server(&quot;Hello&quot;, -&gt; &lt;&gt;Hello, web!&lt;/&gt;)
</pre>
<p>This application involves the following operations:</p>
<ul>
<li>define some HTML content – note that this is actually a data structure, <em>not</em> inline HTML;</li>
<li>put this content in a either a function called start (first version) or an anonymous function (second version);</li>
<li>call function one_page_server to build a server;</li>
<li>use this server as our main server.</li>
</ul>
<h3>Revised syntax, candidate 1</h3>
<pre class="brush: jscript; title: ; notranslate">
/**
 * The function defining our user interface.
 */
start() {
  &lt;&gt;Hello, web!&lt;/&gt; //HTML-like content.
  //As the last value of the function, this is the result.
}

/**
 * Create and start a server delivering user interface [start]
 */
start_server(one_page_server(&quot;Hello&quot;, start))
</pre>
<p style="text-align:right;"><a href="https://gist.github.com/995020">Fork me on github</a></p>
<p>or, equivalently</p>
<pre class="brush: jscript; title: ; notranslate">
/**
 * The function defining our user interface.
 */
start = -&gt; &lt;&gt;Hello, web!&lt;/&gt; //HTML-like content.
  //Using the syntax for anonymous functions

/**
 * Create and start a server delivering user interface [start]
 */
start_server(one_page_server(&quot;Hello&quot;, start))
</pre>
<p style="text-align:right;"><a href="https://gist.github.com/998663">Fork me on github</a></p>
<p>or, equivalently</p>
<pre class="brush: jscript; title: ; notranslate">
start_server(one_page_server(&quot;Hello&quot;, -&gt; &lt;&gt;Hello, web!&lt;/&gt; ));
</pre>
<p style="text-align:right;"><a href="https://gist.github.com/995032">Fork me on github</a></p>
<h4>Rationale of the redesign</h4>
<ul>
<li>JS-style <strong>{}</strong> around function bodies indicate clearly where a function starts and where a function ends, which makes it easier for people who do not know the language to make sense of source code;</li>
<li>an explicit call to function start_server makes it more discoverable and intelligible that you can define several servers in one application.</li>
</ul>
<h4>Not redesigned</h4>
<ul>
<li>the HTML-like for user interface – feedback indicates that developers understand it immediately;</li>
<li>anonymous functions can still be written with <strong>-&gt;</strong> – this syntax is both lightweight and readable;</li>
<li>the fact that the last value of a function is its result – now that we have the curly braces, it&#8217;s clear, and it fits much better with our programming paradigm than a <strong>return</strong> that would immediately stop the flow of the function and would not interact too nicely with our concurrency model;</li>
<li>the syntax of comments – it works as it is.</li>
</ul>
<h3>Revised syntax, candidate 2</h3>
<pre class="brush: jscript; title: ; notranslate">
/**
 * The function defining our user interface.
 */
def start():
  &lt;&gt;Hello, web!&lt;/&gt; //HTML-like content.
  //As the last value of the function, this is the result.

/**
 * Create and start a server delivering user interface [start]
 */
server:
   one_page_server(&quot;Hello&quot;, start)
</pre>
<p style="text-align:right;"><a href="https://gist.github.com/998667">Fork me on github</a></p>
<p>or, equivalently</p>
<pre class="brush: jscript; title: ; notranslate">
server:
   one_page_server(&quot;Hello&quot;, def(): &lt;&gt;Hello, web!&lt;/&gt;)
</pre>
<p style="text-align:right;"><a href="https://gist.github.com/998669">Fork me on github</a></p>
<h4>Redesign and rationale</h4>
<ul>
<li>Python-style meaningful indents force readable pagination;</li>
<li>in the second version, Python-inspired anonymous &#8220;<strong>def</strong>&#8221; makes it easier to spot anonymous functions and their arguments – note that this is not quite Python &#8220;<strong>lambda</strong>&#8220;, as there is no semantic difference between what an anonymous function can do and what a named function can do ;</li>
<li>Keyword <strong>server:</strong> is clearer than declaration <strong>server =</strong> .</li>
</ul>
<h4>Not redesigned</h4>
<p>as above</p>
<h2>Distributed key-value store</h2>
<h3>Original syntax</h3>
<pre class="brush: fsharp; title: ; notranslate">
/**
 * Add a path called [/storage] to the schema of our
 * graph database.
 *
 * This path is used to store one value with type
 * [stringmap(option(string))]. A [stringmap] is a dictionary.
 * An [option(string)] is an optional [string],
 * i.e. a value that may either be a string or omitted.
 *
 * This path therefore stores an association from [string]
 * (the key) to either a [string] (the value) or nothing
 * (no value).
 */
db /storage: stringmap(option(string))
</pre>
<p style="text-align:justify;">This extract adds a path to the database schema and provides the type of the value stored at this path. Note that Opa offers a graph database. Each path contains exactly <em>one</em> value. To store several values at one path, we actually store a container, which integrates nicely into the graph. Here, Opa will detect that what we are storing is essentially a table, and will automatically optimize storage to take advantage of this information.</p>
<pre class="brush: fsharp; title: ; notranslate">
/**
 * Handle requests.
 *
 * @param request The uri of the request. The URI is converted
 * to a key in [/storage], the method determines what should be
 * done, and in the case of [{post}] requests, the body is used
 * to set the value in the db
 *
 * @return If the request is rejected, [{method_not_allowed}].
 * If the request is a successful [{get}], a &quot;text/plain&quot;
 * resource with the value previously stored. If the request
 * is a [{get}] to an unknown key, a [{wrong_address}].
 * Otherwise, a [{success}].
 */
dispatch(request) =
(
  key = List.to_string(request.uri.path)
  match request.method with
   | {some = {get}}    -&gt;
     match /storage[key] with
       | {none}        -&gt; Resource.raw_status({wrong_address})
       | {some = value}-&gt; Resource.raw_response(value,
               &quot;text/plain&quot;, {success})
     end
   | {some = {post}}   -&gt;
         do /storage[key] &lt;- request.body
         Resource.raw_status({success})
   | {some = {delete}} -&gt;
         do Db.remove(@/storage[key])
         Resource.raw_status({success})
   | _ -&gt; Resource.raw_status({method_not_allowed})
  end
)
</pre>
<p>This extract  inspects the HTTP method of the request to decide what to do with the request – this is called &#8220;pattern-matching&#8221;. First case handles GET and performs further matching on the database to determine whether the key is already associated to a value.</p>
<pre class="brush: fsharp; title: ; notranslate">
/**
 * Main entry point: launching the server.
 */
server = Server.simple_request_dispatch(dispatch)
</pre>
<p>Finally, this extract launches the server.</p>
<h3>Revised syntax, candidate 1</h3>
<p style="text-align:right;"><a href="https://gist.github.com/993180">Fork me on github</a></p>
<pre class="brush: jscript; title: ; notranslate">
db {
  option&lt;string&gt; /storage[string];
}
</pre>
<p>or, equivalently,</p>
<pre class="brush: jscript; title: ; notranslate">
db option&lt;string&gt; /storage[string];
</pre>
<h4>Redesigns and rationale</h4>
<ul>
<li>The type of the value appears before the value – this is more understandable by developers used to C-style syntax.</li>
<li>Syntactic sugar makes it clear that the path is indexed by strings – this syntax matches the syntax used to place requests or to update the value.</li>
<li>Allowing braces around schema declaration is a good visual clue.</li>
<li>We now use &lt;&gt; for generics syntax – again, this matches the syntax of C++, Java, C# and statically typed JS extensions.</li>
</ul>
<h4>Not redesigned</h4>
<ul>
<li>Keyword <strong>db</strong> – we need a keyword to make it clear that we are talking about the database.</li>
</ul>
<pre class="brush: jscript; title: ; notranslate">
dispatch(request) {
  key = List.to_string(request.uri.path);
  match(request.method) {
    case {some: {get}}:
        match(/storage[key]) {
           case {none}:  Resource.raw_status({wrong_address});
           case {some: value}: Resource.raw_response(value,
              &quot;text/plain&quot;, {success});
        }
    case {some: {post}}: {
         /storage[key] &lt;- request.body;
         Resource.raw_status({success})
    }
    case {some: {delete}}: {
         Db.remove(@/storage[key]);
         Resource.raw_status({success});
    }
    case *: Resource.raw_status({method_not_allowed});
  }
}
</pre>
<h4>Redesigns and rationale</h4>
<ul>
<li>Pattern-matching syntax  becomes  <strong>match</strong>(&#8230;) { <strong>case</strong> case_1: &#8230;; <strong>case</strong> case_2: &#8230;; &#8230; } – this syntax resembles that of <strong>switch</strong>(), and is therefore more understandable by developers who are not accustomed to pattern-matching. Note that pattern-matching is both more powerful than switch and has a different branching mechanism, so reusing keywords switch and default would have mislead developers.</li>
<li>Records now use <strong>:</strong> instead of <strong>=</strong>, as in JavaScript – now that we use curly braces, this is necessary to ensure that there is a visual difference between blocks and structures.</li>
</ul>
<h4>Not redesigned</h4>
<ul>
<li>Operator <strong>&lt;-</strong> for updating a database path – we want developers to be aware that this operation is very different from =, which serves to define new values.</li>
<li>The syntax for paths – it&#8217;s simple, concise and it&#8217;s an immediate cue that we are dealing with a persistent value.</li>
</ul>
<pre class="brush: jscript; title: ; notranslate">
start_server(Server.simple_request_dispatch(dispatch))
</pre>
<p>No additional redesigns or rationales.</p>
<h3>Revised syntax, candidate 2</h3>
<p style="text-align:right;"><a href="https://gist.github.com/993279">Fork me on github</a></p>
<pre class="brush: jscript; title: ; notranslate">
db:
  /storage[string] as option(string)
</pre>
<h4>Redesigns and rationale</h4>
<ul>
<li>Again, Python-style meaningful indents force readable pagination;</li>
<li>syntactic sugar makes it clear that the path is indexed by strings – this syntax matches the syntax used to place requests or to update the value;</li>
<li>keyword <strong>as</strong> (inspired by Boo) replaces <strong>:</strong> (which is used pervasively in Python syntax);</li>
<li>python-style keyword <strong>db:</strong> is more visible than <strong>db</strong>.</li>
</ul>
<h4>Not redesigned</h4>
<ul>
<li>We still use parentheses for generic types – no need to clutter the syntax with Java-like Foo&lt;Bar&gt;</li>
</ul>
<pre class="brush: jscript; title: ; notranslate">
def dispatch(request):
  key = List.to_string(request.uri.path)
  match request.method:
    case {some = {get}}:
       match /storage[key]:
          case {none}:        Resource.raw_status({wrong_address})
          case {some: value}: Resource.raw_response(value,
                &quot;text/plain&quot;, {success});
    case {some = {post}}:
         /storage[key] &lt;- request.body
         Resource.raw_status({success})
    case {some = {delete}}:
         Db.remove(@/storage[key])
         Resource.raw_status({success})
    case *:
         Resource.raw_status({method_not_allowed})
</pre>
<h4>Redesigns and rationale</h4>
<ul>
<li>Pattern-matching syntax  becomes  <strong>match</strong>: and <strong>case</strong> &#8230;: &#8230; .</li>
</ul>
<h4>Not redesigned</h4>
<p>As above</p>
<pre class="brush: jscript; title: ; notranslate">
server:
   Server.simple_request_dispatch(dispatch)
</pre>
<p>No further redesign.</p>
<h2>Web chat</h2>
<h3>Original syntax</h3>
<pre class="brush: csharp; title: ; notranslate">
/**
 * {1 Network infrastructure}
 */

/**
 * The type of messages sent by a client to the chatroom
 */
type message = {author: string /**Arbitrary, untrusted, name*/
              ; text: string  /**Content entered by the user*/}

/**
 * A structure for routing and broadcasting values of type
 * [message].
 *
 * Clients can send values to be broadcasted or register
 * callbacks to be informed of the broadcast. Note that
 * this routing can work cross-client and cross-server.
 *
 * For distribution purposes, this network will be
 * registered to the network as &quot;mushroom&quot;.
 */
room = Network.cloud(&quot;mushroom&quot;): Network.network(message)
</pre>
<p>In this extract, we define a type and the distribution infrastructure to broadcast value changes between servers or between clients and servers. Needless to say, these two lines hide some very powerful core concepts of Opa.</p>
<pre class="brush: csharp; title: ; notranslate">
/**
 * Update the user interface in reaction to reception
 * of a message.
 *
 * This function is meant to be registered with [room]
 * as a callback. Its sole role is to display the new message
 * in [#conversation].
 *
 * @param x The message received from the chatroom
 */
user_update(x) =
(
  line = &lt;div&gt;
     &lt;div&gt;{x.author}:&lt;/div&gt;
     &lt;div&gt;{x.text}&lt;/div&gt;
  &lt;/div&gt;
  do Dom.transform([#conversation +&lt;- line ])
  Dom.scroll_to_bottom(#conversation)
)

/**
 * Broadcast text to the [room].
 *
 * Read the contents of [#entry], clear these contents and send
 * the message to [room].
 *
 * @param author The name of the author. Will be included in the
 * message broadcasted.
 */
broadcast(author) =
  do Network.broadcast({author=author
     text=Dom.get_value(#entry)}, room)
  Dom.clear_value(#entry)

/**
 * Build the user interface for a client.
 *
 * Pick a random author name which will be used throughout
 * the chat.
 *
 * @return The user interface, ready to be sent by the server to
 * the client on connection.
 */
start() =
(
    author = Random.string(8)
    &lt;div id=#conversation
     onready={_ -&gt; Network.add_callback(user_update, room)}&gt;&lt;/div&gt;
    &lt;input id=#entry  onnewline={_ -&gt; broadcast(author)}/&gt;
    &lt;div onclick={_ -&gt; broadcast(author)}&gt;Send!&lt;/div&gt;
)
</pre>
<p>In this extract, we define the user interface and connect it to the aforementioned distribution mechanism. Again, we describe the user interface as a datastructure in a HTML-like syntax.</p>
<pre class="brush: csharp; title: ; notranslate">
/**
 * Main entry point.
 *
 * Construct an application called &quot;Chat&quot; (users
 * will see the name in the title bar), embedding
 * statically the contents of directory &quot;resources&quot;,
 * using the global stylesheet &quot;resources/css.css&quot;
 * and the user interface defined in [start].
 */
server = Server.one_page_bundle(&quot;Chat&quot;,
    [@static_resource_directory(&quot;resources&quot;)],
    [&quot;resources/css.css&quot;], start)
</pre>
<p>Finally, as usual, we define our main entry point, with our user interface and a bundle of resources.</p>
<h3>Revised syntax, candidate 1</h3>
<p style="text-align:right;"><a href="https://gist.github.com/993179">Fork me on github</a></p>
<pre class="brush: jscript; title: ; notranslate">
type message = {author: string /**Arbitrary, untrusted, name*/
               ,text:   string} /**Content entered by the user*/

Network.network&lt;message&gt; room = Network.cloud(&quot;mushroom&quot;)

user_update(x) {
  line = &lt;div&gt;
     &lt;div&gt;{x.author}:&lt;/div&gt;
     &lt;div&gt;{x.text}&lt;/div&gt;
  &lt;/div&gt;;
  Dom.transform([#conversation +&lt;- line ]);//Note: If we want to change the syntax of actions, now is the right time
  Dom.scroll_to_bottom(#conversation)
}

broadcast(author){
  Network.broadcast({author=author,
    text:Dom.get_value(#entry)}, room);
  Dom.clear_value(#entry)
}

start() {
  author = Random.string(8);
  &lt;div id=#conversation
    onready={ * -&gt; Network.add_callback(user_update, room) }&gt;&lt;/div&gt;
  &lt;input id=#entry  onnewline={ * -&gt; broadcast(author) }/&gt;
  &lt;div onclick={ * -&gt; broadcast(author) }&gt;Send!&lt;/div&gt;
}

start_server(Server.one_page_bundle(&quot;Chat&quot;,
   [@static_resource_directory(&quot;resources&quot;)],
   [&quot;resources/css.css&quot;], start))

</pre>
<h3>Revised syntax, candidate 2</h3>
<p style="text-align:right;"><a href="https://gist.github.com/993277">Fork me on github</a></p>
<pre class="brush: jscript; title: ; notranslate">
type message:
   author as string //Arbitrary, untrusted, name
   text   as string   //Content entered by the user

room = Network.cloud(&quot;mushroom&quot;) as Network.network(message)
</pre>
<h4>Redesign and rationale</h4>
<ul>
<li>We introduce a Python-ish/Boo-ish syntax for defining types.</li>
<li>Again, we use <strong>as</strong> instead of <strong>:</strong> for type annotations.</li>
</ul>
<pre class="brush: jscript; title: ; notranslate">
def user_update(x):
  line = &lt;div&gt;
    &lt;div&gt;{x.author}:&lt;/div&gt;
    &lt;div&gt;{x.text}&lt;/div&gt;
  &lt;/div&gt;
  Dom.transform([#conversation +&lt;- line ])//Note: If we want to change the syntax of actions, now is the right time
  Dom.scroll_to_bottom(#conversation)

def broadcast(author):
   message = new:
      author: author
      text:   Dom.get_value(#entry)
   Network.broadcast(message, room)
   Dom.clear_value(#entry)
</pre>
<h4>Redesign and rationale</h4>
<ul>
<li>We introduce a new keyword <strong>new:</strong> to define immediate records – we find this both clearer than the Python syntax for defining objects as dictionaries, and more suited to both our paradigm and our automated analysis.</li>
</ul>
<pre class="brush: jscript; title: ; notranslate">
def start():
   author = Random.string(8)
   html:
    &lt;div id=#conversation onready={def *: Network.add_callback(user_update, room)}&gt;&lt;/div&gt;
    &lt;input id=$entry onnewline={def *: broadcast(author)}/&gt;
    &lt;div onclick={def *: broadcast(author)}&gt;Send!&lt;/div&gt;
</pre>
<h4>Redesign and rationale</h4>
<ul>
<li>We introduce keyword <strong>html:</strong> to introduce a block of HTML-like notations. A similar keyword <strong>xml:</strong> will be used when producing XML documents with a XML-like notation.</li>
</ul>
<pre class="brush: jscript; title: ; notranslate">
server:
  Server.one_page_bundle(&quot;Chat&quot;,
    [@static_resource_directory(&quot;resources&quot;)],
    [&quot;resources/css.css&quot;], start)
</pre>
<p>No additional change here.</p>
<h2>What now?</h2>
<p style="text-align:justify;">At this stage, we have not switched syntax yet and we have the following options:</p>
<ul>
<li>keep our current syntax;</li>
<li>adopt revised syntax 1, <em>or a variant thereof</em> – so, start coding a conversion tool, the new syntax itself, and start updating the documentation;</li>
<li>adopt revised syntax 2, <em>or a variant thereof</em> – so, start coding a conversion tool, the new syntax itself, and start updating the documentation;</li>
</ul>
<p style="text-align:justify;">Yes, I mention variants, because I am certain that many among you will have interesting ideas. So please feel free to express yourselves.</p>
<p>You can provide feedback:</p>
<ul>
<li>on this blog;</li>
<li>by e-mail, at feedback@opalang.org;</li>
<li>on <a href="irc://irc.freenode.net/#opalang">IRC</a>.</li>
</ul>
<p>Remember, we are still <a href="http://opalang.org">accepting applications for the preview</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dutherenverseauborddelatable.wordpress.com/841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dutherenverseauborddelatable.wordpress.com/841/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=841&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dutherenverseauborddelatable.wordpress.com/2011/05/30/crowdsourcing-the-syntax/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/26385ab59b5a13c50262c302a3bcd17c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yoric</media:title>
		</media:content>
	</item>
		<item>
		<title>A few Opa applications</title>
		<link>http://dutherenverseauborddelatable.wordpress.com/2011/05/24/a-few-opa-applications/</link>
		<comments>http://dutherenverseauborddelatable.wordpress.com/2011/05/24/a-few-opa-applications/#comments</comments>
		<pubDate>Tue, 24 May 2011 17:50:41 +0000</pubDate>
		<dc:creator>yoric</dc:creator>
				<category><![CDATA[Informatique / Computer science]]></category>
		<category><![CDATA[Recherche / Research]]></category>
		<category><![CDATA[OCaml]]></category>
		<category><![CDATA[OPA]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[announce]]></category>

		<guid isPermaLink="false">http://dutherenverseauborddelatable.wordpress.com/?p=831</guid>
		<description><![CDATA[A few open-source Opa applications, written by beta testers or Opa team members, have been open-sourced in the past few days. Expect a few other releases in the upcoming days/weeks: OpaChat &#8211; simple real-time web chat (works) OpaStorage &#8211; simple distributed key/value store (works) opaCAS &#8211; single sign-on (in progress) Contre-Jour &#8211; thumbnail viewer (works) [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=831&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;">A few open-source Opa applications, written by beta testers or Opa team members, have been open-sourced in the past few days. Expect a few other releases in the upcoming days/weeks:</p>
<ul>
<li><a href="https://github.com/Yoric/OpaChat">OpaChat</a> &#8211; simple real-time web chat (works)</li>
<li><a href="https://github.com/Yoric/OpaStorage">OpaStorage</a> &#8211; simple distributed key/value store (works)</li>
<li><a href="https://github.com/mattgu74/opaCas">opaCAS</a> &#8211; single sign-on (in progress)</li>
<li><a href="https://github.com/AltGr/Contre-jour">Contre-Jour</a> &#8211; thumbnail viewer (works)</li>
<li><a href="https://github.com/mattgu74/OpaTetris">OpaTetris</a> &#8211; I&#8217;m sure you can guess what it&#8217;s about &#8211; based on HTML5 canvas (works) <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>Know of any other open-source Opa app? Then let me know!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dutherenverseauborddelatable.wordpress.com/831/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dutherenverseauborddelatable.wordpress.com/831/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=831&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dutherenverseauborddelatable.wordpress.com/2011/05/24/a-few-opa-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/26385ab59b5a13c50262c302a3bcd17c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yoric</media:title>
		</media:content>
	</item>
		<item>
		<title>Unbreaking Scalable Web Development, One Loc at a Time</title>
		<link>http://dutherenverseauborddelatable.wordpress.com/2011/05/23/unbreaking-scalable-web-development-one-loc-at-a-time/</link>
		<comments>http://dutherenverseauborddelatable.wordpress.com/2011/05/23/unbreaking-scalable-web-development-one-loc-at-a-time/#comments</comments>
		<pubDate>Mon, 23 May 2011 12:59:29 +0000</pubDate>
		<dc:creator>yoric</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Informatique / Computer science]]></category>
		<category><![CDATA[Sûreté / Security]]></category>
		<category><![CDATA[Recherche / Research]]></category>
		<category><![CDATA[In English / En anglais]]></category>
		<category><![CDATA[OCaml]]></category>
		<category><![CDATA[OPA]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[parallelism]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[distribution]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[xss]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[programming language]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[paradigm]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[prototypes]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[agpl]]></category>
		<category><![CDATA[announce]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[mapreduce]]></category>
		<category><![CDATA[bigtable]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[distributed]]></category>
		<category><![CDATA[concurrent]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[key/value]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[opalang]]></category>

		<guid isPermaLink="false">http://dutherenverseauborddelatable.wordpress.com/?p=753</guid>
		<description><![CDATA[The Opa platform was created to address the problem of developing secure, scalable web applications. Opa is a commercially supported open-source programming language designed for web, concurrency, distribution, scalability and security. We have entered closed beta and the code will be released soon on http://opalang.org , as an Owasp project . Edit The video spawned [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=753&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;"><em>The Opa platform was created to address the problem of developing secure, scalable web applications. Opa is a commercially supported open-source programming language designed for web, concurrency, distribution, scalability and security. We have entered closed beta and the code will be released soon on <a href="http://opalang.org" target="_blank"><br />
http://opalang.org<br />
</a>, as an <a href="http://owasp.org">Owasp project</a> .<br />
</em></p>
<ul>
<li><strong>Edit</strong> The video spawned a conversation on <a href="http://www.reddit.com/r/programming/comments/hidsa/opa_one_language_for_all_the_stack_forget/">Reddit</a>.</li>
<li><strong>Edit</strong> Interesting followup on <a href="http://news.ycombinator.com/item?id=2575939">Hacker News</a>.</li>
<li><strong>Edit</strong> Reworked source code &amp; comments for clarity. Thanks for the feedback.</li>
<li><strong>Edit</strong>Come and chat with us <a href="irc://irc.freenode.net/#opalang">on Freenode, channel #opalang </a>.</li>
</ul>
<p style="text-align:justify;">If you are a true coder, sometimes, you meet a problem so irritating, or a solution so clumsy, that challenging it is a matter of engineering pride. I assume that many of the greatest technologies we have today were born from such challenges, from OpenGL to the web itself. The pain of pure LAMP-based web development begat Ruby on Rails, Django or Node.js, as well as the current NoSQL generation. Similarly, the pains of scalable large system development with raw tools begat Erlang, Map/Reduce or Project Voldemort.</p>
<p style="text-align:justify;">Opa was born from the pains of developing scalable, secure web applications. Because, for all the merits of existing solutions, we just knew that we could do much, much better.</p>
<p style="text-align:justify;">Unsurprisingly, getting there was quite a challenge. Between the initial idea and an actual platform lay blood, sweat and code, many experiments and failed prototypes, but finally, we got there. After years of development and real-scale testing, we are now getting ready to release the result.</p>
<p style="text-align:justify;">The parents are proud to finally introduce <a href="http://opalang.org">Opa</a>.<span id="more-753"></span></p>
<h2 style="text-align:justify;">Different means to different ends</h2>
<p style="text-align:justify;">Opa is a new approach to scalable, secure web development.</p>
<p style="text-align:justify;">The core idea behind Opa is that <strong><em>once you use the right paradigm, scalability, security and the web model just happen naturally</em></strong>.</p>
<p style="text-align:justify;">To implement our idea, we had to provide developers with a programming language that was:</p>
<ol>
<li>powerful enough to describe the complete behavior of the web application, including user interface, interactivity, concurrency, general-purpose computations and database manipulation;</li>
<li>clean enough to support automated security analysis;</li>
<li>high-level enough to support transparent distribution, optimization and injection of security checks;</li>
<li>understandable by any developer.</li>
</ol>
<p style="text-align:justify;">This is not a benign idea. Most approaches to web development, to security or scalability rely either on libraries, external tiers, or reflexivity. For all their merits, and even when applied to the best/most modular/most extensible programming languages available, these techniques are still heavily rooted on whichever paradigm is best handled by that language. Some of the results can be impressive – including your favorite framework, whichever it may be – but in the end, they are necessarily limited by the underlying tools. Unfortunately, we could not find any existing language – whether static, dynamic or hybrid – that could fit all criteria. So, we had to build our own.</p>
<p>This is also not an easy idea for us. We spent years designing, testing, fine-tuning our paradigm, as well as ensuring that the result was indeed usable by any developer.</p>
<h3 style="text-align:justify;"><strong>Opa is a new programming language</strong> and its runtime environment</h3>
<p style="text-align:justify;">With Opa, write your complete application in just one language, and the compiler will transform it into a self-sufficient executable containing:</p>
<ul style="text-align:justify;">
<li>server-side code;</li>
<li>client-side code (cross-browser JavaScript and HTML, generated automatically from your source code);</li>
<li>database code (compiled queries for our own NoSQL, scalable database);</li>
<li>distribution code;</li>
<li>all the glue to connect everything to everything else;</li>
<li>security checks at boundaries;</li>
<li>the HTTP server itself;</li>
<li>the database engine itself;</li>
<li>the distribution layers themselves.</li>
</ul>
<p style="text-align:justify;">Launch this executable locally, or ask it to deploy itself on any number of servers, and your web application is running. <em>Do not</em> deploy or configure a DBMS. <em>Do not</em> deploy or configure a web server. <em>Do not</em> deploy or configure a distributed file system. It just works.</p>
<h2 style="text-align:justify;">Programming with Opa</h2>
<p style="text-align:justify;">Opa may be a new language, but it is quite understandable if you have notions of web development. Let me show you a few simple but complete applications. Should you wish to play with them, I have uploaded the source code of each application on github as AGPL.</p>
<h3>Hello, web</h3>
<p>First variant: 1 eloc</p>
<pre class="brush: fsharp; title: ; notranslate">
 server = one_page_server(&quot;Hello&quot;, -&gt; &lt;&gt;Hello, web!&lt;/&gt;)
</pre>
<div style="text-align:right;"><a href="https://gist.github.com/985817">Fork me on github</a></div>
<p>Second variant: 2 eloc</p>
<pre class="brush: fsharp; title: ; notranslate">
server = Server.simple_dispatch(_ -&gt;
  html(&quot;Hello&quot;, &lt;&gt;Hello, web!&lt;/&gt;)
)
</pre>
<div style="text-align:right;"><a href="https://gist.github.com/985820">Fork me on github</a></div>
<p>Build &amp; launch:</p>
<pre class="brush: bash; title: ; notranslate">
$ opa hello_web.opa
$ ./hello_web.exe
</pre>
<p style="text-align:justify;">That&#8217;s it. Your application is launched, you can connect with any (recent) browser.</p>
<h3>A minimal (distributed, load-balanced) key-value store</h3>
<p>Source code, in 17 eloc:</p>
<pre class="brush: csharp; title: ; notranslate">
/**
 * Add a path called [/storage] to the schema of our graph database.
 *
 * This path is used to store one value with type
 * [stringmap(option(string))]. A [stringmap] is a dictionary.
 * An [option(string)] is an optional [string],
 * i.e. a value that may either be a string or omitted.
 *
 * This path therefore stores an association from [string]
 * (the key) to either a [string] (the value) or nothing
 * (no value).
 */
db /storage: stringmap(option(string))

/**
 * Handle requests.
 *
 * @param request The uri of the request. The URI is converted to
 * a key in [/storage], the method determines what should be done,
 * and in the case of [{post}] requests, the body is used to set
 * the value in the db
 *
 * @return If the request is rejected, [{method_not_allowed}].
 * If the request is a successful [{get}], a &quot;text/plain&quot; resource
 * with the value previously stored. If the request is a [{get}] to
 * an unknown key, a [{wrong_address}].
 * Otherwise, a [{success}].
 */
dispatch(request) =
(
  key = List.to_string(request.uri.path)
  match request.method with
   | {some = {get}}    -&gt;
     match /storage[key] with
       | {none}        -&gt; Resource.raw_status({wrong_address})
       | {some = value}-&gt; Resource.raw_response(value,
               &quot;text/plain&quot;, {success})
     end
   | {some = {post}}   -&gt;
         do /storage[key] &lt;- request.body
         Resource.raw_status({success})
   | {some = {delete}} -&gt;
         do /storage[key]
         do Db.remove(@/storage[key])
         Resource.raw_status({success})
   | _ -&gt; Resource.raw_status({method_not_allowed})
  end
)

/**
 * Main entry point: launching the server.
 */
server = Server.simple_request_dispatch(dispatch)
</pre>
<div style="text-align:right;"><a href="https://github.com/Yoric/OpaStorage#fork_box">Fork me on github</a></div>
<p>Build:</p>
<pre class="brush: bash; title: ; notranslate">
$ opa opa_storage.opa
</pre>
<p>Launch on one server</p>
<pre class="brush: bash; title: ; notranslate">
$ ./opa_storage.exe
</pre>
<p>Or auto-deploy and launch on several servers:</p>
<pre class="brush: bash; title: ; notranslate">
$ opa-cloud opa_storage.exe --host localhost --host me@host1 --host me@host2
</pre>
<p style="text-align:justify;">Again, that&#8217;s it. Key/value pairs are replicated/distributed on the various nodes (default settings are generally ok, but replication factor can be configured if necessary), requests are load-balanced and it just works.</p>
<p style="text-align:justify;">Just as importantly, note that we have not written any single line of code for ensuring security with respect to database injection. By construction, Opa ensures automatically that such injections cannot happen.</p>
<h3>Real-time web chat</h3>
<p>Source code, in 20 eloc:</p>
<pre class="brush: csharp; title: ; notranslate">
/**
 * {1 Network infrastructure}
 */

/**
 * The type of messages sent by a client to the chatroom
 */
type message = {author: string /**Arbitrary, untrusted, name*/
              ; text: string  /**Content entered by the user*/}

/**
 * A structure for routing and broadcasting values of type
 * [message].
 *
 * Clients can send values to be broadcasted or register
 * callbacks to be informed of the broadcast. Note that
 * this routing can work cross-client and cross-server.
 *
 * For distribution purposes, this network will be
 * registered to the network as &quot;mushroom&quot;.
 */
room = Network.cloud(&quot;mushroom&quot;): Network.network(message)

/**
 * {1 User interface}
 */

/**
 * Update the user interface in reaction to reception of a message.
 *
 * This function is meant to be registered with [room] as a callback.
 * Its sole role is to display the new message in [#conversation].
 *
 * @param x The message received from the chatroom
 */
user_update(x) =
(
  line = &lt;div&gt;
     &lt;div&gt;{x.author}:&lt;/div&gt;
     &lt;div&gt;{x.text}&lt;/div&gt;
  &lt;/div&gt;
  do Dom.transform([#conversation +&lt;- line ])
  Dom.scroll_to_bottom(#conversation)
)

/**
 * Broadcast text to the [room].
 *
 * Read the contents of [#entry], clear these contents and send
 * the message to [room].
 *
 * @param author The name of the author. Will be included in the
 * message broadcasted.
 */
broadcast(author) =
  do Network.broadcast({author=author text=Dom.get_value(#entry)}, room)
  Dom.clear_value(#entry)

/**
 * Build the user interface for a client.
 *
 * Pick a random author name which will be used throughout the chat.
 *
 * @return The user interface, ready to be sent by the server to the client
 * on connection.
 */
start() =
(
    author = Random.string(8)
    &lt;div id=#conversation
     onready={_ -&gt; Network.add_callback(user_update, room)}&gt;&lt;/div&gt;
   &lt;input id=#entry  onnewline={_ -&gt; broadcast(author)}/&gt;
   &lt;div class=&quot;button&quot; onclick={_ -&gt; broadcast(author)}&gt;Send!&lt;/div&gt;
)

/**
 * {1 Application}
 */

/**
 * Main entry point.
 *
 * Construct an application called &quot;Chat&quot; (users will see the name in the title bar),
 * embedding statically the contents of directory &quot;resources&quot;, using the global
 * stylesheet &quot;resources/css.css&quot; and the user interface defined in [start].
 */
server = Server.one_page_bundle(&quot;Chat&quot;,
    [@static_resource_directory(&quot;resources&quot;)],
    [&quot;resources/css.css&quot;], start)
</pre>
<p style="text-align:right;"><a href="https://github.com/Yoric/OpaChat#fork_box">Fork me on github</a></p>
<p style="text-align:justify;">Build and launch as above:</p>
<pre class="brush: bash; title: ; notranslate">
$ opa opa_chat.opa

$ opa-cloud opa_chat.exe --host localhost --host me@host1 --host me@host2
</pre>
<p style="text-align:justify;">Users connecting to the launch server are load-balanced among servers. Users connecting to one server can chat transparently with users connected to other servers.</p>
<p style="text-align:justify;">Just as importantly, note that we have not written any single line of code for ensuring security with respect to Cross-Site Scripting. Still, you can try and inject code in this application – and you will fail. Opa has transparently ensured that this cannot happen.</p>
<h2>Our experience with Opa</h2>
<p style="text-align:justify;">We have used Opa to develop a number of web applications, including CMSes, online games, high-security communication tools or e-Commerce apps.</p>
<p style="text-align:justify;">What can I tell you? In our experience, Opa is awesome <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It saves us considerable amounts of time and pain and it vastly extended the size of projects that we could undertake with small agile teams.</p>
<p style="text-align:justify;">Firstly, Opa handles transparently all communications between the client and the server, and can generate JavaScript or server binary code from the same source, depending on what is required. This considerably simplifies prototyping and agile development, by letting us concentrate on getting things to work first, experimenting and showing to clients second, and freezing the design only much later. Countless times, this also made us very much more flexible with respect to design changes, by letting us instantaneously move (or reuse) server code on the client, or in the database, or vice-versa, without having to port from one language to another, or to reimplement communication protocols, or validation, or to redesign for asynchronicity. The added benefit of automated XSS protection also considerably improved our confidence in such agile code.</p>
<p style="text-align:justify;">Secondly, Opa&#8217;s paradigm is a natural match for scalability concerns. It favors stateless services, makes sure that state can be easily marked as local (e.g. caches) or shared (e.g. accounts), and it also makes it quite easy to place local caches in front of anything shared. Most of our applications written on one server worked even better on several servers, out-of-the-box. To push scalability even further, marking data as local/shared/cached is extremely simple, which has always helped us experiment quickly, before deciding whether to push such optimizations into production.</p>
<p style="text-align:justify;">On the security side, I&#8217;m not sure exactly how many men·months Opa saved us by guaranteeing that we were automatically safe against injections (including XSS and SQL/SQL-like), and I&#8217;m not quite sure how to measure it, but this definitely relieved us of plenty of work, stress and emergency calls.</p>
<h2>How does this work?</h2>
<p>We make it work <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align:justify;">More seriously, last time we counted, including testing, around 100 man·years of R&amp;D had been spent on Opa. We took advantage of that time to make Opa the best solution we could imagine. I&#8217;ll try and explain some of the key techniques progressively, in a series of blog entries.</p>
<h2>Limitations</h2>
<p style="text-align:justify;">We are extremely proud of everything that is possible with Opa, but, as any product, Opa has limitations.</p>
<p style="text-align:justify;">Firstly, while the Opa compiler and runtime can perform very aggressive optimizations on distribution and database requests for instance, for the moment, some of these optimizations cannot be performed automatically. In such cases, a developer needs to annotate the code here and there, to mark code chunks as safe for such optimizations. We have a number of plans to push forward the automation of these optimizations, but we haven&#8217;t had a chance to implement them yet.</p>
<p style="text-align:justify;">Other limitations are related to our objectives. Opa is designed for security on the web. Consequently, a number of primitives that are just too dangerous are not accessible for Opa developers, so don&#8217;t expect to encounter <code>innerHTML</code>, <code>eval()</code>, <code>document.print()</code> or <code>execvp()</code>, for instance. These primitives are available as part of the platform, should you wish to work on extending the runtime, but not as part of the language/library.</p>
<p style="text-align:justify;">Also, as we dedicated Opa to the web, do not look too hard for Gtk or DirectX bindings – nothing prevent such system bindings, but we have no plans on introducing these ones. Similarly, Opa is designed for scalability, so the language favors stateless programming, or when state is required, as in our web chat, states that can be shared between several instances of a server. So, while Opa will let you write an application with messy state, the design of the language will try and guide you on another way.</p>
<p style="text-align:justify;">We also have a few other limitations, that may be considered anecdotical in this day and age. For instance, the client side of Opa applications that have a client (i.e. non-pure web services) requires JavaScript and will not work with IE6 or Lynx.</p>
<h2>Show me the code!</h2>
<p style="text-align:justify;">Soon, but not quite yet.</p>
<p style="text-align:justify;">We&#8217;re working full-time on the open-source release. If you are interested, I suggest you visit <a href="http://opalang.org">opalang.org</a> to find some information and documentation or to request invitations to the closed beta. You can also follow our updates <a href="http://twitter.com/#%21/opalang">on Twitter</a> or come and chat with us <a href="irc://irc.freenode.net/#opalang">on IRC</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dutherenverseauborddelatable.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dutherenverseauborddelatable.wordpress.com/753/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=753&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dutherenverseauborddelatable.wordpress.com/2011/05/23/unbreaking-scalable-web-development-one-loc-at-a-time/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/26385ab59b5a13c50262c302a3bcd17c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yoric</media:title>
		</media:content>
	</item>
		<item>
		<title>Post-OWASP AppSec Research</title>
		<link>http://dutherenverseauborddelatable.wordpress.com/2010/06/28/post-owasp-appsec-research/</link>
		<comments>http://dutherenverseauborddelatable.wordpress.com/2010/06/28/post-owasp-appsec-research/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 09:28:53 +0000</pubDate>
		<dc:creator>yoric</dc:creator>
				<category><![CDATA[Informatique / Computer science]]></category>
		<category><![CDATA[OCaml]]></category>
		<category><![CDATA[OPA]]></category>
		<category><![CDATA[Recherche / Research]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[consulting]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[formal methods]]></category>
		<category><![CDATA[it]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[owasp]]></category>
		<category><![CDATA[paradigm]]></category>
		<category><![CDATA[présentation]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[risk]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[slides]]></category>
		<category><![CDATA[threat]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://dutherenverseauborddelatable.wordpress.com/?p=709</guid>
		<description><![CDATA[Well, I&#8217;m just back from the Way to Valhalla and OWASP AppSec Research 2010. The welcome was great, with plenty of people interested in OPA &#8212; some of them actually looking enthusiastic. I was quite surprised to realize that a number of researchers, developers and consultants in the web security community are very much aware [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=709&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Well, I&#8217;m just back from the <a href="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=valhallav%C3%A4gen,+stockholm,+sweden&amp;sll=59.341703,18.085642&amp;sspn=0.011554,0.038581&amp;ie=UTF8&amp;hq=&amp;hnear=Valhallav%C3%A4gen,+Stockholm,+Su%C3%A8de&amp;z=14&amp;layer=c&amp;cbll=59.342492,18.082905&amp;panoid=eR1USBvCpPGSpsXEMaH3cg&amp;cbp=12,0,,0,5">Way to Valhalla</a> and <a href="http://www.owasp.org/index.php/OWASP_AppSec_Research_2010_-_Stockholm,_Sweden">OWASP AppSec Research 2010</a>.</p>
<p style="text-align:justify;">The welcome was great, with plenty of people interested in <a href="http://www.mlstate.com">OPA</a> &#8212; some of them actually looking enthusiastic. I was quite surprised to realize that a number of researchers, developers and consultants in the web security community are very much aware of the limitations of current-generation approaches to security, but just don&#8217;t have the resources to start working on a next-generation approach. Speaking of resources, we&#8217;re now getting close to being 7 years into the OPA project, a commitment that not many research groups or companies could make.</p>
<p style="text-align:justify;">Interestingly, during his talk, Dave Wichers, the editor for the <a href="http://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project">OWASP Top 10 Web Application Security Risks</a> project, mentioned that the solution was certainly to <em>switch language and paradigm</em>, to something cleaner and easier to secure. This is, of course, exactly what we have been working on during all these years.</p>
<p style="text-align:justify;">All the slides and videos of the conference should be uploaded soon on the official website. In the meantime, I have uploaded <a href="http://www.slideshare.net/IamYoric/opa-owasp-2010">my slides</a>. I&#8217;ll try and add some sound if I can work out some sound problems I&#8217;ve been encountering recently with my presentations.</p>
<p style="text-align:justify;"><strong>Edit</strong> The presentation of OPA <a href="http://www.dailymotion.com/opabymlstate">available on Dailymotion</a> had sound issues. I&#8217;ve finally managed to fix them. Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dutherenverseauborddelatable.wordpress.com/709/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dutherenverseauborddelatable.wordpress.com/709/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=709&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dutherenverseauborddelatable.wordpress.com/2010/06/28/post-owasp-appsec-research/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/26385ab59b5a13c50262c302a3bcd17c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yoric</media:title>
		</media:content>
	</item>
		<item>
		<title>Offres d&#8217;emploi pour informaticiens de haut niveau</title>
		<link>http://dutherenverseauborddelatable.wordpress.com/2010/05/31/offres-demploi-pour-informaticiens-de-haut-niveau/</link>
		<comments>http://dutherenverseauborddelatable.wordpress.com/2010/05/31/offres-demploi-pour-informaticiens-de-haut-niveau/#comments</comments>
		<pubDate>Mon, 31 May 2010 12:22:31 +0000</pubDate>
		<dc:creator>yoric</dc:creator>
				<category><![CDATA[En français / In French]]></category>
		<category><![CDATA[OCaml]]></category>
		<category><![CDATA[offre d'emploi]]></category>
		<category><![CDATA[OPA]]></category>
		<category><![CDATA[Recherche / Research]]></category>
		<category><![CDATA[Sûreté / Security]]></category>
		<category><![CDATA[bases de données]]></category>
		<category><![CDATA[boulot]]></category>
		<category><![CDATA[candidature]]></category>
		<category><![CDATA[compilateur]]></category>
		<category><![CDATA[compilation]]></category>
		<category><![CDATA[concurrence]]></category>
		<category><![CDATA[cross-site scripting]]></category>
		<category><![CDATA[distribution]]></category>
		<category><![CDATA[docteur]]></category>
		<category><![CDATA[f#]]></category>
		<category><![CDATA[fonctionnel]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[impératif]]></category>
		<category><![CDATA[informaticien]]></category>
		<category><![CDATA[informatique]]></category>
		<category><![CDATA[ingénieur]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[langages]]></category>
		<category><![CDATA[langages de programmation]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[mlstate]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[parallélisme]]></category>
		<category><![CDATA[phd]]></category>
		<category><![CDATA[post-doctorat]]></category>
		<category><![CDATA[poste]]></category>
		<category><![CDATA[programmation distribuée]]></category>
		<category><![CDATA[programmation répartie]]></category>
		<category><![CDATA[r&d]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[sûreté]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[sgbd]]></category>
		<category><![CDATA[systèmes de types]]></category>
		<category><![CDATA[travail]]></category>
		<category><![CDATA[types]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://dutherenverseauborddelatable.wordpress.com/?p=701</guid>
		<description><![CDATA[MLstate est une jeune entreprise innovante en campagne depuis 2008 pour la reconquête du web. Notre objectif : réinventer les bases technologiques et scientifiques des applications web, pour une toile plus saine, plus sûre et plus sécurisée. Notre équipe R&#38;D compte une vingtaine de passionnés, docteurs ou ingénieurs en informatique, et est sur le point [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=701&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:justify;">MLstate est une jeune entreprise innovante en campagne depuis 2008 pour la reconquête du web. Notre objectif : réinventer les bases technologiques et scientifiques des applications web, pour une toile plus saine, plus sûre et plus sécurisée. Notre équipe R&amp;D compte une vingtaine de passionnés, docteurs ou ingénieurs en informatique, et est sur le point de s&#8217;agrandir.</p>
<p style="text-align:justify;">Si vous êtes informaticien de haut niveau, inspiré et ingénieux, si vous êtes doté d&#8217;une forte culture informatique et scientifique, d&#8217;une grande connaissance des langages fonctionnels et impératifs, de la compilation, des systèmes de types, contactez-nous. Le candidat idéal, docteur ou non, avec ou sans expérience industrielle, aura aussi des connaissances en distribution, parallélisme, bases de données, sera capable d&#8217;évoluer dans un environnement polyglotte et disposera de la finesse nécessaire pour construire des produits finis.</p>
<p>Les problèmes à résoudre sont difficiles. Pour relever le défi, contactez-nous à <a href="http://www.mlstate.com">careers@mlstate.com</a> .</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dutherenverseauborddelatable.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dutherenverseauborddelatable.wordpress.com/701/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dutherenverseauborddelatable.wordpress.com&#038;blog=1202429&#038;post=701&#038;subd=dutherenverseauborddelatable&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dutherenverseauborddelatable.wordpress.com/2010/05/31/offres-demploi-pour-informaticiens-de-haut-niveau/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/26385ab59b5a13c50262c302a3bcd17c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yoric</media:title>
		</media:content>
	</item>
	</channel>
</rss>