[erlang-questions] Erlang and beam-based scripting languages.

George Catalin Serbanut <>
Tue Sep 13 14:41:05 CEST 2011


Hi, Max,

I don't know if I understood correctly, but what you are looking for is kind
of web server. Is that statement correct? If yes, see YAWS (Yet Another Web
Server - http://yaws.hyber.org/).

Other options:
1. If you look for a database (with web pages capability), see CouchDB (
http://couchdb.apache.org/).
2. If you look for a messenger-like server, see Ejabberd (
http://www.ejabberd.im/).
3. If you are looking for messenger-like client, see Exmpp (
https://support.process-one.net/doc/display/EXMPP/exmpp+home).
4. If you are looking to pass arguments to a process in a dynamic way via a
configuration file, see os:cmd/1 function from Erlang (e.g., Customer =
"Max", CustomerPhoneNumber = os:cmd("cat phone_agend.txt | grep
\""++Customer++"\" | awk'{print $2}' ", or Type = "video", Video =
"crazy_cow", os:cmd("exec $(cat mime.cfg | grep \""++Type++"\" | awk
'{printf("%s", $2)}')  "++Video)), where in mime.cfg you put a line `video
vlc'). Just use your imagination here. ;)

I hope this will help you. Good luck!

Cheers,
CGS



On Tue, Sep 13, 2011 at 2:05 PM, Max Lapshin <> wrote:

> On Tue, Sep 13, 2011 at 3:42 PM, Vlad Dumitrescu <>
> wrote:
>
> > Do I understand correctly that you would like to have a module loader
> > that accepts registrations for file type handlers and whenever it
> > doesn't find a .beam file for a module, asks these handlers if they
> > can find a source file and compile+load it? That would be cool.
>
> Exactly. But there is comment in code_server looking like "leave hope
> anyone, who is going to change this module, many brave Swedens are
> lying here"
> and I'm a bit afraid to edit it =)
>
>
> > The
> > only delicate issue I see right now is how to find these source files,
> > if the source directories aren't added to the code path.
> >
>
> I think, best behaviour is to look inside code path. No code path, no
> modules.
>
> I've tried to take  elixir and load it. Currently it is looking so
> (doesn't do any real job, just for example):
>
> digital_access.ex:
>
> module DigitalAccess
>  def check(host, name, options)
>    IO.puts "Called with #{host} #{name} #{options.inspect()}"
>    {ok, headers, reply} = Erlang.http_stream.get_with_body("http://ya.ru/",
> [])
>    url = "http://video.ru/movies/"+headers['"Content-Length"]
>    [{'type, 'file},{'url, url},{'file_access,'http_file}]
>  end
> end
>
>
>
> ()1> code:add_pathz(code:lib_dir(elixir,exbin)).
> true
> ()2> application:start(elixir).
> ok
> ()3> elixir:file("digital_access.ex").
> {{elixir_slate__,'exUnboundMethod::Behavior',
>                 [{arity,3},{name,check},{owner,exDigitalAccess}]},
>  []}
> ()4> SomeUnknownArgument = [].
> []
> ()5> 'exDigitalAccess':check([], default, <<"http://ya.ru/">>,
> [{url, <<"zzz">>}]).
> Called with default http://ya.ru/ [{'url,"zzz"}]
> [{type,file},
>  {url,<<"http://video.ru/movies/6747">>},
>  {file_access,http_file}]
> ()6>
>
>
>
> So it really looks very close to what I want, except module name and
> automatic loading.
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110913/a4f51923/attachment.html>


More information about the erlang-questions mailing list