All Projects → clojang → clojang

clojang / clojang

Licence: other
Clojure API for Erlang/OTP Communications (built on jiface)

Programming Languages

clojure
4091 projects
Makefile
30231 projects
erlang
1774 projects
LFE
6 projects

Projects that are alternatives of or similar to clojang

jiface
A Clojure-idiomatic wrapper around Erlang's JInterface
Stars: ✭ 27 (-55.74%)
Mutual labels:  otp, jvm, beam, jinterface
Ergo
a Framework for creating mesh networks using technologies and design patterns of Erlang/OTP in Golang
Stars: ✭ 376 (+516.39%)
Mutual labels:  distributed-systems, otp
Memento
Simple + Powerful interface to the Mnesia Distributed Database 💾
Stars: ✭ 597 (+878.69%)
Mutual labels:  distributed-systems, otp
elixir-fire-brigade-workshop
Workshop "Join the Elixir Fire Brigade - Level-up Your Elixir Debugging Skills" (ElixirConf US 2017)
Stars: ✭ 14 (-77.05%)
Mutual labels:  otp, beam
Titanoboa
Titanoboa makes complex workflows easy. It is a low-code workflow orchestration platform for JVM - distributed, highly scalable and fault tolerant.
Stars: ✭ 787 (+1190.16%)
Mutual labels:  distributed-systems, jvm
Elixirbooks
List of Elixir books
Stars: ✭ 1,021 (+1573.77%)
Mutual labels:  distributed-systems, otp
Orbit
Orbit - Virtual actor framework for building distributed systems
Stars: ✭ 1,585 (+2498.36%)
Mutual labels:  distributed-systems, jvm
logserver
web log viewer that combines logs from several sources
Stars: ✭ 20 (-67.21%)
Mutual labels:  distributed-systems
Garfield
An offensive attack framework for Distributed Layer of Modern Applications
Stars: ✭ 74 (+21.31%)
Mutual labels:  distributed-systems
otp
One Time Password for 2-Factor-Authentication implemented in Rust
Stars: ✭ 21 (-65.57%)
Mutual labels:  otp
SourceCodeSummary
个人笔记(编译/性能优化/framework/音视频/flutter)
Stars: ✭ 18 (-70.49%)
Mutual labels:  jvm
fabric
Fabric is an experimental protocol for exchanging information.
Stars: ✭ 46 (-24.59%)
Mutual labels:  distributed-systems
clj-headlights
Clojure on Beam
Stars: ✭ 25 (-59.02%)
Mutual labels:  beam
archimedes-jvm
Archimedes's implementation for the Java Virtual Machine (JVM)
Stars: ✭ 24 (-60.66%)
Mutual labels:  jvm
sockerl
Sockerl is an advanced Erlang/Elixir socket framework for TCP protocols and provides fast, useful and easy-to-use API for implementing servers, clients and client connection pools.
Stars: ✭ 26 (-57.38%)
Mutual labels:  otp
moqui-hazelcast
Moqui Framework tool component for Hazelcast, used for distributed async services, entity distributed cache invalidation, web session replication, and distributed cache (javax.cache)
Stars: ✭ 12 (-80.33%)
Mutual labels:  distributed-systems
java-sdk
一些常用的java sdk和工具类(日期工具类,分布式锁,redis缓存,二叉树,反射工具类,线程池,对称/非对称/分段加解密,json序列化,http工具,雪花算法,字符串相似度,集合操作工具,xml解析,重试Retry工具类,Jvm监控等)
Stars: ✭ 26 (-57.38%)
Mutual labels:  jvm
outboxer
A library that implements the outboxer pattern in go
Stars: ✭ 90 (+47.54%)
Mutual labels:  distributed-systems
play-java-seed.g8
Play Java Seed template: use "sbt new playframework/play-java-seed.g8"
Stars: ✭ 20 (-67.21%)
Mutual labels:  jvm
braid-go
简单易用的微服务框架 | Ease used microservice framework
Stars: ✭ 34 (-44.26%)
Mutual labels:  distributed-systems

clojang

Build Status Dependencies Status Clojars Project

Erlang/OTP Communications in Clojure (wraps jiface + JInterface)

Clojang logo

Contents

Introduction

This project provides a final solution to the Clojure JInterface Problem. The jiface low-level API solves this to a certain extent, but jiface requires that programmers perform all their own type conversions, manual creation of nodes and mboxes, etc.

The Clojang library, however, provides an interface that is not only syntactically idiomatic Clojure (not unlike the jiface library), but even more so, provides developers with the same level of convenience they have come to expect when using Clojure libraries in general, without the need to perform many manual operations in order to handle Erlang data.

For a comparison of JInterface, the low-level jiface API, and the high-level clojang API, see the APIs summary page.

Dependencies

  • Java
  • Erlang
  • lein
  • rebar3

The default (and tested) version combinations are as follows:

Clojang jiface JInterface Erlang Release Erlang Version (erts)
0.5.0 0.5.0 1.8.1 20.3 9.3
0.4.0 0.4.0 1.7.1 19.2, 19.3 8.2, 8.3
0.3.0 0.3.0 1.7.1 19.2 8.2
0.2.0 0.2.0 1.7.1 19.1, 19.2 8.1, 8.2
0.1.0 0.1.0 1.6.1 18.2, 18.3 7.2, 7.3

While other version combination may work (and existing versions may be updated to work with different onces), those are the only ones which are supported.

Building

rebar3 is used for the top-level builds of the project. It runs lein under the covers in order to build the Clojure code and create the Clojang.jar file. As such, to build everything -- LFE, Erlang, and Clojure -- you need only do the following:

  • rebar3 compile

If you wish to build your own JInterface .jar file and not use the one we've uploaded to Clojars, you'll need to follow the instrucations given in the jinterface-builder Clojang project.

Shells & REPLs

There are three interactive programming environments you may start, each of which will have full access to the project's libraries/dependencies.

LFE:

$ make lfe-repl

Erlang:

$ rebar3 shell

Clojure:

$ lein clj-repl

Documentation

Project documentation, including Clojang API reference docs, Javadocs for JInterface, and the Erlang JInterface User's Guide, is availble here:

Quick links for the other docs:

  • Clojang User Guides:
    • jiface User's Guide - A translation of the JInterface User's Guide (Erlang documantaion) from Java into Clojure; this is refered to as the Clojang low-level API.
    • Clojang User's Guide - An adaptation of the jiface User's Guide which demonstrates the improved API that Clojang offers
  • JInterface User's Guide - The JInterface (Java support for Erlang Ports) documentation provided in Erlang distributions
  • Jinterface Javadocs - Javadoc-generated API documentation built from the JInterface source code

Usage

Using Clojang in a project is just like any other Clojure library. Just add the following to the :dependencies in your project.clj file:

Clojars Project

For the Erlang/LFE side of things, you just need to add the Github URL to your rebar.config file, as with any other rebar-based Erlang VM project.

As for actual code usage, the documentation section provides links to developer guides and API references, but below are also provided some quick examples.

Here, we'll send a message to our own (default) node's message box, and then receive it:

(require '[clojang.core :refer [! receive self]])

(! [(self) :hello-word])
(let [[pid msg] (receive)]
  (println msg))

To show remote usage, from an LFE (Lisp Flavoured Erlang) REPL:

(clojang-lfe@mndltl01)> (! #(default clojang@host) `#(,(self) hej!))
#(<0.35.0> hej!)

Then back in Clojure, the same that we used before, but we'll capture the process id that we sent from LFE and then send another message back to it:

(let [[pid msg] (receive)]
  (println msg)
  (! pid "hello, world!"))

Then, returning to the LFE REPL, we check that we received the message from Clojang:

(clojang-lfe@mndltl01)> (c:flush)
Shell got "hello, world!"
ok

Running Tests

All the tests may be run with just one command:

$ rebar3 eunit

This will not only run Erlang and LFE unit tests, it also runs the Clojure unit tests for Clojang.

Clojure Test Selectors

If you would like to be more selective in the types of Clojang tests which get run, you may be interested in reading this section.

The Clojang tests use metadata annotations to indicate whether they are unit, system, or integration tests. to run just the unit tests, you can do any one of the following, depending upon what you're used to:

$ lein test
$ lein test :unit
$ lein test :default

To run just the system tests:

$ lein test :system

And, similarly, just the integration tests:

$ lein test :integtration

To run everything:

$ lein test :all

This is what is used by the rebar3 configuration to run the Clojang tests.

Donating

A donation account for supporting development on this project has been set up on Liberapay here:

You can learn more about Liberapay on its Wikipedia entry or on the service's "About" page.

License

Copyright © 2018 The Clojang Project

Copyright © 2016-2017 Duncan McGreggor

Distributed under the Apache License Version 2.0.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].