Monthly Archives: March 2012

Lisp: Links, News and Resources (1)

Next Post

If you usually read this blog, you should know about my interest in Lisp programming languages. This is the first post on a series with my collected links.

Structure and Interpretation of Computer Programs

Structure and Interpretation of Computer Programs, Video Lectures

Beating the Averages

What Made Lisp Different

Lisp for the Web

L-99: Ninety-Nine Lisp Problems

Growing a Language

Getting Started | Lambda the Ultimate

Lisp Isn’t Really a Programming Language « Learning Lisp

Common Lisp – Myths and Legends — Lisp for the Web, Part II

Automata via Macros

Hedgehog is a very concise implementation of a Lisp-like language for low-end and embedded devices.

Stylish Lisp programming techniques

The Rebirth of Lisp

Lisp machine

YouTube – Practical Common Lisp

Primacy of syntax

Programing Language: The Glory of Lisp’s cons

YouTube – Land of Lisp- The Music Video!

Beginning LISP Programming in Ubuntu

Investing with lisp

Review of Structure and Interpretation of Computer Programs

Review of Let Over Lambda

Make macros and functions integrate more seamlessly

Pharen: Lisp -> PHP

Lisp: Common Lisp, Scheme, Clojure, Emacs Lisp – Hyperpolyglot

Social Problems Of Lisp

Monad Macros in Common Lisp

Lisk – Lisp and Haskell

The Little Schemer

Common Lisp Extensions – Common Lisp Extensions

The Common Lisp Cookbook

Zach’s Journal

Arc Tutorial

And my implementations

More links about Lisp and similar programming languages are coming.

Keep tuned!

Angel “Java” Lopez

Ruby: Links, news and Resources (4)

Previous Post
Next Post

More links about Ruby Programming:

tarcieri / celluloid
Actor-based concurrent framework for Ruby

Programming Ruby 1.9 (3rd edition): The Pragmatic Programmers’ Guide

Learn to Program
A Place to Start for the Future Programmer

NoSQL OODB with Smalltalk-based Ruby VM: MagLev 1.0 Released

MetaWhere & MetaSearch
MetaWhere provides a way to do complex find conditions without SQL in Active Record. MetaSearch makes it easy to create search forms with many find options.

jeremyevans / sequel

Sequel: The Database Toolkit for Ruby

Monkeypatching For Humans
…In those languages, you could redefine everything in the String class if you wanted to. This is commonly known in dynamic language circles as monkeypatching.

Como instalar Ruby en Ubuntu Linux

Como instalar Ruby en Mac OS X

Ruby performance showdown

rchatley / extreme_startup
This software supports a workshop where teams can compete to build a software product that satisfies market demand.

eventmachine / eventmachine

EventMachine: fast, simple event-processing library for Ruby programs

Musings On Software Community
While attending Oredev 2011, I had an interesting conversation with Corey Haines about his perception of the Ruby community as compared to the .NET community.

Enums in Ruby

Ruby clouds: Engine Yard vs. Heroku

RubyConf Argentina and Fenix
My talk was titled Tirando Ruby por la Ventana, which translates to Throwing Ruby through the Window
The talk was aimed at highlight a few issues with Ruby on Windows, ranging from the community to the implementation.
by @luislavena

My Links

Keep tuned!

Angel “Java” Lopez

AjTalk in Javascript (1) First implementations

Some days ago, I moved my AjTalk project from Google Code to GitHub:

Last year, I added the compilation of Smalltalk fileouts to Javascript, into that project. Past Sunday, I created a new project at:

as code kata for another approach: implementing an AjTalk virtual machine, from scratch, in JavaScript. The idea is to compile Smalltalk code to methods in bytecodes, and to have an interpreter for those methods. The code is at´

In that implementation, I’m using a sendMessage method and a custom lookup for methods. Excerpt (lib/ajtalk.js):

BaseObject.prototype.sendMessage = function(selector, args)
    var method = this.lookup(selector);
    return method.apply(this, args);

function BaseClass(name, instvarnames, clsvarnames, supercls) { = name;
    this.instvarnames = instvarnames;
    this.clsvarnames = clsvarnames;
    this.supercls = supercls;
    this.methods = {};

BaseClass.prototype.__proto__ = BaseObject.prototype;

BaseClass.prototype.defineMethod = function (selector, method)
    this.methods[selector] = method;

BaseClass.prototype.getInstanceSize = function() {
    var result = this.instvarnames.length;
    if (this.supercls)
        result += this.supercls.getInstanceSize();

    return result;

BaseClass.prototype.lookupInstanceMethod = function (selector)
    var result = this.methods[selector];
    if (result == null && this.supercls)
        return this.supercls.lookupInstanceMethod(selector);
    return result;

At Monday, I had new ideas for implementing the virtual maching. I could use the prototype features of Javascript. Then, I wrote some new code (lib/ajtalknew.js):

function createClass(name, superklass, instvarnames, clsvarnames)
    var protoklass = new Function();

    if (superklass)
        // Chain class prototypes
        protoklass.prototype.__proto__ = superklass.proto;
        // First class methods
        protoklass.prototype.basicNew = function()
            var obj = new this.func;
            obj.klass = this;
            return obj;

        protoklass.prototype.defineSubclass = function(name, instvarnames, clsvarnames)
            return createClass(name, this, instvarnames, clsvarnames);

        protoklass.prototype.defineMethod = function(name, method)
            var mthname = name.replace(/:/g, '_');
            if (typeof method == "function")
                this.func.prototype[mthname] = method;
                this.func.prototype[mthname] = method.toFunction();

        protoklass.prototype.defineClassMethod = function(name, method)
            var mthname = name.replace(/:/g, '_');
            if (typeof method == "function")
                this.proto[mthname] = method;
                this.proto[mthname] = method.toFunction();

        // TODO Quick hack. It should inherits from Object prototype
        protoklass.prototype.sendMessage = function(selector, args)
            return this[selector].apply(this, args);

    var klass = new protoklass;

    // Function with prototype of this klass instances
    klass.func = new Function();
    klass.proto = protoklass.prototype; = name;
    klass.super = superklass;
    klass.instvarnames = instvarnames;
    klass.clsvarnames = clsvarnames;

    klass.func.prototype.klass = klass;

    if (superklass)
        // Chaining instances prototypes
        klass.func.prototype.__proto__ = superklass.func.prototype;
        // First instance methods
        klass.func.prototype.sendMessage = function(selector, args)
            return this[selector].apply(this, args);

    Smalltalk[name] = klass;

    return klass;


Smalltalk.Object.defineClassMethod('compileMethod:', function(text)
        var compiler = new Compiler();
        var method = compiler.compileMethod(text, this);
        this.defineMethod(, method);
        return method;

Smalltalk.Object.defineClassMethod('compileClassMethod:', function(text)
        var compiler = new Compiler();
        var method = compiler.compileMethod(text, this);
        this.defineClassMethod(, method);
        return method;

Ok, it’s a bit tricky, but it works!

Notably, I wrote test using Node builtin assert module (I had no Internet connection, and had no NodeUnit in my machine). The code was nurtured using TDD and it was a good experience for me.

I have a javascript Compiler function/”class” that I can use to compile Smalltalk code to my bytecode version. Only a few bytecodes are implemented:

var ByteCodes = {
    GetValue: 0,
    GetArgument: 1,
    GetLocal: 2,
    GetInstanceVariable: 3,
    GetGlobalVariable: 4,
    GetSelf: 5,
    SetLocal: 10,
    SetInstanceVariable: 11,
    SetGlobalVariable: 12,
    Add: 20,
    Subtract: 21,
    Multiply: 22,
    Divide: 23,
    SendMessage: 40,
    Return: 50

Pending work: implement class variables, metaclasses, with TDD. Improve hmtl samples

Keep tuned!

Angel “Java” Lopez

Clojure: Links, News And Resources (5)

Previous Post
Next Post

Clojure/core — (take 5 william-byrd)
William Byrd is a postdoc at Indiana University researching the applicability of declarative programming techniques to high-performance computing domains. In addition, he is one of the three authors of the fantastic book The Reasoned Schemer that walks the reader through the development of a small …

pallet/zi – GitHub
Zi is a maven plugin for clojure.

mmikulicic / clarsec
Parsec monadic parser ported to clojure

youngnh / parsatron
Clojure parser combinators

Clojure vs Scala · Compare programming languages · Programming Languages
The absolute rankings are interesting for large scale comparisons but when you want to know about two specific languages it’s much more informative to look at how the two fare when they go directly head to head.

Reflections on a real-world Clojure application (take 2)
Last night I gave a talk at the London Clojure Users Group (LCUG) about a ‘real-world’ (16K lines-of-code) application we built in less than a year with Clojure at Deutsche Bank.

Doing Things ←
So far, we’ve looked at the sequence monad and the set monad. Hopefully by now you’ve gotten a feel for how m-result and m-bind work for those two examples.

Clojure demo web application using Ring, Compojure, MongoDB and Fusion Charts.
A demo web application using Clojure, Ring, Compojure, MongoDB, Fusion Charts.

The RedMonk Programming Language Rankings: February 2012 – tecosystems
For years now, it has been self-evident to us at RedMonk that programming language usage and adoption has been fragmenting at an accelerating rate

Using dynamic programming to calculate Stirling numbers

IT Software Community – John W. Verity – LISP Is Back, and It’s Baaaaad!

Gelfino is a tiny embeddable Gelf server written in pure Clojure, Gelfino enables real time processing of log events through streams.

(, Clojure Robot DSL

Sets Not Lists ←

Functional Relational Programming with Cascalog

Stuart Sierra: “Learning Clojure – Next Steps” | Clojure on Blip
You can conj and assoc like a pro. You eat macros for breakfast.What’s next?

The Pragmatic Bookshelf | PragPub 2011-08 | Hello, ClojureScript!
Clojure rocks, JavaScript reaches. ClojureScript is the realized inevitability of Clojure’s expansion to other platforms.It seems these days you can’t write a web-based application without reaching for JavaScript.

David McNeil: “Concurrent Stream Processing” | Clojure on Blip
The foundation of our query processing engine is a concurrent data stream processor. This processor is characterized by the need to efficiently perform parallel, non-blocking processing of multiple data streams which are too large to fit in memory.

InfoQ: One () to Rule them All
Aaron Bedra introduces Clojure and details how ClojureScript – a Clojure subset compiled to JavaScript – helps with web development.

Clojure/core — First Conj 2011 Videos Available
Five videos from Clojure Conj 2011 are now available.

Home // Overtone
Overtone is an open source audio environment being created to explore musical ideas from synthesis and sampling to instrument building, live-coding and collaborative jamming. We use the SuperCollider synth server as the audio engine, with Clojure being used to develop the APIs and the application. …

On Beyond Lambda: Clojure is one answer
A travel log of a .NET developer as he explores Clojure and F#, and looks for ways to apply C# to a multi-core world.A travel log of a .NET developer as he explores Clojure and F#, and looks for ways to apply C# to a multi-core world.

richard-lyman/amotoen – GitHub
Amotoen is a Clojure library that supports PEG style definitions of grammars that can produce parsers

Clojure for Ruby Programmers – Stuart Halloway – Ruby Conference 2009

My Links

Keep tuned!

Angel “Java” Lopez

Erlang: Links, News And Resources (2)

Previous Link
Next Link

Learning Erlang
Last week I decided to learn Erlang, a functional programming language developed by Ericsson in 1987 for use in telecommunications environments. It’s probably the strangest non-toy programming language I’ve ever tried to learn…

Long rant on Erlang-style Actors: Lost Dimension | Lambda the Ultimate
This post is follow up to my previous post about programming languages. If we apply the conceptual framework that was discussed in the post we will see that modern event-driven programs designed in OO paradigm (but not necessary in OO-language) has the following dimensions of analysis and …

Erlang Web
The Erlang Web is an open source framework for applications based on HTTP protocols, giving the developer better control of content management. With Erlang Web’s simple but extensible concept of including dynamic content in pages, libraries of reusable components can be built. Currently it supports …


Erlang Solutions – Your Scalability Architects

Erlide – the Erlang IDE. Powered by Eclipse.
We are proud to announce the latest version that is 0.13.9 and offers the following features:For those that have been using our unstable releases, there are only few new things…

ejabberd Community Site | the Erlang Jabber/XMPP daemon
ejabberd 2.1.9, ejabberd 3.0.0-alpha-4, and exmpp 0.9.8 have been released, after several months of development. They contain a lot of bugfixes, improvements and some new features.This release includes a lot of bugfixes and improvements.

Erlang Factory

YOW! 2011: Steve Vinoski – Riak Core, Erlang and Frisbee Freestyle

josevalim/elixir – GitHub
Elixir is a programming language built on top of Erlang. As Erlang, it is a functional language with strict evaluation and dynamic typing built to support distributed, fault-tolerant, non-stop applications with hot swapping.

LFE – Lisp Flavoured Erlang
This is LFE, Lisp Flavoured Erlang, which is a lisp syntax front-end to the Erlang compiler. Code produced with it is compatible with “normal” Erlang code. Most things seem to work but some things have not been done yet..

Erlang Programming for Multicore

The cutting edge of VM design

The Trouble with Erlang (or Erlang is a ghetto)

The Trouble with Erlang

Reia is a Ruby-like scripting language for the Erlang virtual machine.

Erlang actors – some newbie thoughts/doubts.

ferd / erlang-history
Hacks to add shell history to Erlang’s shell

Erlang, the big switch in social games

Dart: An Erlanger’s Reflections

Functional Programming Doesn’t Work (and what to do about it)

Mike Williams on the History of Erlang, Modeling and Large Scale Design
Mike Williams, co-creator of Erlang discusses the history of and influences on Erlang as well as languages and paradigms used at Ericsson for large scale development and embedded programming.

One million!
We usually don’t use this blog to talk about the technology stack behind WhatsApp, but today we wanted to share with you an awesome milestone we have reached…
…For those curious how we did it, the technology on the backend is simple: FreeBSD + Erlang

Let It Crash … Except When You Shouldn’t
Steve Vinoski explains how to avoid some of the Erlang errors that can bring down a system starting from the premise that not all the crashes are welcome as the “Let It Crash” philosophy might suggest.

Simon Thompson and Huiquing Li on Refactoring in Functional Languages Like Haskell or Erlang
Simon Thompson and Huiqing Li explain refactoring with functional languages and Wrangler (Erlang) and HaRe (Haskell). Also: how Wrangler’s ad-hoc mode allows everyone to write custom refactorings.

Functional Programming at
▪ Chat backend (channel servers)
▪ Chat Jabber interface (ejabberd)
▪ AIM presence: a JSONP validato
Minimum viable Erlang web framework

Contrasting Performance : Languages, Styles and VMs – Java, Scala, Python, Comments: True Erlang, Clojure, Ruby, Groovy, Javascript

My Links

More links about Erlang, functional programming, and programming languages, are coming.

Keep tuned!

Angel “Java” Lopez

Acquarella Syntax Highlighter

Past weekend, I was coding a simple and configurable syntax highlighter, in C#, named Acquarella. You can see the result at:

The current solution has a class library project, a console program and a test project:

The idea is to have a library you can reference and use from your projects, in case you need some syntax highlighting functionality. The library takes a text (an string) and, giving the source code language and style name, transform it to another text, using configuration files. There is a more detailes information at project

Dog fooding, the Token.cs class transformed by Acquarella:

namespace Acquarella.Lexers
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class Token
        private string text;
        private int start;
        private int length;
        private TokenType type;

        public Token(TokenType type, string text, int start, int length)
            this.type = type;
            this.text = text;
            this.start = start;
            this.length = length;

        public string Value
                return this.text.Substring(this.start, this.length);

        public TokenType Type { get { return this.type; } }

        public int Start { get { return this.start; } }

        public int Length { get { return this.length; } }

Nice 🙂

Pending work: Recognize comments, more styles (maybe using css files), more language configurations, extending Lexer (maybe RubyLexer, CSharpLexer, etc.)

Keep tuned!

Angel “Java” Lopez