<?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>Matthew Turland &#187; C</title>
	<atom:link href="http://matthewturland.com/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthewturland.com</link>
	<description></description>
	<lastBuildDate>Tue, 24 Jan 2012 04:03:47 +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>Custom Building PHP on Windows and Linux</title>
		<link>http://matthewturland.com/2008/03/08/custom-building-php-on-windows-and-linux/</link>
		<comments>http://matthewturland.com/2008/03/08/custom-building-php-on-windows-and-linux/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 23:49:14 +0000</pubDate>
		<dc:creator>Matthew Turland</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[C]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[At the encouragement of Elizabeth Smith, I went through the process (not-so-recently as of this blog entry) of compiling PHP on Windows. I actually managed to get 5.2.5 and 5.3 both working on Windows XP. Major credit for success in that endeavor goes to Elizabeth herself who helped me through hurdles in the process, her [...]]]></description>
			<content:encoded><![CDATA[<p>At the encouragement of <a title="Dreaming of Dawn" href="http://elizabethmariesmith.com">Elizabeth Smith</a>, I went through the process (not-so-recently as of this blog entry) of compiling PHP on Windows. I actually managed to get 5.2.5 and 5.3 both working on Windows XP. Major credit for success in that endeavor goes to Elizabeth herself who helped me through hurdles in the process, <a title="Dreaming of Dawn - Blog Archive - How to Compile PHP5.2 and PHP-GTK2 on Windows using Visual C++ Express" href="http://emsmith.net/how-to-compile-php52-and-php-gtk2-on-windows-using-visual-c-express">her older tutorial</a> on compiling PHP 5.2 on XP using <acronym title="Visual C++ Express">VCE</acronym> 2005, and <a href="http://blog.astrumfutura.com/archives/327-Compiling-PHP-for-Windows-Vista-using-Visual-C++-Express-2008-Seriously!.html">Pádraic Brady&#8217;s tutorial</a> for compiling PHP 5.3 on Vista using <acronym title="Visual C++ Express">VCE</acronym> 2008.</p>
<p>First off, there are a few hefty things to download and install. Here&#8217;s the laundry list.</p>
<ul>
<li><a title="Visual C++ Express 2008" href="http://www.microsoft.com/express/Downloads/">Visual C++ Express 2008</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&amp;displaylang=en">Microsoft Platform SDK for Windows Server 2003 R2</a></li>
<li><a title=".NET Framework 3.5 SDK" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&amp;displaylang=en">.NET Framework 3.5 SDK</a></li>
<li>Desired PHP <a href="http://us3.php.net/downloads.php">official source release</a> or <a href="http://snaps.php.net">snapshot tarball</a></li>
<li><a href="http://files.edin.dk/php/win32/zip.zip">Edin Kadribašic&#8217;s library and header bundle</a></li>
<li><a href="http://ctindustries.net/libxml/">Rob Richard&#8217;s libxml bundle</a> (5.3 only)</li>
</ul>
<p>Beyond the slight differences in the software required, the process described in Elizabeth&#8217;s tutorial is still fairly accurate. One thing I noticed for 5.2.5 is that there&#8217;s an issue with including IPv6 support, which is done by default when you configure your build. When you try to compile, you&#8217;ll probably see an error that looks like this.</p>
<pre>network.c(897): error C2065: 'in6addr_any': undeclared identifiernetwork.c(897): error C2440: '=' : cannot convert from 'int' to  'IN6_ADDR'</pre>
<p>There are two ways to get around this. The first is to include the &#8211;disable-ipv6 flag in the configure line. The other is applying the changes in lines 94-96 of <a href="http://svn.php.net/viewvc/php/php-src/trunk/main/network.c?revision=249483&amp;view=markup">a fairly simple patch</a> to your network.c file so that it includes these lines in the proper place.</p>
<pre>#if HAVE_IPV6const struct in6_addr in6addr_any = {0}; /* IN6ADDR_ANY_INIT; */#endif</pre>
<p>Another issue is that you may receive an error regarding libmysql.dll not being found when you attempt to run nmake test. You must have the directory containing this file either in your PATH or parallel to php5ts.dll, as these are the only places that Windows will look for it. Thanks again to Elizabeth for this tip.</p>
<p>OK, hopefully the Linux people haven&#8217;t left yet. (You guys have a slightly more short and sweet segment in this blog entry.) I also did a custom build of 5.3 on Debian recently to use in running <a title="Phergie - A PHP 5 IRC bot" href="http://phergie.org">Phergie</a>. I wanted to do a minimal local build to optimize performance (5.3 includes the garbage collection patch) as well as to include a few extensions that Phergie uses. One of these was the pspell extension for her Spellcheck plugin. I don&#8217;t have root access to the system on which I was going to run her, and since it didn&#8217;t have the aspell libraries already installed, I had to compile those from source as well. Here&#8217;s how I did it.</p>
<p>First, aspell itself.<br />
wget -c ftp://ftp.gnu.org/gnu/aspell/aspell-0.60.5.tar.gz<br />
tar -zxvf aspell-0.60.5.tar.gz<br />
cd aspell-0.60.5<br />
./configure &#8211;prefix=/path/to/aspell-0.60.5/build<br />
make<br />
make install</p>
<p>Next, the English dictionary for aspell.</p>
<p>wget -c ftp://ftp.gnu.org/gnu/aspell/dict/en/aspell6-en-6.0-0.tar.bz2<br />
bunzip2 aspell6-en-6.0-0.tar.bz2<br />
tar -xvf aspell6-en-6.0-0.tar<br />
cd aspell6-en-6.0-0<br />
./configure &#8211;vars ASPELL=/path/to/aspell-0.60.5/build/bin/aspell \<br />
PREZIP=/path/to/aspell-0.60.5/build/bin/prezip-bin<br />
make<br />
make install</p>
<p>And finally, PHP with the pspell extension compiled in.</p>
<p>wget -c http://snaps.php.net/php5.3-200803032330.tar.gz<br />
tar -zxvf php5.3-200803032330.tar.gz<br />
./configure &#8211;disable-cgi &#8211;without-sqlite &#8211;enable-pcntl \<br />
&#8211;prefix=/path/to/php-5.3/build/php_build \<br />
&#8211;with-pspell=/path/to/aspell-0.60.5/build<br />
make<br />
make test<br />
make install</p>
<p>And presto, that&#8217;s all there was to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewturland.com/2008/03/08/custom-building-php-on-windows-and-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Yin and Yang of Typing</title>
		<link>http://matthewturland.com/2008/01/20/the-yin-and-yang-of-typing/</link>
		<comments>http://matthewturland.com/2008/01/20/the-yin-and-yang-of-typing/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 04:33:53 +0000</pubDate>
		<dc:creator>Matthew Turland</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[Programming Languages]]></category>

		<guid isPermaLink="false">http://ishouldbecoding.com/2008/01/19/the-yin-and-yang-of-typing/</guid>
		<description><![CDATA[Without a little background in programming languages or computer science in general, it&#8217;s entirely possible that typing systems are not something that have crossed your mind. I thought I&#8217;d take a blog entry to share some of my thoughts on how it&#8217;s affecting the creation and evolution of languages. First of all, Benjamin C. Pierce [...]]]></description>
			<content:encoded><![CDATA[<p>Without a little background in programming languages or computer science in general, it&#8217;s entirely possible that <a title="Type system - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Type_system">typing systems</a> are not something that have crossed your mind. I thought I&#8217;d take a blog entry to share some of my thoughts on how it&#8217;s affecting the creation and evolution of languages.</p>
<p>First of all, <a title="Benjamin C. Pierce - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Benjamin_C._Pierce">Benjamin C. Pierce</a> probably has <a title="Strongly-typed programming language - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Strong_typing#Interpretation">a point</a>: terminology used to refer to typing concepts is about as useful as buzzwords like <a title="Ajax (programming) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">AJAX</a> or <a title="Web 2.0 - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Web_2.0#Defining_.22Web_2.0.22">Web 2.0</a> these days. Be that as it may, I&#8217;m going to reach back into the recesses of what I recall from the <a title="CMPS 450: Programming Languages" href="http://louisiana.edu/Academic/Sciences/CMPS/curriculum/crsdesc/450.pdf">programming languages course</a> I took in college to recall some of this terminology.</p>
<p>If you aren&#8217;t familiar with <a title="Type system - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Static_typing#Static_typing">static</a> versus <a title="Type system - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Dynamic_typing#Dynamic_typing">dynamic</a> typing or <a title="Strongly-typed programming language - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Strong_typing">strong</a> versus <a title="Weak typing - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Weak_typing">weak</a> typing, it may be worth it to read up on those before proceeding with the rest of this blog entry. Here are a few examples of each:</p>
<ul>
<li>Static/weak &#8211; <a title="C (programming language) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/C_programming_language">C</a></li>
<li>Static/strong &#8211; <a title="Java (programming language) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Java_programming_language">Java</a></li>
<li>Dynamic/weak &#8211; <a title="PHP - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/PHP">PHP </a></li>
<li>Dynamic/strong &#8211; <a title="Python (programming language) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Python_programming_language">Python</a></li>
</ul>
<p>The line between strong versus weak typing seems to be blurred as languages like these evolve. The reason for this is that each side of typing has its advantages. Strong typing allows for compile-time checking, which can serve to eliminate human error, as well as performance optimizations from being aware of types at compile-time. They can also serve to make source code more intuitive to follow in some respects. Weak typing, on the other hand, can allow for higher levels of abstraction and, by proxy, the need for less code in order to allow identical operations to be executed on multiple types. It can also allow for things like <a title="PHP: Variable variables - Manual" href="http://www.php.net/manual/en/language.variables.variable.php">variable variables</a>, <a title="PHP: Variable functions - Manual" href="http://www.php.net/manual/en/functions.variable-functions.php">variable functions</a>, and other interesting features not possible in strongly-typed languages.</p>
<p>Yet languages on either side of the proverbial fence are drawing in strengths from the other side. Java, before limited to the flexibility that could be provided by <a title="Polymorphism (computer science) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29">polymorphism</a> while still maintaining strong typing, introduced <a title="Generics" href="http://download.oracle.com/javase/1.5.0/docs/guide/language/generics.html">generics</a> in 1.5, whereby typing was still enforced but a higher level of logic abstraction was enabled for developers. By the same token, PHP has had explicit <a title="PHP: Type Juggling - Manual" href="http://www.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting">typecasting</a> for a while and more recently in 5.1 introduced <a title="PHP: Type Hinting - Manual" href="http://www.php.net/manual/en/language.oop5.typehinting.php">type hinting</a> for array and object types (which may extend to scalar types in later versions). C# in 3.5 adds <a title="Type inference != Dynamic typing - the blog =&lt; anything goes" href="http://msmvps.com/blogs/senthil/archive/2007/11/19/type-inference-dynamic-typing.aspx">type inferencing</a>, which while it&#8217;s only syntactic sugar at least alleviates the need for verbosity when performing the most common method of initialization (i.e. setting a variable of a given class to an object instance of that class, as opposed to one involving a subclass of one or more of the classes involved).</p>
<p>It&#8217;s also becoming commonplace for dynamically typed language interpreters to get ported to Java and .NET in order to leverage the features of those languages and the native libraries of the host language in the existing execution environment. Take these examples for instance.</p>
<ul>
<li><a href="http://quercus.caucho.com/">Quercus</a> (Java) and <a href="http://php-compiler.net">Phalanger</a> (.NET) for <a href="http://php.net/">PHP</a></li>
<li><a href="http://www.jruby.org/">JRuby</a> (Java) and <a href="http://www.ironruby.net/">IronRuby</a> (.NET) for <a href="http://www.ruby-lang.org/en/">Ruby</a></li>
<li><a href="http://www.jython.org/">Jython</a> (Java) and <a href="http://www.codeplex.com/IronPython">IronPython</a> (.NET) for <a href="http://python.org/">Python</a></li>
</ul>
<p>In short, some level of control over typing is obviously a desired feature in any useful language. As well, I don&#8217;t think a language can be truly useful without having a bit of both worlds to some degree. The reason for the existence of programming languages is to enable developers to control machines whose primary purpose is to manipulate data (and, as has been pointed out many times before, are stupid and do what we tell them to do). If control over said manipulation is hampered by the typing system, it hampers the effectiveness of the language. In this, I have to agree with <a title="Ludwig Wittgenstein - Wikiquote" href="http://en.wikiquote.org/wiki/Ludwig_Wittgenstein">Ludwig Wittgenstein</a>, who said, &#8220;The limits of my language mean the limits of my world.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewturland.com/2008/01/20/the-yin-and-yang-of-typing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
