• Clozhang
  • Archives
  • Categories
  • Tags
  • Authors
  • Community
  • About
    • clozhang
    • The Clozhang 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

Neighboring Posts

Previous
Next

Post Data

Lines: 27

Words: 128

Characters: 1159

 
  • Archives
  • Categories
  • Tags
  • Authors
  • About
  • Clojure
  • π-Calculus
  • Clozhang
  • Blog
  • Clojang
 

Design © 2013 Thomas Park | Design and Content © 2017-2018 Clozhang