Posts

Showing posts from June, 2010

Let's make a shit JavaScript interpreter! Part one.

Image
Let's make a shit javascript interpreter! Part one. As a learning exercise, I've begun writing a javascript ECMAScript interpreter in python . It doesn't even really exist yet, and when it does it will run really slowly, and not support all js features. So... let's make a "from scratch", all parsing, all dancing, shit interpreter of our very own! Teaching something is a great way to learn. Also writing things on my blog always gets good 'comments', hints, tips, plenty of heart, and outright HATE from people. All useful and entertaining :) Tokenising So to start with, we need something to turn the .js files into a list of tokens. This type of program is called a tokeniser. From some javascript like this: function i_can_has_cheezbrgr () {return 'yum';}; Into a Token list something like this: [ {"type":"name", "value":"function", "from":0, "to":8}, {"type":"n

My javascript reading list over the last few months

Over the last few months I've been fairly deep into javascript land. Both in my full time job, and in most of my coding side projects - I've been mostly doing javascript. Of course, like most web programmers I've been dabbling in javascript over the years... but never so intensely. On the way I've been collecting a 'reading list' of videos, articles, books, and projects. Here are some of the good links from the last few months. Crockford on javascript videos: http://www.yuiblog.com/blog/ 2010/04/08/video-crockonjs-5/? utm_source=feedburner&utm_ medium=feed&utm_campaign=Feed% 3A+YahooUserInterfaceBlog+% 28Yahoo!+User+Interface+Blog% 29 akihabara arcade: http://www.kesiev.com/ akihabara/ canvas javascript games: http://www.benjoffe.com/code/ javascript 3d engine: http://github.com/mrdoob/ three.js Aves Engine: HTML/ JavaScript Game Engine ( youtube.com ) http://www.youtube.com/watch? v=Ol3qQ4CEUTo http://ajaxian.com/archives/ aves-game-e