Angel \”Java\” Lopez on Blog

September 17, 2015

Elixir: Links And Resources (2)

Filed under: Elixir, Erlang, Functional Programming, Links, Programming Languages — ajlopez @ 11:16 am

Previous Post

The Erlangelist: Beyond Task.async

Daniel Berkompas – Changing Your Ecto Encryption Key

“Ephemeral P2P” Project — Medium

Michal Muskala – Coding, thoughts, and ideas

Elixir configs

Elixir for the Functional Rubyist | Indiegogo

The Erlangelist: Outside Elixir: running external programs with ports

P2P WebRTC file sharing app: Broker using Phoenix

Elixir in Action Review and Q&A with the Author

Phoenix 1.0 – the framework for the modern web just landed · Phoenix

Email notifications about errors in Elixir

Using Dilayzer with Elixir Integration Tests – Learning Elixir

Core Elixir: List.delete_at/2 – Various and Sundry CS

Using Recursion In Elixir To Break Your OO Brain – Rob Conery

The Erlangelist

Elixir, Docker and PG2

My Links

Stay tuned!

Angel “Java” Lopez

September 16, 2015

Elixir: Links and Resources (1)

Filed under: Programming Languages, Functional Programming, Links, Erlang, Elixir — ajlopez @ 11:03 am

Next Post

Programming in Elixir with the Phoenix Framework – Building a basic CRUD app · Garrett Heinlen

Introduction – Elixir

Elixir Documentation – Elixir

The Languages And Frameworks That You Should Learn In 2015 | wwwDesigned


The Polyglot in the Code – An Elixir/Ruby Mashup – Johnny Winn – YouTube

Elixir is for programmers


Lost in a World of Data | Virtuous Code

Elixir: Modern Programming for the Erlang VM


Writing RabbitMQ Plugins With Elixir

A Week with Elixir

Elixir – A modern approach to programming for the Erlang VM on Vimeo

Erlang: Is Elixir ( production ready? – Quora


My Links

Stay tuned!

Angel “Java” Lopez

June 22, 2015

Erlang: Links, News And Resources (14)

Filed under: Programming Languages, Functional Programming, Links, Erlang — ajlopez @ 9:28 am

Previous Post

Leapsight Semantic Dataspace – for High Resolution Customer Engagament Marketing | Erlang Solutions

Webinars | Erlang Solutions

London Erlang User Group: Data and logic on acid: Introducing Leapsight Semantic Dataspace (LSD) | Erlang Solutions

Erlang: The Unintentional Neural Network Programming Language

Announcing gerl: Genetic Programming in Erlang

A Generalized Parallel Genetic Algorithm in Erlang


A genetic algorithm example in Erlang. | Dream Child

Programming in Elixir with the Phoenix Framework – Building a basic CRUD app · Garrett Heinlen

Introduction – Elixir

Elixir Documentation – Elixir

BEAM File Format

Hitchhiker’s Tour of the BEAM

Joe Armstrong

Erlang Factory SF Bay Area 2015

Reactive Cloud Actors: An Evolvable Web of Events

gut is a template printing, aka scaffolding, tool for Erlang. Like rails generate or yeoman

FiaR @ ErlangBA Meetup by Inaka Labs on Prezi

Tiny Actor Run-Time in JavaScript

My Links

Stay tuned!

Angel “Java” Lopez

June 19, 2015

Erlang: Links, News And Resources (13)

Filed under: Programming Languages, Functional Programming, Links, Erlang — ajlopez @ 10:27 am

Previous Post
Next Post

[erlang-questions] Why do we need modules at all?

How I Start.


Erjang – inside Erlang on the JVM // Speaker Deck

Erjang – A JVM-based Erlang VM

integration – Java to Erlang messages – Stack Overflow

Erlang — The Jinterface Package

Erjang, Why? – Java to the Limit


Prettt-tty, pretty, pretty good!: Actors are not a good concurrency model

5 Programming Languages You’ll Need Next Year (and Beyond) – Dice News

My Links

Stay tuned!

Angel “Java” Lopez

December 10, 2014

SimpleLisp (2) Compiling Lisp Values and Variables to JavaScript

Previos Post

Let’s review the project’s implementation

the Lisp compiler to JavaScript, written in JavaScript, following the workflow of TDD (Test-Driven Development). All is “work in progress”, so today I will explain part of the implementation but it could be change in the future, when new use cases were added, and new ways of doing things were implemented.

I took the decision that each Lisp symbol is a JavaScript variable. So, the compilation of a symbol is:

exports['compile symbol'] = function (test) {
    test.equal(sl.compile('a'), 'a');

The sl is the SimpleLisp module, loaded in this test file (test/compile.js)

An integer and an string are compiled to natural values in JavaScript:

exports['compile integer'] = function (test) {
    test.equal(sl.compile('42'), '42');

exports['compile string'] = function (test) {
    test.equal(sl.compile('"foo"'), '"foo"');

It’s quoted values, too:

exports['compile quoted integer'] = function (test) {
    test.equal(sl.compile("'42"), '42');

exports['compile quoted string'] = function (test) {
    test.equal(sl.compile("'\"foo\""), '"foo"');

I decided to compile Lisp nil to JavaScript null. The boolean values are the same:

exports['compile nil'] = function (test) {
    test.equal(sl.compile('nil'), 'null');

exports['compile booleans'] = function (test) {
    test.strictEqual(sl.compile('false'), 'false');
    test.strictEqual(sl.compile('true'), 'true');

But, what happens if an expression serie is compiled? I build an anonymous function, invoked without arguments, and the last expression value is returned:

exports['compile two symbols'] = function (test) {
    test.equal(sl.compile('a b'), '(function () { a; return b; })()');

Next topics: compilation of a Lisp lisp, and more quoted values, macros, ect.

Stay tuned!

Angel “Java” Lopez

November 25, 2014

SimpleLisp (1) Compiling Lisp to JavaScript

Next Post

I implemented Lisp as interpreter, using C#, Java, and JavaScript. See:

The implementation of a Lisp is a good programming exercise. Lisp is a simple and powerful language, with functions as first class citizens. And with the “twist” of implementing functions that don’t evaluate their arguments, and macros.

This time, I want to implement a Lisp, but as a compiler. I started to write a Lisp compiler in JavaScript, that generates JavaScript. The project:

As usual, I worked using the Test-Driven Development workflow. With simple use cases, I implemented the needed features. This is my first Lisp compiler, so I’m trying new implementation approaches. I know Clojure, as a basis for a Lisp compiler. I should implement:

Symbols: identifiers witn name and associated value. Now, I’m compiling them to JavaScript variables. In SimpleLisp, a symbol can be defined at top, in a let block, or as a function argument. Then, I produce a top variable (or a least, a module variable), or a local variable in let, or an argument in function.

Functions: I’m translating a normal function in Lisp to a normal function in JavaScript. The main difference is that Lisp functions returns a value, there are no commands, all are expression, as in Ruby. A list in SimpleLisp is then compiled to a function call in JavaScript.

Special Forms: Their implementation is a novelty to me. In a compiler, I could generate directly the final code for each list with a head that is an special form. So, I’m compiling directly to JavaScript any list with head if, do, let, etc… . A list (if ….) is compiled to a JavaScript if, but returning a value.

Macros: In a compiler, I could adopt a new implementation: to expand the macro at COMPILING TIME. I’m not sure yet if I can take this approach in every case. Notably, in Clojure a macro is not a functional value: a macro cannot be passed as an argument. A macro make sense only at compiling time.

A final use case: write a web site using Node.js/Express in SimpleLisp.

Stay tuned!

Angel “Java” Lopez

November 11, 2014

SimpleScript (2) The Lexer

Previous Post
Next Post

These days, I was working improving my SimpleScript compiler to JavaScript. Today, I want to comment the implementation of the lexer, the repo is

Now, the lexer code resides in a dedicated file lib/lexer.js, that expose a module, that can be consumed from Node.js and from the browser. It starts defining the token types:

var lexer = (function () {
    var TokenType = { 
        Name: 1, 
        Integer: 2, 
        Real: 3, 
        String: 4, 
        NewLine: 5, 
        Separator: 6, 
        Assignment: 7 };

Then, it defines some operatores, delimiters, and the Token, with two elements, type and value.

var separators = ".,()[]";
var assignments = ["=", "+=", "-=", "*=", "/="];
var operators = ["+", "-", "*", "/", "==", "!=", "<", ">", "<=", ">="];

function Token(value, type) {
    this.value = value;
    this.type = type;

The main job is in the Lexer “class”, with the method nextToken:

function Lexer(text) {
    var length = text ? text.length : 0;
    var position = 0;
    var next = [];

    this.nextToken = function () {
        if (next.length > 0)
            return next.pop();


        var ch = nextChar();

        if (ch === null)
            return null;

        if (ch === '"' || ch === "'")
            return nextString(ch);

        if (ch === '\n')
            return new Token(ch, TokenType.NewLine);

        if (ch === '\r') {
            var ch2 = nextChar();

            if (ch2 === '\n')
                return new Token(ch + ch2, TokenType.NewLine);

            if (ch2)

            return new Token(ch, TokenType.NewLine);

        if (isAssignment(ch))
            return new Token(ch, TokenType.Assignment);

        if (isOperator(ch))
            return nextOperator(ch);

        if (isSeparator(ch))
            return new Token(ch, TokenType.Separator);

        if (isFirstCharOfName(ch))
            return nextName(ch);

        if (isDigit(ch))
            return nextInteger(ch);

Finally, the module expose a lexer factory and the enumeration of token types:

return {
    lexer: function (text) { return new Lexer(text); },
    TokenType: TokenType

The code was developed using Test-Driven Development workflow. There is a file test/lexer.js, fragment:

function getToken(text, value, type, test) {
    var lexer = sslexer.lexer(text);
    var token = lexer.nextToken();
    test.equal(token.value, value);
    test.equal(token.type, type);
    test.equal(lexer.nextToken(), null);

exports['Get names'] = function (test) {
    getToken('foo', 'foo', TokenType.Name, test);
    getToken('foo123', 'foo123', TokenType.Name, test);
    getToken('foo_123', 'foo_123', TokenType.Name, test);
    getToken('_foo', '_foo', TokenType.Name, test);

exports['Get integer'] = function (test) {
    getToken('123', '123', TokenType.Integer, test);
    getToken('1234567890', '1234567890', TokenType.Integer, test);

Remember: no TDD, no paradise ;-)

Next topics: the parser, commands and expressions implementations, compilation to JavaScript.

Stay tuned!

Angel “Java” Lopez

October 31, 2014

Smalltalk: Links, News And Resources (20)

Filed under: Links, Programming Languages, Smalltalk — ajlopez @ 6:42 pm

Previous Post

Objective-Smalltalk talk at FOSDEM 2014 – YouTube

Alan Kay On Messaging

Pharo Smalltalk – YouTube

pathToolsFramework – Squeak Community Projects

Pharo4 Plans and Dreams – YouTube

39 – Leandro Caniglia – self ideas asStream next – YouTube

20 – Nicolas Petton – Amber Smalltalk – YouTube

32 – Hernan Wilkinson – Web Development In Smalltalk For Newbies – YouTube

15 – Dale Henrichs – tODE: And Now For Something Completely Different – YouTube

Smalltalk reddit

Where Smalltalk Went Wrong 2

Where Smalltalk Went Wrong

Saying Goodbye To Python

Interview with Esteban Lorenzano

The goal of RMoD is to support remodularization of object-oriented applications. This objective is tackled from two complementary perspectives: reengineering and modularity constructs for programming languages.

PhaROS – FOSDEM 2014 – Slides

My Links

Stay tuned!

Angel “Java” Lopez

August 19, 2014

Smalltalk: Links, News And Resources (19)

Filed under: Links, Programming Languages, Smalltalk — ajlopez @ 3:33 pm

Previous Post
Next Post

ESUG: 2014

Pharo Open Source Smalltalk — News


Philippe Back Interviews Nicolas Petton on Amber Smalltalk by philippeback on SoundCloud – Hear the world’s sounds


smallworks: Why I’m using git in my Pharo projects

Dyla’14 at PLDI, Edinburgh, UK


Self Mallard (4.5.0) released | Self

Self | Fun through simplicity

stic13 – YouTube

(349) Programming Languages: Why create any more programming languages? – Quora

Anyone interested in smalltalk? : learnprogramming

ST 4U 510: Dynamic Code Generation in Pharo

Was Alan Kay wrong? And why does that matter?

Smalltalk on Raspberry Pi | a blog on Smalltalk on the Raspberry Pi

My Links

Stay tuned!

Angel “Java” Lopez

July 27, 2014

AjTalk Implementing Smalltalk In C# (4) The Project

Filed under: .NET, AjTalk, C Sharp, Programming Languages, Smalltalk — ajlopez @ 5:48 pm

Previous Post

Year and a half since I didn’t write about this project in C #, but I was working on it, and the parallel implementation I have in JavaScript (in fact, I introduced some concepts of both the Smalltalks 2013 conference, Rosario, Argentina).

The project is at:

Current structure:

The projects are:

AjTalk: class library, with a compiler to bytecodes implementation. There is a compiler to JavaScript too. There is an interpreter of those bytecodes.

AjTalk.Compiler: a console project that uses the compiler to JavaScript.

AjTalk.Console: a simple REPL (Read Eval Print Loop)

AjTalk.Gui: a work-in-progress example using windows

AjTalk.Tests: the test I wrote, followin TDD (Test-Driven Development) flow.

I guess now I don’t need the compiler to JavaScript, because I have a native JavaScript implementation at:

It can compile to bytecodes or to JavaScript. The project is written in JavaScript.

The window implementation is very primitive. I plan to replace it for direct AjTalk program using .NET types and object.

One point that I find very interesting (in both projects, C # and JavaScript) is to have a modular implementation: instead of loading an image yet defined, my plan is to define modules to load, as happens in the Node.js environment . The modules would be published in the NPM (Node Package Manager’s), and each could indicate which modules need in your program instead of lifting all Smalltalk.

Another topic in this C # project I have implemented that can run more than one AjTalk machine at the same time. And I can even make a machine “help” to the other. For example, if the machine does not have to compile methods to new methods, machine B can go to his aid. Thus, A machine (and his image, I’m already recording binary image) can be kept small.

Another feature that I have implemented: the ability to send a message to an object, without waiting for a response, a “fire and forget”. And that the target object can attend ONE OF those messages as models of actors.

I have to review the implementation of remote objects (now based on the old Remoting. NET). But I think it is an important feature to maintain and explore.

Well, you see, many issues remain for other posts, such as implementation details Smalltalk concepts such as Object, Class, ClassDescription, Behavior, MetaClass, etc..

Nos leemos!

Angel “Java” Lopez

Older Posts »

The Shocking Blue Green Theme. Blog at


Get every new post delivered to your Inbox.

Join 70 other followers