<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-15559513</id><updated>2011-04-21T23:45:51.975+02:00</updated><title type='text'>Serras Blog</title><subtitle type='html'>Comments on Nemerle Compiler, C#, IL and other amusing programming topics</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://trupill.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15559513/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://trupill.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Serras</name><uri>http://www.blogger.com/profile/02432204175434170086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-15559513.post-113001701743188263</id><published>2005-10-22T23:06:00.000+02:00</published><updated>2005-10-22T23:36:59.660+02:00</updated><title type='text'></title><content type='html'>&lt;span style="font-size:180%;"&gt;Using Nemerle and Boo in ASP.NET&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Mono aims to be a really multi-language platform. And as way to check it, we will learn how to include Boo and Nemerle scripts (from my two favorites languages :-) inline in ASP.NET pages, that can be used then with XSP, mod_mono or even IIS, I think.&lt;br /&gt;First of all, in your &lt;span style="font-family:courier new;"&gt;machine.config&lt;/span&gt; file or &lt;span style="font-family:courier new;"&gt;web.config&lt;/span&gt; one, depending if you want a global change or a per-web application change, locate a section called &lt;span style="font-family:courier new;"&gt;&amp;lt;compilation&amp;gt;&lt;/span&gt; or &lt;span style="font-family:courier new;"&gt;&amp;lt;compilers&amp;gt;&lt;/span&gt;. The &lt;span style="font-family:courier new;"&gt;Nemerle.Compiler&lt;/span&gt; or &lt;span style="font-family:courier new;"&gt;Boo.CodeDom&lt;/span&gt; assemblies should be in the GAC, so it can be easily located. However, you can also add a directive into the &lt;span style="font-family:courier new;"&gt;&amp;lt;assemblies&amp;gt;&lt;/span&gt; section of &lt;span style="font-family:courier new;"&gt;web.config;&lt;/span&gt; (this is recommended for Boo). The directive should look like &lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;&amp;lt;add assembly="Boo.Lang.CodeDom" /&amp;gt;&lt;/span&gt;&lt;/blockquote&gt; Finally, in the compilers section, you must add this for Nemerle:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;&amp;lt;compiler language="n;nemerle;Nemerle" extension=".n" warningLevel="1" compilerOptions="" type="Nemerle.Compiler.NemerleCodeProvider, Nemerle.Compiler, Version=0.9.0, Culture=neutral, PublicKeyToken=5291d186334f6101" /&amp;gt; &lt;/span&gt;&lt;/blockquote&gt; or this for Boo:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;&amp;lt;compiler language="Boo" extension=".boo" type="Boo.Lang.CodeDom.BooCodeProvider, Boo.Lang.CodeDom" /&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;From then, you can use Nemerle or Boo direclt in ASPX pages just changing the Language directive on Page to &lt;span style="font-family:courier new;"&gt;"Boo"&lt;/span&gt; or &lt;span style="font-family:courier new;"&gt;"Nemerle"&lt;/span&gt;. This is the "Hello World!" ASPX page that comes with Boo examples:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;&amp;lt;%@ Page Language="Boo" %&amp;gt;&lt;br /&gt;&amp;lt;script runat="server"&amp;gt;&lt;br /&gt;def Page_Load(Sender as Object, E as EventArgs) :&lt;br /&gt;&amp;nbsp;&amp;nbsp;HelloWorld.Text = "Hello World From Boo in ASP!"  &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;ASP.NET Hello World&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body bgcolor="#FFFFFF"&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&amp;lt;asp:label id="HelloWorld" runat="server" /&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/blockquote&gt; and this is the same in Nemerle:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;&amp;lt;%@ Page Language="Nemerle" %&amp;gt;&lt;br /&gt;&amp;lt;script runat="server"&amp;gt;&lt;br /&gt;Page_Load(_ : object, _ : EventArgs) : void {&lt;br /&gt;&amp;nbsp;&amp;nbsp;HelloWorld.Text = "Hello World From Nemerle in ASP!"; &lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;ASP.NET Hello World&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body bgcolor="#FFFFFF"&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&amp;lt;asp:label id="HelloWorld" runat="server" /&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;As you can see, using C#, VB or Nemerle is just a matter of a directive. Now you can start even coding your AJAX applications in Boo!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15559513-113001701743188263?l=trupill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trupill.blogspot.com/feeds/113001701743188263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15559513&amp;postID=113001701743188263' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15559513/posts/default/113001701743188263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15559513/posts/default/113001701743188263'/><link rel='alternate' type='text/html' href='http://trupill.blogspot.com/2005/10/using-nemerle-and-boo-in-asp.html' title=''/><author><name>Serras</name><uri>http://www.blogger.com/profile/02432204175434170086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15559513.post-112592884874696704</id><published>2005-09-05T12:57:00.000+02:00</published><updated>2005-10-22T23:05:36.473+02:00</updated><title type='text'></title><content type='html'>&lt;span style="font-size:180%;"&gt;Compiling Nemerle SVN on Mono SVN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Compiling Nemerle from a Subversion repository is an easy task. You need Mono 1.1.9, but we will also talk about getting it from SVN. This is not intented as the ultimate guide for builders, but as a quick guide for people who, like me, come from a Windows environment and aren't used to using tools such as patch or svn.&lt;br /&gt;You should create a directory to work. In my case, I used &lt;span style="font-family:courier new;"&gt;/root/mono-svn&lt;/span&gt;.&lt;br /&gt;Well, let's start. Open a terminal and change to the folder using cd. First of all we need to check-out Mono and MCS sources, so let's use the &lt;span style="font-family:courier new;"&gt;svn&lt;/span&gt; command.&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;blockquote&gt;svn co svn://svn.myrealbox.com/source/trunk/mono&lt;/blockquote&gt;&lt;/span&gt;Then we have to go to the &lt;span style="font-family:courier new;"&gt;mono&lt;/span&gt; folder that &lt;span style="font-family:courier new;"&gt;svn&lt;/span&gt; created. You know, &lt;span style="font-family:courier new;"&gt;cd mono&lt;/span&gt;. Finish getting mono sources by using:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;blockquote&gt;svn co svn://svn.myrealbox.com/source/trunk/mcs&lt;/blockquote&gt;&lt;/span&gt;Getting mcs sources will take much longer than mono ones, because it includes the entire Base Class Library sources plus Mono additions to it. The final directory structure on the folder should be:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;mono/&lt;/span&gt;&lt;br /&gt;     &lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;libgc/&lt;/span&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;mono/&lt;/span&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;data/&lt;/span&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;docs/&lt;/span&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;...&lt;/span&gt;&lt;br /&gt;    &lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;mcs/&lt;/span&gt;&lt;br /&gt;      &lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;class/&lt;/span&gt;&lt;br /&gt;      &lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bmcs/&lt;/span&gt;&lt;br /&gt;      &lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mcs/&lt;/span&gt;&lt;br /&gt;      &lt;span style="font-family:courier new;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gmcs/&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;(UPDATE: Patching Mono is not longer neccessary as the pacthes have been finally accepted. You can skip this section.&lt;/b&gt;) Until Nemerle creators patches to Mono are accepted, we have to use them by hand. Get &lt;span style="font-family:courier new;"&gt;mono-all.patch&lt;/span&gt; from &lt;a href="http://nemerle.org/%7Emalekith/temp/mono-all.patch"&gt;http://nemerle.org/~malekith/temp/mono-all.patch&lt;/a&gt; and copy it in the top level &lt;span style="font-family:courier new;"&gt;mono&lt;/span&gt; directory (be careful, because there exists another &lt;span style="font-family:courier new;"&gt;mono/mono/&lt;/span&gt; folder, as you can see). Do the same with &lt;a href="http://nemerle.org/mailman/pipermail/devel-en/attachments/20050905/e147cce6/monop.obj"&gt;http://nemerle.org/mailman/pipermail/devel-en/attachments/20050905/e147cce6/monop.obj&lt;/a&gt;,  saving it as &lt;span style="font-family:courier new;"&gt;monop.patch&lt;/span&gt;. Now apply the patches: go to the top level &lt;span style="font-family:courier new;"&gt;mono&lt;/span&gt;, and run these commands:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;patch -p0 &amp;lt; mono-all.patch&lt;br /&gt; &lt;span style="font-family:courier new;"&gt;patch -p0 &amp;lt; monop.patch&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;In a not very long time these patches won't be neccessary. Even at the moment of this writing, some patches have been approved, so patch asks you this:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;Reversed (or previously applied) patch detected!  Assume -R? [n] n&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family:courier new;"&gt;Apply anyway? [n] n&lt;/span&gt;&lt;/blockquote&gt;Answer both "n", as you don't want to reverse or either apply the patch in a newer version.&lt;br /&gt;It shouldn't ask you about a location. If it does, check you've copied the file in the correct folder.&lt;br /&gt;&lt;b&gt;(UPDATE: Continue from here if you have skipped patching section)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now it's time to compile mono. First of all use &lt;span style="font-family:courier new;"&gt;./autogen.sh&lt;/span&gt;. This small script ensures you've all the dependencies needed to build Mono. By default, Mono builds to the system library folder, but if you are running it from SVN, you will sure want to build it in a directory apart from your normal applications, so you need to provide a "prefix". In my case, I'll use &lt;span style="font-family:courier new;"&gt;/devel/mono&lt;/span&gt;, so my &lt;span style="font-family:courier new;"&gt;autogen&lt;/span&gt; command will look like this:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;blockquote&gt;./autogen.sh --prefix=/devel/mono&lt;/blockquote&gt;&lt;/span&gt;If &lt;span style="font-family:courier new;"&gt;autogen&lt;/span&gt; tells some dependency or file is needed try using &lt;span style="font-style: italic;"&gt;yum&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;apt-get&lt;/span&gt; or whatever package manager ships with your distro. The real compilation will start when you type&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;blockquote&gt;make&lt;/blockquote&gt;&lt;/span&gt;and press Enter.&lt;br /&gt;If &lt;span style="font-family:courier new;"&gt;make&lt;/span&gt; complains about a not usable &lt;span style="font-family:courier new;"&gt;mcs&lt;/span&gt; installation, try using &lt;span style="font-family:courier new;"&gt;make get-monolite-latest&lt;/span&gt; and then running &lt;span style="font-family:courier new;"&gt;make&lt;/span&gt; again.&lt;br /&gt;Finally, if everything it's OK (it doesn't end with any error), install Mono in the desired "prefix" running the command.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;blockquote&gt;make install&lt;/blockquote&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;Note:&lt;/span&gt; there's also a &lt;span style="font-family:courier new;"&gt;make check&lt;/span&gt; command that will check good compilation, but it not neccessary to run it, furthermore if you're in a hurry. Indeed, in SVN versions it fails most of times.&lt;br /&gt;&lt;br /&gt;Now let's compile Nemerle. First of all, get the sources. I suggest using a different folder for this svn, so everything doesn't come mixed up. In my case, I'll use &lt;span style="font-family:courier new;"&gt;/root/nemerle-svn&lt;/span&gt;. So I change to its parent folder using &lt;span style="font-family:courier new;"&gt;cd&lt;/span&gt;, and then check out the sources (the last parameter, nemerle-svn, is the folder where I want the sources to be saved):&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;blockquote&gt;svn co http://nemerle.org/svn/nemerle/trunk nemerle-svn&lt;/blockquote&gt;&lt;/span&gt;Subversion will tell you the revision you have got. Then go to the newly created folder and run &lt;span style="font-family:courier new;"&gt;./configure&lt;/span&gt;. You can pass some other arguments to this scripts&lt;br /&gt;&lt;ul&gt;   &lt;li&gt;&lt;span style="font-family:courier new;"&gt;--mono-from=&lt;span style="font-style: italic;"&gt;path&lt;/span&gt;&lt;/span&gt;: if you compiled Mono with a prefix, use it here. But be aware you must tell the &lt;span style="font-family:courier new;"&gt;bin&lt;/span&gt; directory, not the base one.&lt;/li&gt;   &lt;li&gt;&lt;span style="font-family:courier new;"&gt;--prefix=&lt;span style="font-style: italic;"&gt;path&lt;/span&gt;&lt;/span&gt;: as on Mono, if you don't want the compiler to live in the standar library directory, specify where you want to install it here.&lt;/li&gt; &lt;/ul&gt; So in this case, the command will be like here:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;blockquote&gt;./configure --mono-from=/devel/mono/bin --prefix=/devel/nemerle&lt;/blockquote&gt;&lt;/span&gt;Then compile and install the sources using:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;m&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;ake&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;make check&lt;/span&gt; &lt;span style="font-size:100%;"&gt;(optional, as in Mono)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;make install&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;Nemerle compilation has 4 stages. The first three build the compiler and the main libraries that contains macros and special Nemerle types, such as lists. In the last stage, some additional tools as &lt;span style="font-family:courier new;"&gt;nemerlish&lt;/span&gt; (Nemerle Interactive Shell).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Note:&lt;/span&gt; of course, you can also leave out prefixes, so use of Mono and Nemerle will be easier. If you don't care so much about your data and apps (and both Mono and Nemerle should not make anything to them). But use it at your own risk (the only thing I can say is that I use them this way and I have no problems).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15559513-112592884874696704?l=trupill.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trupill.blogspot.com/feeds/112592884874696704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15559513&amp;postID=112592884874696704' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15559513/posts/default/112592884874696704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15559513/posts/default/112592884874696704'/><link rel='alternate' type='text/html' href='http://trupill.blogspot.com/2005/09/compiling-nemerle-svn-on-mono-svn.html' title=''/><author><name>Serras</name><uri>http://www.blogger.com/profile/02432204175434170086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
