<?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/"
	>

<channel>
	<title>Yet Another [À Compléter] &#187; Tao</title>
	<atom:link href="http://blog.neteril.org/category/mono/tao/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.neteril.org</link>
	<description>Random thoughts of Jérémie Laval</description>
	<lastBuildDate>Wed, 24 Aug 2011 17:43:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Yet another brainwave</title>
		<link>http://blog.neteril.org/2007/04/27/new-pet-project/</link>
		<comments>http://blog.neteril.org/2007/04/27/new-pet-project/#comments</comments>
		<pubDate>Fri, 27 Apr 2007 11:07:09 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Mono.Xna]]></category>
		<category><![CDATA[Tao]]></category>

		<guid isPermaLink="false">http://garuma.wordpress.com/2007/04/27/new-pet-project/</guid>
		<description><![CDATA[Some times ago I noticed that the Tao website was revamped under Rob care to a new Drupal-based plateform which is actually cleaner and more &#171;&#160;professional&#160;&#187; than the plain Mediawiki-based wiki. This lead me to the news of the Tao 2.0 RC2 release that I &#171;&#160;quickly&#160;&#187; downloaded. &#171;&#160;Quickly&#160;&#187; because even in the tar.gz package, which [...]]]></description>
			<content:encoded><![CDATA[<p>Some times ago I noticed that the <a href="http://www.taoframework.com">Tao website</a> was revamped under Rob care to a new Drupal-based plateform which is actually cleaner and more &laquo;&nbsp;professional&nbsp;&raquo; than the plain Mediawiki-based wiki.</p>
<p>This lead me to the news of the Tao 2.0 RC2 release that I &laquo;&nbsp;quickly&nbsp;&raquo; downloaded. &laquo;&nbsp;Quickly&nbsp;&raquo; because even in the tar.gz package, which is supposed to be more for UNIX folks, Tao devs put <b>every</b> Win32 DLLs dependencies that they could find for Tao and moreover in two different places (14 Mo for nothing) ! (They were also OSX deps).</p>
<p>But well I&#8217;m not writing this post to complain on Tao strange relationship with dependencies <img src='http://blog.neteril.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  . Instead I want to point out several problems of Tao under Linux. As you (should) know Tao is P/Invoke wrapper around several multimedia-related libraries like OpenGL, OpenAL, GLFW, SDL etc&#8230; . It&#8217;s notorious that under Linux there has been always some problems. mine were almost always related to double-freed pointers or corrupted memory. Moreover there are always been some inconsistency in method prototype (bad parameter type generally). In fact only the Tao.OpenGL wrapper is generated automatically via a spec parser, that&#8217;s fine because <a href="http://www.opengl.org/">OpenGL</a> is a <a href="http://www.opengl.org/documentation/specs/">standard</a> and under the <a href="http://www.opengl.org/about/arb/">governance</a> of big companies (ATI, NVidia &#8230;) that&#8217;s why stuff are well done and why there is such thing as a spec file describing every function, enum, typedef and even vendor-specific extensions. But other projects don&#8217;t have the time, resources, or just the will to do such a thing. That&#8217;s why I had the idea to create a P/Invoke generator that would take a .h file and produce the corresponding P/Invoke .cs file. There is already a tool which do things like this : Swing but the problem is that it force to create c wrappers whereas the P/Invoke system is precisely designed to avoid such things.</p>
<p>Since I didn&#8217;t want to create a full-featured C parser in C# I had three possibilities :
<ul>
<li>Use some well crafted and illegible Regex to fetch function prototype and struct scheme. The main problem is that they are complicated stuff to look for, like typedef and #define directives.</li>
<li>Use the same process that before but on a preprocessed source file thus eliminating some difficulties. Problem : the typedef case stays the same.</li>
<li>Use a dedicated compiler which produce something readable instead of machine code. Fortunately there is a tool out there which do just that : GCC-XML. GCC-XML is a full featured gcc compiler that output XML representing the internal of GCC during the compilation (the GIMPLE tree I think). Personal problem : even if I can use the big facilities of the .NET framework regarding XML support, the output of GCC-XML is still, hum, barely readable for a limited human being like me <img src='http://blog.neteril.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  . But since the common good is more important I decided to go with this solution <img src='http://blog.neteril.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  .</li>
</ul>
<p>If you are curious <a href="http://garuma.files.wordpress.com/2007/04/sampleh.txt">here</a> is a sample code that I use like a test for the parser, and <a href="http://garuma.files.wordpress.com/2007/04/testxml.txt">here</a> is the result returned by GCC-XML (without options). As you can see there are all possible informations in the XML file like the length of the structure, the alignment, the offset &#8230;</p>
<p>I have started to write the XML parser right now so let&#8217;s see if the result will be convincing. Stay tuned <img src='http://blog.neteril.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  .</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2007/04/27/new-pet-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

