Tag Archives: programming

Compiler code generation: just flatten the tree

I spent some time tonight working on the compiler I am writing for my own education. I started this project while only understanding bits and pieces of what it takes to write a compiler, but I am quickly learning more. Various texts on compilers start with creating a simple calculator program that takes a string [...]

Genie: Write Python-like code that runs as fast as pure C

There is an article on the Postabon Blog titled “Make Lisp 15x faster than Python or 4x faster than Java.” In his benchmark, which is a tightly nested loop doing some trigonometric calculations, he achieves speed similar to Java with unoptimized Lisp and a 4X speed increase over that with some Lisp optimizations. He also [...]

Moving on from visualizations

I am beginning to question the appropriateness of visual aids in professional software development. When I only occasionally had to look at database structures and test out SQL queries, I used tools like phpMyAdmin and MySQL Workbench which provide GUI visualizations and click-friendly database management. I now look back at those times in the same [...]

Getting Things Done

I work at a very small software company that has as clients other small businesses. We do custom software. In 2010 that means we do web development. We bid on projects, complete the projects we get, fix any bugs for free for 6 months, and charge a very competitive hourly rate for new features. We [...]

My Programming Language Wish-List

I write custom software for a living. It’s usually fun, sometimes challenging, often tedious, but overall gratifying in a number of ways. One of these ways is that I get to be creative and build my own tools that help me write better software that is quicker to write, easier to support, and is more [...]

Root.js : A Skeletal MVC Framework for Node.js

OK, by skeletal, I mean absolutely no fat whatsoever. What you are about to witness is merely an illustration of a thought. Here’s the thought: I want to do serious server-side web development with JavaScript and Node.js. Why? Node.js is a convergence. The creation of Node.js was precipitated by several phenomena including the rise of [...]

An Apology For JavaScript

JavaScript is an excellent programming language. As a language, its strength lies in the simplicity and regularity of its syntax. I’m going to show you how much simpler it is than even Python or Ruby. OK, here is how you define a function in JavaScript:

function hello(target) {
alert("Hello, " + target);
}

And here [...]

You Make Me Want to Perl

I’ve always avoided Perl because of its reputation. And, well, it looks funny. The Perl folks like to golf, which leads to more confusion and incomprehensible code. But then I started picking up bits of information. The creator, Larry Wall, is linguist, not a computer scientist nut. There are constructions in the language that are [...]

Grokking JavaScript Part 3 : Functions

In JavaScript functions are also objects, just like arrays are also objects. Functions, when treated like objects, act like objects. They exist as instances and are referenced from variable names or object properties which are also just references. Here is a simple, empty function assigned to a variable (reference).

var emptyfunc = function() {};

Now, this function [...]

Grokking JavaScript Part 2 : Simple Arrays

An array in Javascript is a superset of an object that contains an ordered list of references. Here is the simplest Javascript array imaginable:

[]

The references in an array are not named, so creating an array of (references to) values and assigning that to a reference (variable) is easy.

var myarray = [1,2,"3","four"];

Arrays elements can be referenced [...]