Oliver Mason
Oliver Mason

Reputation: 2247

Erlang as an embedded system within an application?

I have quite a lot of code written in Erlang, which I want to include in applications written in Objective-C, eg on the iPad. Ideally I would want to have an object that encapsulates the Erlang run-time; this could then be accessed like the standard Erlang shell, something along the lines of:

ErlangRT *runtime = [[ErlangRT alloc] init];
ErlangValue *retval = [runtime execute:@"io:format(\"hello world~n\")"];

I don't care too much about performance etc; I can see how it could work, but as I don't know too much about the way the Erlang VM is implemented I have no idea how easy or difficult it is to do, or if anybody has already done something similar. I know there are other ways of interfacing between Objective-C and Erlang, but they seem to assume an independently installed Erlang system on the target machine. I would prefer it to be like a library that you simply link in with the application.

So my question is: is this comparatively easy to do, and/or has somebody already worked on this?

Upvotes: 21

Views: 4626

Answers (2)

J Chris A
J Chris A

Reputation: 2168

We've got Erlang working on the iPhone (and approved for the App Store) as part of our package of Apache CouchDB for iOS. The Github project is here: https://github.com/couchbaselabs/iOS-Couchbase

The Erlang we use is here: https://github.com/couchbaselabs/iErl14

More info on Mobile Couchbase: http://www.couchbase.com/products-and-services/mobile-couchbase

Enjoy!

Chris

Upvotes: 12

benzado
benzado

Reputation: 84388

It looks like http://sourceforge.net/projects/erlandstaticlib/ is the best option right now.

Upvotes: 3

Related Questions