{"id":13723532,"url":"https://github.com/clojang/clojang","last_synced_at":"2025-06-24T06:37:13.559Z","repository":{"id":62435317,"uuid":"42425677","full_name":"clojang/clojang","owner":"clojang","description":"Clojure API for Erlang/OTP Communications (built on jiface)","archived":false,"fork":false,"pushed_at":"2018-08-04T20:35:41.000Z","size":1046,"stargazers_count":68,"open_issues_count":9,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-21T18:35:43.054Z","etag":null,"topics":["beam","clojure","distributed-systems","erlang","java","jiface","jinterface","jvm","lfe","otp"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clojang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-14T03:44:41.000Z","updated_at":"2025-02-17T21:26:30.000Z","dependencies_parsed_at":"2022-11-01T21:16:05.829Z","dependency_job_id":null,"html_url":"https://github.com/clojang/clojang","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/clojang/clojang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojang%2Fclojang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojang%2Fclojang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojang%2Fclojang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojang%2Fclojang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clojang","download_url":"https://codeload.github.com/clojang/clojang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojang%2Fclojang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261183722,"owners_count":23121701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beam","clojure","distributed-systems","erlang","java","jiface","jinterface","jvm","lfe","otp"],"created_at":"2024-08-03T01:01:42.637Z","updated_at":"2025-06-24T06:37:13.529Z","avatar_url":"https://github.com/clojang.png","language":"Clojure","funding_links":["https://liberapay.com/clojang/donate","https://liberapay.com/about/"],"categories":["Languages Integration"],"sub_categories":[],"readme":"# clojang\n\n[![Build Status][travis-badge]][travis]\n[![Dependencies Status][deps-badge]][deps]\n[![Clojars Project][clojars-badge]][clojars]\n\n*Erlang/OTP Communications in Clojure (wraps jiface + JInterface)*\n\n[![Clojang logo][logo]][logo-large]\n\n\n#### Contents\n\n* [Introduction](#introduction-)\n* [Dependencies](#dependencies-)\n* [Building](#building-)\n* [Shells \u0026 REPLs](#shells--repls-)\n* [Documentation](#documentation-)\n* [Usage](#usage-)\n* [Running Tests](#running-tests-)\n* [Donating](#donating-)\n* [License](#license-)\n\n\n## Introduction [\u0026#x219F;](#contents)\n\nThis project provides a final solution to the Clojure\n[JInterface Problem](https://github.com/clojang/jiface/wiki/The-JInterface-Problem).\nThe [jiface low-level API](https://github.com/clojang/jiface) solves this to a\ncertain extent, but `jiface` requires that programmers perform all their own type\nconversions, manual creation of nodes and mboxes, etc.\n\nThe Clojang library, however, provides an interface that is not only\nsyntactically idiomatic Clojure (not unlike the jiface library), but even more\nso, provides developers with the same level of convenience they have come to\nexpect when using Clojure libraries in general, without the need to perform\nmany manual operations in order to handle Erlang data.\n\nFor a comparison of JInterface, the low-level `jiface` API, and the high-level\n`clojang` API, see\n[the APIs summary](http://clojang.github.io/jiface/current/05-apis.html) page.\n\n\n## Dependencies [\u0026#x219F;](#contents)\n\n* Java\n* Erlang\n* lein\n* rebar3\n\nThe default (and tested) version combinations are as follows:\n\n| Clojang | jiface | JInterface | Erlang Release | Erlang Version (erts) |\n|---------|--------|------------|----------------|-----------------------|\n| 0.5.0   | 0.5.0  | 1.8.1      | 20.3           | 9.3                   |\n| 0.4.0   | 0.4.0  | 1.7.1      | 19.2, 19.3     | 8.2, 8.3              |\n| 0.3.0   | 0.3.0  | 1.7.1      | 19.2           | 8.2                   |\n| 0.2.0   | 0.2.0  | 1.7.1      | 19.1, 19.2     | 8.1, 8.2              |\n| 0.1.0   | 0.1.0  | 1.6.1      | 18.2, 18.3     | 7.2, 7.3              |\n\nWhile other version combination may work (and existing versions may be updated\nto work with different onces), those are the only ones which are supported.\n\n\n## Building [\u0026#x219F;](#contents)\n\n`rebar3` is used for the top-level builds of the project. It runs `lein` under\nthe covers in order to build the Clojure code and create the Clojang`.jar`\nfile. As such, to build everything -- LFE, Erlang, and Clojure -- you need\nonly do the following:\n\n* `rebar3 compile`\n\nIf you wish to build your own JInterface `.jar` file and not use the one we've\nuploaded to Clojars, you'll need to follow the instrucations given in the\n[jinterface-builder Clojang project](https://github.com/clojang/jinterface-builder).\n\n\n## Shells \u0026 REPLs [\u0026#x219F;](#contents)\n\nThere are three interactive programming environments you may start, each of\nwhich will have full access to the project's libraries/dependencies.\n\nLFE:\n\n```bash\n$ make lfe-repl\n```\n\nErlang:\n\n```bash\n$ rebar3 shell\n```\n\nClojure:\n\n```bash\n$ lein clj-repl\n```\n\n\n## Documentation [\u0026#x219F;](#contents)\n\nProject documentation, including Clojang API reference docs, Javadocs for\nJInterface, and the Erlang JInterface User's Guide, is availble here:\n\n* [http://clojang.github.io/clojang/current/](http://clojang.github.io/clojang/current/)\n\nQuick links for the other docs:\n\n* Clojang User Guides:\n  * [jiface User's Guide](http://clojang.github.io/jiface/current/10-low-level-api.html) -\n    A translation of the *JInterface User's Guide* (Erlang documantaion) from\n    Java into Clojure; this is refered to as the Clojang low-level API.\n  * [Clojang User's Guide](http://clojang.github.io/clojang/current/20-mid-level-api.html) -\n    An adaptation of the *jiface User's Guide* which demonstrates the improved\n    API that Clojang offers\n* [JInterface User's Guide](http://clojang.github.io/jiface/current/erlang/jinterface_users_guide.html) - The JInterface (Java support for Erlang Ports) documentation provided in\n  Erlang distributions\n* [Jinterface Javadocs](http://clojang.github.io/jiface/current/erlang/java) -\n  Javadoc-generated API documentation built from the JInterface source code\n\n\n## Usage [\u0026#x219F;](#contents)\n\nUsing Clojang in a project is just like any other Clojure library. Just add\nthe following to the `:dependencies` in your `project.clj` file:\n\n[![Clojars Project][clojars-badge]][clojars]\n\nFor the Erlang/LFE side of things, you just need to add the Github URL to your\n`rebar.config` file, as with any other rebar-based Erlang VM project.\n\nAs for actual code usage, the documentation section provides links to\ndeveloper guides and API references, but below are also provided some quick\nexamples.\n\nHere, we'll send a message to our own (default) node's message box, and then\nreceive it:\n\n```clj\n(require '[clojang.core :refer [! receive self]])\n\n(! [(self) :hello-word])\n(let [[pid msg] (receive)]\n  (println msg))\n```\n\nTo show remote usage, from an LFE (Lisp Flavoured Erlang) REPL:\n\n```cl\n(clojang-lfe@mndltl01)\u003e (! #(default clojang@host) `#(,(self) hej!))\n#(\u003c0.35.0\u003e hej!)\n```\n\nThen back in Clojure, the same that we used before, but we'll capture the\nprocess id that we sent from LFE and then send another message back to it:\n\n```clj\n(let [[pid msg] (receive)]\n  (println msg)\n  (! pid \"hello, world!\"))\n```\n\nThen, returning to the LFE REPL, we check that we received the message from\nClojang:\n\n```cl\n(clojang-lfe@mndltl01)\u003e (c:flush)\nShell got \"hello, world!\"\nok\n```\n\n\n## Running Tests [\u0026#x219F;](#contents)\n\nAll the tests may be run with just one command:\n\n```bash\n$ rebar3 eunit\n```\n\nThis will not only run Erlang and LFE unit tests, it also runs the Clojure\nunit tests for Clojang.\n\n**Clojure Test Selectors**\n\nIf you would like to be more selective in the types of Clojang tests which get\nrun, you may be interested in reading this section.\n\nThe Clojang tests use metadata annotations to indicate whether they are unit,\nsystem, or integration tests. to run just the unit tests, you can do any one\nof the following, depending upon what you're used to:\n\n```bash\n$ lein test\n$ lein test :unit\n$ lein test :default\n```\n\nTo run just the system tests:\n\n```bash\n$ lein test :system\n```\n\nAnd, similarly, just the integration tests:\n\n```bash\n$ lein test :integtration\n```\n\nTo run everything:\n\n```bash\n$ lein test :all\n```\n\nThis is what is used by the `rebar3` configuration to run the Clojang tests.\n\n\n## Donating [\u0026#x219F;](#contents)\n\nA donation account for supporting development on this project has been set up\non Liberapay here:\n\n* [https://liberapay.com/clojang/donate](https://liberapay.com/clojang/donate)\n\nYou can learn more about Liberapay on its [Wikipedia entry][libera-wiki] or on the\nservice's [\"About\" page][libera-about].\n\n[libera-wiki]: https://en.wikipedia.org/wiki/Liberapay\n[libera-about]: https://liberapay.com/about/\n\n\n## License [\u0026#x219F;](#contents)\n\n```\nCopyright © 2018 The Clojang Project\n\nCopyright © 2016-2017 Duncan McGreggor\n\nDistributed under the Apache License Version 2.0.\n```\n\n\n\u003c!-- Named page links below: /--\u003e\n\n[travis]: https://travis-ci.org/clojang/clojang\n[travis-badge]: https://travis-ci.org/clojang/clojang.png?branch=master\n[deps]: http://jarkeeper.com/clojang/clojang\n[deps-badge]: http://jarkeeper.com/clojang/clojang/status.svg\n[clojars]: https://clojars.org/clojang/clojang\n[clojars-badge]: https://img.shields.io/clojars/v/clojang/clojang.svg\n[logo]: https://github.com/clojang/resources/blob/master/images/logo-5-250x.png\n[logo-large]: https://github.com/clojang/resources/blob/master/images/logo-5-1000x.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclojang%2Fclojang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclojang%2Fclojang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclojang%2Fclojang/lists"}