Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang as an embedded system within an application?

Tags:

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?

like image 895
Oliver Mason Avatar asked Oct 21 '10 19:10

Oliver Mason


2 Answers

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

like image 56
J Chris A Avatar answered Oct 19 '22 06:10

J Chris A


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

like image 39
benzado Avatar answered Oct 19 '22 06:10

benzado