<?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>Stephen Belanger &#187; v8</title>
	<atom:link href="http://www.stephenbelanger.com/tag/v8/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stephenbelanger.com</link>
	<description>Just another coder making the web a better place.</description>
	<lastBuildDate>Fri, 16 Jul 2010 00:02:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>JSGame &#8211; Game development in Javascript!</title>
		<link>http://www.stephenbelanger.com/2010/03/30/jsgame-game-development-in-javascript/</link>
		<comments>http://www.stephenbelanger.com/2010/03/30/jsgame-game-development-in-javascript/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 22:01:09 +0000</pubDate>
		<dc:creator>Qard</dc:creator>
				<category><![CDATA[Game Programming]]></category>
		<category><![CDATA[JSGame]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[OpenAL]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[SDL]]></category>
		<category><![CDATA[v8]]></category>
		<category><![CDATA[V8-GL]]></category>

		<guid isPermaLink="false">http://www.stephenbelanger.com/?p=90</guid>
		<description><![CDATA[I&#8217;ve recently started work on my newest Github project; JSGame. It&#8217;s a fork of philogb&#8217;s V8-GL which, as you can likely assume by the name; is an implementation of OpenGL using Google Chrome&#8217;s V8 javascript runtime. At the moment, the only difference in JSGame is a mostly untested implementation of OpenAL. I also plan to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently started work on my newest Github project; <a href="http://github.com/Qard/jsgame">JSGame</a>. It&#8217;s a fork of philogb&#8217;s V8-GL which, as you can likely assume by the name; is an implementation of OpenGL using Google Chrome&#8217;s V8 javascript runtime. At the moment, the only difference in JSGame is a mostly untested implementation of OpenAL. I also plan to add networking support and likely SDL. Once the various libraries I plan to implement have had Javascript interfaces made I&#8217;ll begin work on making helper classes for easier access to common actions.</p>
<img src="http://www.stephenbelanger.com/?ak_action=api_record_view&id=90&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.stephenbelanger.com/2010/03/30/jsgame-game-development-in-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Node.js &#8211; I&#8217;m a fanboy already.</title>
		<link>http://www.stephenbelanger.com/2010/02/17/node-js-im-a-fanboy-already/</link>
		<comments>http://www.stephenbelanger.com/2010/02/17/node-js-im-a-fanboy-already/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 03:31:46 +0000</pubDate>
		<dc:creator>Qard</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[narwhal]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[v8]]></category>
		<category><![CDATA[v8cgi]]></category>
		<category><![CDATA[web server]]></category>

		<guid isPermaLink="false">http://www.stephenbelanger.com/2010/02/17/node-js-im-a-fanboy-already/</guid>
		<description><![CDATA[About a week ago I discovered a unique new programming technology called <a href="http://nodejs.org/">node.js</a>. It's an event-driven javascript system running on Google's V8 engine and is primarily focused on functioning as a web server. I hesitate to call it a web server however--it's much more than that!]]></description>
			<content:encoded><![CDATA[<p>About a week ago I discovered a unique new programming technology called <a href="http://nodejs.org/">node.js</a>. It&#8217;s an event-driven javascript system running on Google&#8217;s V8 engine and is primarily focused on functioning as a web server. I hesitate to call it a web server however&#8211;it&#8217;s much more than that!</p>
<p>Using this amazing new system I was able to integrate support for the new WebSockets specification that Google recently added support for in Chrome, and I used this to make a simple real-time chat application with emoticon support and translation of image links to inline images and youtube links to inline videos.</p>
<p>&#8230;and the best part? This only took me about an hour!</p>
<p>There are some simple architectural differences that make it vastly more powerful that most any other popular web programming languages. One of my favorite characteristics of it&#8217;s unique design is that variables assigned in a global scope can be accessed across all requests&#8230;that means regular database querying becomes completely unnecessary! You could create a json object where you store your data, then check it over every once in awhile, and apply any changes to the database. It&#8217;d work as a query queue of sorts that would greatly reduce database interaction overhead and it wouldn&#8217;t require setting up some other incredibly complex software to proxy the requests!</p>
<p>I&#8217;m also quite fond of the branching design. There is a module called &#8216;http&#8217; for running web servers, but it&#8217;s really just routing everything through the tcp module, which essentially does the same thing. The &#8216;http&#8217; module just simplifies the interface and makes common actions like sending headers more elegant. It&#8217;s a clever design really; supply varying levels of complexity in control to match varying levels of complexity in application&#8211;not everyone is going to want the ability to create a mail server, so why would they want to have to access tcp directly? Inversely; not everyone is only going to want a web server, so why would you only supply access to http-related code?</p>
<p>Have a look at this sample code I ripped-off from the homepage of node.js;</p>
<pre>
var sys = require('sys'),
   http = require('http');
http.createServer(function (req, res) {
  setTimeout(function () {
    res.sendHeader(200, {'Content-Type': 'text/plain'});
    res.sendBody('Hello World');
    res.finish();
  }, 2000);
}).listen(8000);
sys.puts('Server running at http://127.0.0.1:8000/');
</pre>
<p>Isn&#8217;t it so simple? You just include a few modules, run http.createServer() with a callback function passing in the request and response objects and tell the server to listen on whatever port you want and whatever domain you want. In the callback you can branch of by breaking apart request.url to find the user&#8217;s query and use that to redirect via a switch block or whatever other means you see fit. Best of all, it&#8217;s asynchronous, so you don&#8217;t need to halt execution for every little thing. It&#8217;s even compatible with many common Javascript utility libraries such as <a href="http://documentcloud.github.com/underscore/">Underscore</a></p>
<img src="http://www.stephenbelanger.com/?ak_action=api_record_view&id=83&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.stephenbelanger.com/2010/02/17/node-js-im-a-fanboy-already/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
