<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx</link><description>I'd like to take a detour from discussing the DLR's type system to start talking about implementation. I hope that this will make it easier to talk about some difficult questions like what is the right meta-model for the DLR type system. Let's start by</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#2657830</link><pubDate>Wed, 16 May 2007 00:52:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2657830</guid><dc:creator>Steve Maine</dc:creator><description>&lt;p&gt;How do you guys think about DLR trees vs something like System.Expressions?&lt;/p&gt;
</description></item><item><title>re: DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#2659814</link><pubDate>Wed, 16 May 2007 02:52:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2659814</guid><dc:creator>Robert Brewer</dc:creator><description>&lt;p&gt;That is indeed a powerful technique. I use a similar one for Dejavu/Geniusql to translate Python expressions into SQL. Would your DLR implementation be easier if Python had a first-class &amp;quot;expression tree&amp;quot; object? I'd love to work on a PEP for such a beast. I'm stuck passing lambdas into my Expression objects for the moment (although I expect to support genexps soon for the common case of relation-attribute-restriction 3-tuples like SQL SELECT uses). And having a simple symbolic syntax instead of the &amp;quot;lambda&amp;quot; keyword would make that kind of thing much more readable...&lt;/p&gt;
</description></item><item><title>re: DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#2660746</link><pubDate>Wed, 16 May 2007 03:56:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2660746</guid><dc:creator>j marlowe</dc:creator><description>&lt;p&gt;small typo in your code, should be factorial(n-1) not fact(n-1)&lt;/p&gt;
&lt;p&gt;oh i forgot dynamic-language guys enjoy finding errors at runtime... keeps things interesting &amp;nbsp; :)&lt;/p&gt;
</description></item><item><title>re: DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#2668897</link><pubDate>Wed, 16 May 2007 12:20:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2668897</guid><dc:creator>Programmer</dc:creator><description>&lt;p&gt;Hmmm, code as tree... Oh dude, congratuations, you just reinvented Lisp! Maybe Microsoft can patent it now and litigate the hell out of all the CS departments.&lt;/p&gt;
</description></item><item><title>re: DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#2671173</link><pubDate>Wed, 16 May 2007 14:50:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2671173</guid><dc:creator>malcontent</dc:creator><description>&lt;p&gt;I am sure MS has patents on the DLR, I wonder if they will indeed start suing people who use LISP or run programs written in LISP.&lt;/p&gt;
&lt;p&gt;Actually a more interesting question is whether MS will sue you if you write an open source application using the DLR.&lt;/p&gt;
</description></item><item><title>re: DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#2679946</link><pubDate>Wed, 16 May 2007 23:53:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2679946</guid><dc:creator>Ice Moose</dc:creator><description>&lt;p&gt;Since when LISP holds exclusive rights on representing expressions as trees?&lt;/p&gt;
&lt;p&gt;Plus, LISP's s-expresions are not exactly &amp;quot;code as tree&amp;quot; (unless some particular implementation is being referred to); it's rather &amp;quot;code as data&amp;quot;.&lt;/p&gt;
&lt;p&gt;Expression trees in DLR (or is it actually .NET 3.5?) are supposed/expected to be language agnostic, yet, as mentioned in the post, a particular language run-time is free to apply its own optimization and execution strategies.&lt;/p&gt;
</description></item><item><title>re: DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#2686870</link><pubDate>Thu, 17 May 2007 06:54:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2686870</guid><dc:creator>ArtVandalay</dc:creator><description>&lt;p&gt;Y'know, using a comment to point out a similarity between &amp;quot;code as tree&amp;quot; and Lisp isn't at all clever or insightful when the poster himself wrote &amp;quot;Anyone who's programmed in Lisp or Scheme knows this trick extremely well.&amp;quot;&lt;/p&gt;
&lt;p&gt;Not to mention that parsing code into an expression tree is the front end of pretty much every compiler since, I don't know, the introduction of BNF...&lt;/p&gt;
&lt;p&gt;One would (strenuously) hope any associated patents would be shouted down by the overabundance of prior art.&lt;/p&gt;
</description></item><item><title>re: DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#2784533</link><pubDate>Tue, 22 May 2007 09:03:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2784533</guid><dc:creator>Miguel de Icaza</dc:creator><description>&lt;p&gt;malcontent,&lt;/p&gt;
&lt;p&gt;Read the MsPl license, section 2.b, where there is an explicit patent grant for technologies covered by the DLR.&lt;/p&gt;
</description></item><item><title>re: DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#2836911</link><pubDate>Thu, 24 May 2007 11:47:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2836911</guid><dc:creator>tomasp</dc:creator><description>&lt;p&gt;Hi Jim,&lt;/p&gt;
&lt;p&gt;from the sample you posted it looks that DLR treats expressions and statements as different types, so I'm wondering if your AST would be able to represent following F# code:&lt;/p&gt;
&lt;p&gt;let a = 1 +&lt;/p&gt;
&lt;p&gt; &amp;nbsp;if (b=c) then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;print_string &amp;quot;side effect 1!&amp;quot;; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;3&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;print_string &amp;quot;side effect 2!&amp;quot;; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;4;&lt;/p&gt;
&lt;p&gt;In F# everything is an expression, so you can embed statements anywhere in the tree. You can write code with same semantics in JavaScript, so there will be *some* way for representing it, but it's quite an ugly trick ;-):&lt;/p&gt;
&lt;p&gt;var a = (b==c)?&lt;/p&gt;
&lt;p&gt; &amp;nbsp;(new function() {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;print_string &amp;quot;side effect 1!&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return 3;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;})():(new function() {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;print_string &amp;quot;side effect 2!&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return 4;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;})()&lt;/p&gt;
&lt;p&gt;Tomas&lt;/p&gt;
</description></item><item><title>re: DLR Trees (Part 1)</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#3054695</link><pubDate>Sun, 03 Jun 2007 08:50:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3054695</guid><dc:creator>xiao</dc:creator><description>&lt;p&gt;I'm waiting for Part 2 .........&lt;/p&gt;
</description></item><item><title>Papa fritas, cervezas y una babel de esos raros lenguajes nuevos</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#8955367</link><pubDate>Wed, 17 Sep 2008 14:55:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8955367</guid><dc:creator>Angel "Java" Lopez</dc:creator><description>&lt;p&gt;Gracias a la gente de Microsoft de Argentina, en especial al bueno de Miguel Saez , tendr&amp;#233; el gran gusto&lt;/p&gt;
</description></item><item><title>New and Notable 167</title><link>http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspx#9167867</link><pubDate>Wed, 03 Dec 2008 05:50:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9167867</guid><dc:creator>Sam Gentile's Blog</dc:creator><description>&lt;p&gt;You have to love a hotel where you have the amazing Lavazza coffee in your hotel room. CLR/Silverlight/Orcas/C# One of the things that has been a bit fustrating over the years with the CLR is the limitation of one CLR per process. Specifically, where&lt;/p&gt;
</description></item></channel></rss>