Git Product home page Git Product logo

erlang_perl's Introduction

erlang_perl

Overview

erlang_perl is a linked-in driver, API, and OTP application that embeds Perl interpreter in Erlang. Originally created to facilitate usage of Riak’s MapReduce by non-Erlang programmers, it supports runtime evaluation of Perl code, and invocation of Perl functions.

Quick Start

You must have Erlang/OTP R13B04 or later and a GNU-style build system to compile and run erlang_perl.

git clone git://github.com/yko/erlang_perl.git
make all test

Start up an Erlang shell with the path to erlang_perl included.

erl -pa path/to/erlang_perl/ebin -boot start_sasl

Start the erlang_perl application and create a Javascript VM.

1> application:start(erlang_perl).

=PROGRESS REPORT==== 6-Dec-2014::23:30:38 ===
          supervisor: {local,erlang_perl_sup}
             started: [{pid,<0.47.0>},
                       {name,cache},
                       {mfargs,{js_cache,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,2000},
                       {child_type,worker}]

=PROGRESS REPORT==== 6-Dec-2014::23:30:38 ===
         application: erlang_perl
          started_at: nonode@nohost
ok
2> {ok, Perl} = perl_driver:new().

Now you can evaluate Perl expressions, install and call your own Perl subroutines.

3> {ok, Result} = perl:eval(Perl, <<"40 + 2">>).
{ok,42}
4> {ok, Sub} = perl:define(Perl, <<"sub { my $args = shift; $args->[0] + 1; }">>).
{ok,<<"_GEN_0">>}
5> perl:call_sub(Perl, Sub, [3]).
{ok,4}

erlang_perl's People

Contributors

argv0 avatar beerriot avatar cmeiklejohn avatar dantealiegri avatar dizzyd avatar dreverri avatar jadeallenx avatar jaredmorrow avatar jonmeredith avatar jtuple avatar kellymclaughlin avatar kuenishi avatar lemenkov avatar mokele avatar msantos avatar seancribbs avatar slfritchie avatar vagabond avatar yko avatar

Watchers

 avatar  avatar

Forkers

waisbrot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.