views:

410

answers:

3

Does anyone know of an implementation of a scripting language interpreter (something appropriate for a game) in Erlang? Something like Javascript or Lua would be great.

A: 

Erlang itself can be used as a scripting language. See escript at Erlang docs.

Vijay Mathew
This is cool, but I'm looking a language similar to the two I mentioned. I have a feeling Erlang itself wouldn't make such a great scripting language. =/
Paul
+2  A: 

I second Vijay's suggestion to use Erlang itself. However, I'll also point out the existence of Reia, which seems to be precisely what you ask for.

EDIT: Right, so there's erlyjs, a JavaScript compiler targetting the Erlang virtual machine. I've no idea whatsoever if what stage of development this project is at, how well it's progressing etc., but you could check it out. Not sure if it requires ahead-of-time compilation of JS code, you'd need to see for yourself...

Here you'll find one of several github forks of the code base. All in Erlang, as far as I can see.

Once again, this is not a mature product. But then, with the rise of CouchDB, something like this might actually be useful in some significant ways... so it might hopefully actually become mature somewhat soonish.

Michał Marczyk
Maybe I'm not coming across clearly enough, but I'm not looking to write Erlang programs (as in, programs that will compile to Erlang bytecode) in another language. What I'm looking for is an interpreter written *in* Erlang.
Paul
Michał Marczyk
Yeah, erlyjs looks like an awesome project, unfortunately the github version seems fairly immature, and all that's available. The original google code repo mysteriously disappeared: http://code.google.com/p/erlyjs/I also looked into how CouchDB handles javascript, and I see that it spawns SpiderMonkey processes. Perhaps I could find a way to embed V8 into an Erlang Cnode...Bummer. Thanks for your help, though!
Paul
Sure. Sorry not to know about something more useful. If you do embed V8 in Erlang code, that would actually be super cool! Happy hacking. :-)
Michał Marczyk
+1  A: 

You may try C/C++ port driver for run lua (or other) language interpretor, erlua is more likely what you need (it works by port driver, i guess).

JLarky