• Clojang
  • Archives
  • Categories
  • Tags
  • Authors
  • Community
  • About
  • Docs
    • API Comparison
    • clojang
    • jiface
    • JInterface Erlang Docs
    • Jinterface API Reference
    • clojang
    • jiface
    • agent
    • jinterface-builder
    • The Clojang Collection
    • Travis CI

A New Project

Clojure and LFE Interop?

May 11, 2014

by oubiwann

With the first few lines of code, hacking on a fork of Maxim Molchanov's erlang-java-node code, it seems there's a lot of potential here for LFE and Clojure.

I've been hacking on LFE/Clojure code lately, based on the work that Maxim Molchanov has done in his Erlang/Clojure repo. This could end up being a great deal of fun :-)

Here's a quick sample of his Erlang supervisor for a Clojure node:

-module(clojurenode_sup).

-behaviour(supervisor).

%% API
-export([start_link/0]).

%% Supervisor callbacks
-export([init/1]).

%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).

%% ===================================================================
%% API functions
%% ===================================================================

start_link() ->
    supervisor:start_link({local, ?MODULE}, ?MODULE, []).

%% ===================================================================
%% Supervisor callbacks
%% ===================================================================

init([]) ->
    {ok, { {one_for_one, 5, 10}, [?CHILD(clj_controller, worker)]} }.

Note sure if the work I'm doing with LFE and Clojure will go anywhere yet, but even if it doesn't, it's a ton of fun :-)

Category

Prototypes

Tags

clojure code development erlang

Post Data

Words: 128

Characters: 1159

Neighboring Posts

Previous
Next
 
  • Archives
  • Categories
  • Tags
  • Authors
  • About
  • Clojure
  • Erlang
  • LFE/X
  • Elixir
  • Clojang
 

Design © 2013 Thomas Park | Design and Content © 2017 Clojang