views:

226

answers:

2

Coming from Python I am looking for some "easy to try out" shell like Python has with ipython (preferably with Emacs support). In the Erlang shell you always have to first compile (c(...)) which slows down the experimental phase very much.

+3  A: 

Yes it is :) http://erlang.org/doc/man/escript.html

$ cat /tmp/test
#!/usr/bin/env escript
main(_) ->
io:format("Hello World!\n").
$ chmod +x /tmp/test
$ /tmp/test
Hello World!
JLarky
Overlooked that! But still, no Tab-completion and the like...
wr
You have tab completion in the normal Erlang shell on module names and function names.
Adam Lindberg
see my comment below on making the shell autoload changes for you.
Jeremy Wall
+1  A: 

It should be fairly easy to build a module the starts a process to autoload code changes into your shell. Erlang actually has built in support for this kind of thing. So anytime you have recompiled the code it gets loaded into your shell automatically thus eliminating the need to type c('module.erl'). yourself. You could probably even have it monitor file changes and automatically compile it for you. see:

http://github.com/toddlipcon/mochiweb/blob/29d6ffd58aa2cd175f84cadfc1ce1697f366ef62/src/reloader.erl

for an example in action.

Currently that module just looks for recompiled modules but it should be trivial to have it look for changed source files and recompile them for you.

Jeremy Wall