Angel \”Java\” Lopez on Blog

June 22, 2015

Erlang: Links, News And Resources (14)

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

Previous Post

Leapsight Semantic Dataspace – for High Resolution Customer Engagament Marketing | Erlang Solutions
https://www.erlang-solutions.com/resources/webinars/leapsight-semantic-dataspace-high-resolution-customer-engagament-marketing

Webinars | Erlang Solutions
https://www.erlang-solutions.com/resources/webinars

London Erlang User Group: Data and logic on acid: Introducing Leapsight Semantic Dataspace (LSD) | Erlang Solutions
https://www.erlang-solutions.com/event/london-erlang-user-group-data-and-logic-acid-introducing-leapsight-semantic-dataspace-lsd

Erlang: The Unintentional Neural Network Programming Language
http://www.erlang-factory.com/upload/presentations/384/GeneSher.pdf

Announcing gerl: Genetic Programming in Erlang
http://dan.bravender.net/2007/9/27/Announcing_gerl%3A_Genetic_Programming_in_Erlang.html

A Generalized Parallel Genetic Algorithm in Erlang
http://personal.denison.edu/~lalla/MCURCSM2011/6.pdf

mlen/genetic
https://github.com/mlen/genetic

A genetic algorithm example in Erlang. | Dream Child
https://atrueswordsman.wordpress.com/2010/12/14/a-genetic-algorithm-example-in-erlang/

Programming in Elixir with the Phoenix Framework – Building a basic CRUD app · Garrett Heinlen
http://gogogarrett.sexy/programming-in-elixir-with-the-phoenix-framework-building-a-basic-CRUD-app/

Introduction – Elixir
http://elixir-lang.org/getting-started/introduction.html

Elixir Documentation – Elixir
http://elixir-lang.org/docs.html

BEAM File Format
https://synrc.com/publications/cat/Functional%20Languages/Erlang/BEAM.pdf

Hitchhiker’s Tour of the BEAM
http://www.erlang-factory.com/upload/presentations/708/HitchhikersTouroftheBEAM.pdf

Joe Armstrong
http://joearms.github.io/

Erlang Factory SF Bay Area 2015
http://www.erlang-factory.com/sfbay2015#home

Reactive Cloud Actors: An Evolvable Web of Events
http://www.infoq.com/articles/reactive-cloud-actors

unbalancedparentheses/gut
https://github.com/unbalancedparentheses/gut
gut is a template printing, aka scaffolding, tool for Erlang. Like rails generate or yeoman

FiaR @ ErlangBA Meetup by Inaka Labs on Prezi
https://prezi.com/o0_apxvgf3py/fiar-erlangba-meetup/

organix/tartjs
https://github.com/organix/tartjs
Tiny Actor Run-Time in JavaScript

My Links
http://delicious.com/ajlopez/erlang

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

June 19, 2015

Erlang: Links, News And Resources (13)

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

Previous Post
Next Post

[erlang-questions] Why do we need modules at all?
http://erlang.org/pipermail/erlang-questions/2011-May/058768.html

How I Start.
http://howistart.org/posts/erlang/1

edgurgel/poxa
https://github.com/edgurgel/poxa

Erjang – inside Erlang on the JVM // Speaker Deck
https://speakerdeck.com/krestenkrab/erjang-inside-erlang-on-the-jvm

Erjang – A JVM-based Erlang VM
http://www.infoq.com/presentations/Erjang-A-JVM-based-Erlang-VM

integration – Java to Erlang messages – Stack Overflow
http://stackoverflow.com/questions/4132554/java-to-erlang-messages

Erlang — The Jinterface Package
http://www.erlang.org/doc/apps/jinterface/jinterface_users_guide.html

Erjang, Why? – Java to the Limit
http://www.javalimit.com/2009/12/erjang-why.html

josephmisiti/awesome-machine-learning
https://github.com/josephmisiti/awesome-machine-learning

https://www.sics.se/~joe/thesis/armstrong_thesis_2003.pdf
https://www.sics.se/~joe/thesis/armstrong_thesis_2003.pdf

Prettt-tty, pretty, pretty good!: Actors are not a good concurrency model
http://pchiusano.blogspot.com.ar/2010/01/actors-are-not-good-concurrency-model.html

5 Programming Languages You’ll Need Next Year (and Beyond) – Dice News
http://news.dice.com/2014/07/29/5-programming-languages-youll-need-next-year-beyond/

My Links
http://delicious.com/ajlopez/erlang

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

May 19, 2015

AjErl Implementing Erlang in C# (2) Expressions

Filed under: .NET, C Sharp, Open Source Projects, Erlang, AjErl — ajlopez @ 9:58 am

Previous Post

Some time ago I write this project, an Erlang implementation as interpreter using C #. Let review today the implementation of expressions. An expression is evaluated in a context. For example, the variable X, is an expression that is evaluated in a context that tells how that variable is bound to a value or it is free.

All expressions are written using the workflow TDD (Test-Driven Development). After some expressions, this interface emerge in a refactor, and now all expressions implement it:

public interface IExpression
{
    object Evaluate(Context context, bool withvars = false);

    bool HasVariable();
}

The key method is Evaluate. It can allow or not that some variables are still unbound after the evaluate. There is a boolean method HasVariable that indicates the existence of variables in the expression. The simplest expression is a constant expression:

public class ConstantExpression : IExpression
{
    private object value;

    public ConstantExpression(object value)
    {
        this.value = value;
    }

    public object Value { get { return this.value; } }

    public object Evaluate(Context context, bool withvars = false)
    {
        return this.value;
    }

    public bool HasVariable()
    {
        return false;
    }
}

The Evaluate method does not use the provided context, it is only returning the original constant value, defined in the constructor. The expressions are grouped in a tree of expressions that is recursively evaluated.

An expression that evaluates a variable:

public class VariableExpression : IExpression
{
    private Variable variable;

    public VariableExpression(Variable variable)
    {
        this.variable = variable;
    }

    public Variable Variable { get { return this.variable; } }

    public object Evaluate(Context context, bool withvars = false)
    {
        if (!context.HasValue(this.variable.Name))
            if (!withvars)
                throw new Exception(string.Format("variable '{0}' is unbound", this.variable.Name));
            else
                return this.variable;

        return context.GetValue(this.variable.Name);
    }

    public bool HasVariable()
    {
        return true;
    }
}

This time, the context is used. If the variable is not bound to a value, it can return the unbound value, or raise an exception, depending on a boolean withValues. Some times, Erlang expects and needs that an expression be complete evaluated, having no unbound variables.

This code was implemented following the workflow of TDD. Some tests as examples (but it is only the final result, the important thing is the workflow, the dynamic of the programming activity). For a constant expression:

[TestMethod]
public void CreateSimpleConstantExpression()
{
    ConstantExpression expr = new ConstantExpression(10);

    Assert.AreEqual(10, expr.Value);
}

[TestMethod]
public void EvaluateSimpleConstantExpression()
{
    ConstantExpression expr = new ConstantExpression(10);

    Assert.AreEqual(10, expr.Evaluate(null));
}

For a variable expression:

[TestMethod]
public void CreateSimpleVariableExpression()
{
    Variable variable = new Variable("X");
    VariableExpression expression = new VariableExpression(variable);

    Assert.AreEqual(variable, expression.Variable);
}

[TestMethod]
public void EvaluateVariableExpression()
{
    Variable variable = new Variable("X");
    Context context = new Context();
    context.SetValue("X", 1);
    VariableExpression expression = new VariableExpression(variable);

    Assert.AreEqual(1, expression.Evaluate(context));
}

[TestMethod]
public void EvaluateUndefinedVariableExpression()
{
    Variable variable = new Variable("X");
    Context context = new Context();
    VariableExpression expression = new VariableExpression(variable);

    Assert.AreEqual(variable, expression.Evaluate(context, true));
}

[TestMethod]
public void RaiseIfEvaluateUndefinedVariableExpression()
{
    Variable variable = new Variable("X");
    Context context = new Context();
    VariableExpression expression = new VariableExpression(variable);

    try
    {
        expression.Evaluate(context, false);
        Assert.Fail();
    }
    catch (Exception ex)
    {
        Assert.AreEqual("variable 'X' is unbound", ex.Message);
    }
}

Upcoming topics: explore other expression implementations, data structure implementations for variables, maps, and more…

Stay tuned!

Angel “Java” Lopez

http://www.ajlopez.com

http://twitter.com/ajlopez

July 20, 2014

AjErl Implementing Erlang in C# (1) The Project

Filed under: .NET, AjErl, C Sharp, Erlang, Functional Programming, Open Source Projects — ajlopez @ 10:49 am

Next Post

Some time ago, to practice TDD and C # and explore ideas Erlang, I started an Erlang-like interpreter in C#:

https://github.com/ajlopez/AjErl

The solution structure:

It has the core class library, draft tests, project and I am putting together a REPL (Read Eval Print Loop) as console program. The interesting thing is that Erlang internally has lightweight processes, implemented in the virtual machine itself, which can communicate with each other by sending and receiving immutable messages. I do not intend to implement a virtual machine of this type, but have processes in threads. They will never be as fast as Erlang, but it’s a first “baby step” to explore, before trying to improve implementation.

Messages can be sent to a queue per process (thread here), and I have implemented the acceptance of messages, and turn his rejection process, as in native Erlang.

But today I wanted to briefly discuss how to implement transforms input text into Erlang expressions and forms:

:

The Lexer returns tokens, and these tokens have a value and a type. It can already recognize an atom (a name that begins in lower case), a variable, delimiters, operators, integers and real numbers, strings. The Lexer is consumed by a Parser, which has two public methods: one that parses expressions, used from the REPL, and another that parses what Erlang is called a form, would like a function definition in a module of Erlang. There are also ways to declare the name of the module, or other forms exported with name and number of arguments. In these modules will not accept expressions, only statements such form.

If you look at the history of commits, you will see that not everything went ahead, but grew slowly, as small raised me to implement use cases.

Upcoming topics: discuss the implementation of expressions, forms, processes and threads with mailbox for messages, and the REPL. And keep working on the implementation of messages and distributed processes.

Nos leemos!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

July 11, 2014

Erlang: Links, News And Resources (12)

Filed under: Distributed Computing, Erlang, Functional Programming, Links — ajlopez @ 8:26 pm

Previous Post

AKKA 5 Year Anniversary
http://typesafe.com/akka-five-year-anniversary

erlang-laboratory – Erlang Laboratory — Erlang development in Windows as simple as 1, 2, 3 – Google Project Hosting
https://code.google.com/p/erlang-laboratory/

Michael Feathers – Microservices and the Failure of Encapsulation
https://michaelfeathers.silvrback.com/microservices-and-the-failure-of-encapsulaton

(390) Python (programming language): With the increase of the processors speeds, will high level languages (like python) take over low level languages (like C/C ) since difference in execution speed will not differ that much? – Quora
http://www.quora.com/Python-programming-language-1/With-the-increase-of-the-processors-speeds-will-high-level-languages-like-python-take-over-low-level-languages-like-C-C++-since-difference-in-execution-speed-will-not-differ-that-much

Damien Katz: What Sucks About Erlang
http://damienkatz.net/2008/03/what_sucks_abou.html

pyotrgalois/erlskeletor
https://github.com/pyotrgalois/erlskeletor

Why Erlang Is Awesome
http://veldstra.org/whyerlang/

Erlang Integers | Programmer’s Paradox
http://www.programmersparadox.com/2008/02/05/erlang-integers/

Handling very large integers in Erlang | Teton Technical
http://tetontech.wordpress.com/2008/05/24/handling-very-large-integers-in-erlang/

cloudozer/ling
https://github.com/cloudozer/ling

inaka/erlang_training · GitHub
https://github.com/inaka/erlang_training

inaka/spawnedshelter · GitHub
https://github.com/inaka/spawnedshelter

pyotrgalois/spawnedshelter
https://github.com/pyotrgalois/spawnedshelter

My Links
http://delicious.com/ajlopez/erlang

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

April 24, 2014

Erlang: Links, News And Resources (11)

Filed under: Distributed Computing, Erlang, Functional Programming, Links — ajlopez @ 2:36 pm

Previous Post
Next Post

Erlang String Handling — Functional Erlang — Medium
https://medium.com/functional-erlang/7588daad8f05

Your first Erlang program (in style). – Ward Bekker
http://blog.equanimity.nl/blog/2014/03/29/your-first-erlang-program/

oubiwann/jlfe
https://github.com/oubiwann/jlfe

Erlang — Advanced
http://www.erlang.org/doc/efficiency_guide/advanced.html

Orleans Actors Analysis – Tech stuff that interests me
http://shinolajla.tumblr.com/post/81199345476/orleans-actors-analysis

reedr/slides/efsf2014-whatsapp-scaling.pdf at master · reedr/reedr
https://github.com/reedr/reedr/blob/master/slides/efsf2014-whatsapp-scaling.pdf

High Scalability – High Scalability – How WhatsApp Grew to Nearly 500 Million Users, 11,000 cores, and 70 Million Messages a Second
http://highscalability.com/blog/2014/3/31/how-whatsapp-grew-to-nearly-500-million-users-11000-cores-an.html

Elixir is for programmers
http://blog.pluralsight.com/elixir-is-for-programmers

LambaJam Chicago – Welcome
http://www.lambdajam.com/

homepages.inf.ed.ac.uk/wadler/papers/erlang/erlang.pdf
http://homepages.inf.ed.ac.uk/wadler/papers/erlang/erlang.pdf

ErlangSolutions Youtube channel – YouTube
https://www.youtube.com/user/ErlangSolutions?feature=watch

10 Billion a Day, 100 Milliseconds Per: Monitoring Real-Time Biddin…
http://www.slideshare.net/BrianTroutwine1/10-billion-a-day-100-milliseconds-per-monitoring-realtime-bidding-at-adroll

Scaling HTTP connections // Speaker Deck
https://speakerdeck.com/benoitc/scaling-http-connections

odie2630463/ercheme · GitHub
https://github.com/odie2630463/ercheme

altenwald – YouTube
http://www.youtube.com/channel/UCsx08xYUIVx0CTMKbGZtPuw/videos

My Links
http://delicious.com/ajlopez/erlang

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

April 15, 2014

End Of Iteration 2014w15

Previous Post
Next Post

Code Generation

I wrote new tasks, templates using my AjGenesis code generation tool. I create a simple:

https://github.com/ajlopez/AjGenesisNode-Django

to generate a Django web site, with admin page. The code generation creates the model, and admin feature allows you to edit the data, using Sqlite. It’s simple, but it is working. Next steps: create custom views, and a new project to generate Flask web site.

I added text area input fields to https://github.com/ajlopez/AjGenesisNode-Express the project that generates Express/Node.js web site from a model. Next steps: client-side validation, better server code organization, some initial tests.

I want to integrate these tools in a online app, so I started https://github.com/ajlopez/AjGenesisNodeServer to have a web site that generate codes from a model, defined at client side. You will select technology (Express, PHP, Sinatra, Django, Flask, …), the models (mainly, entities like: customer, supplier, department, employee, invoice… ), the database, the features (multiple pages, single page, angular? backbone? other?, REST API?, phonegap wrapper?), and voila. A zip will be generated with the generated solution. That is, code generation as a service. Maybe I could add an API to be externally consumed.

Python

I added a Flask web site example, work in progress, to my Python Samples:

https://github.com/ajlopez/PythonSamples/tree/master/Flask

I will use as a basis for my AjGenesis code generation version for Flask web sites.

Actor Model in C#

I refactored my project

https://github.com/ajlopez/Aktores

an Akka-like actor model implemented in C#. Now, I have a mailbox per actor, but the actor message process is executed consuming task from a queue, with n thread launched by the initial actor system. It was good to see such refactor working: all is in place, now. It is a proof that you don’t need to design everything before coding. If you follow TDD (Test-Driven Development) new ideas (or old ideas that have not implemented yet) can be added without much effort.

Erlang in C#

I started to add serialization of message to my project

https://github.com/ajlopez/AjErl

As usual, I started simple, using TDD: write input and out channel, using tests, red to green, refactoring. Instead of consuming an external library for serialization, I wrote a simple code, towards my first use case of distributed application. When the use case will be in place, I could start to think about other implementation path.

Google Code Jam

Past Saturday, I participated in Google Code Jam, Qualification Round. My code, usually written following TDD:

https://github.com/ajlopez/TddRocks/tree/master/Gcj2014

The Minesweeper problem is the tricky one. I should add the description of the problems, copying it from the original site.

Others

I added some code kata tests to my JavaScript samples https://github.com/ajlopez/JavaScriptSamples. I added metadata macro readind go my Clojure in C# https://github.com/ajlopez/ClojSharp. I started to add type checking in my node tree for Scala in C# https://github.com/ajlopez/ScalaSharp/commits/master. I added qualified name evaluation to my Rust interpreter in JavaScript https://github.com/ajlopez/RustScript. I worked on two non-public projects, too.

More fun is coming.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

April 10, 2014

Erlang: Links, News And Resources (10)

Filed under: Distributed Computing, Erlang, Functional Programming, Links — ajlopez @ 5:27 pm

Previous Post
Next Post

Erlang y Whatsapp – AltenWald
http://altenwald.org/2014/02/22/erlang-y-whatsapp/

High Scalability – High Scalability – The WhatsApp Architecture Facebook Bought For $19 Billion
http://highscalability.com/blog/2014/2/26/the-whatsapp-architecture-facebook-bought-for-19-billion.html

ACM SIGPLAN Erlang Workshop 2014, Göteborg, Sweden
http://www.erlang.org/workshop/2014/

marianoguerra/efene
https://github.com/marianoguerra/efene
Programming language with C-like syntax that runs on the Erlang platform

Electric Duncan: Lisp Flavored Erlang
http://technicae.cogitat.io/2013/03/lisp-flavored-erlang.html

Lisp Flavored Erlang
http://lfe.github.io/

Zotonic, the Erlang Web Framework — Zotonic
http://zotonic.com/

Inside Erlang, The Rare Programming Language Behind WhatsApp’s Success ⚙ Co.Labs ⚙ code community
http://www.fastcolabs.com/3026758/inside-erlang-the-rare-programming-language-behind-whatsapps-success

Erlang/OTP – Recursos
http://erlang.bosqueviejo.net/trabajo.html

There’s More to Life than Just Functions
http://bodil.org/more-than-functions/#/

Talking about Erlang with Fernando Benavides | Paolo D’Incau’s Blog
http://pdincau.wordpress.com/2014/02/03/talking-about-erlang-with-fernando-benavides/

videlalvaro/erlang-prime-sieve
https://github.com/videlalvaro/erlang-prime-sieve

KennethLundin-ErlangFactory2009London-AboutErlangOTPandMulti-coreperformanceinparticular.pdf (application/pdf Object)
http://www.erlang-factory.com/upload/presentations/105/KennethLundin-ErlangFactory2009London-AboutErlangOTPandMulti-coreperformanceinparticular.pdf

Big changes to Erlang
http://joearms.github.io/2014/02/01/big-changes-to-erlang.html

Erlang HiPE vs Scala | Computer Language Benchmarks Game
http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&lang=hipe&lang2=scala&data=u64q

Building a Multi-Master Distributed Redis in Erlang
http://www.infoq.com/presentations/redis-erlang

Can someone explain the structure of a Pid in Erlang? – Stack Overflow
http://stackoverflow.com/questions/243363/can-someone-explain-the-structure-of-a-pid-in-erlang

ongoing by Tim Bray · Software in 2014
https://www.tbray.org/ongoing/When/201x/2014/01/01/Software-in-2014

Deploshark – Tech Blog: Aprendiendo Erlang
http://blog.deploshark.com.ar/2014/01/aprendiendo-erlang.html

My Links
http://delicious.com/ajlopez/erlang

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

March 11, 2014

Erlang: Links, News And Resources (9)

Filed under: Distributed Computing, Erlang, Functional Programming, Links — ajlopez @ 4:48 pm

Previous Post
Next Post

Elixir
http://elixir-lang.org/crash-course.html

Learning Erlang: A Coding Tutorial
http://www.claystuart.com/

Modules | Learn You Some Erlang for Great Good!
http://learnyousomeerlang.com/modules

Erlang for Authoritative DNS
http://www.infoq.com/presentations/erlang-dns

MichaelDrogalis/dire
https://github.com/MichaelDrogalis/dire

(349) Programming Languages: Why create any more programming languages? – Quora
http://www.quora.com/Programming-Languages/Why-create-any-more-programming-languages

Defining erlang functions in the shell – Stack Overflow
http://stackoverflow.com/questions/2065990/defining-erlang-functions-in-the-shell

Cqerl by matehat
http://matehat.github.io/cqerl/

altenwald/ephp
https://github.com/altenwald/ephp

ephp_testing.md
https://gist.github.com/manuel-rubio/7949523

inaka/sumo_db
https://github.com/inaka/sumo_db

inaka/canillita
https://github.com/inaka/canillita

Erlang Handbook by esl
http://opensource.erlang-solutions.com/erlang-handbook/

My Links
http://delicious.com/ajlopez/erlang

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

March 8, 2014

New Month’s Resolutions: March 2014

Filed under: AjErl, C Sharp, ClojSharp, Clojure, Erlang, Open Source Projects, Scala, ScalaSharp — ajlopez @ 7:27 pm

Review of my February’s Resolutions:

– Complete distributed messaging in AjErl [partial] see repo
– Complete dot notation in AjLisp [pending]
– Improve ClojSharp [complete] see repo
– Work on ScaScript [partial] see repo
– Work on ScalaSharp [complete] see repo
– Add variable scope to Mass [pending]
– Complete first version Aktores actor model in C# [pending]
– More code generation tasks, templates, models in AjGenesis for Node, generating Express, Meteor, Sinatra applications [partial] see repo

To compensate missing coding, I worked on:

– Create Annalisa [complete] see repo with online web services and demo
– Start SimpleAsync [complete] see repo
– Create my first Meteor samples [complete] see repo
– Start Templie, a simple template engine in Java [complete] see repo
– Start SimpleScraper, a simple scraper in JavaScript/Node.js [complete] see repo

And I made minor improvements on DylanSharp

New month’s resolution:

– Work on DictSharp
– Give talk about Node.js Distributed Applications
– Improve SimpleGammon
– Improve Annalisa
– Add @for to Templie
– Work on PreciosaAnnalisa online web services
– Improve my Node.js Distributes Applications samples
– Work on ScalaSharp
– Improve ClojSharp
– Improve SimpleAsync, do operation (functions in parallel)
– Improve Aktores
– Distributed messages in AjErl
– Add variable scope to Mass language
– Start code generation as a service

More fun is coming.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

Older Posts »

The Shocking Blue Green Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 69 other followers