erlang

Is it ever a good idea to use association lists instead of records?

Would any experienced Erlang programmers out there ever recommend association lists over records? One case might be where two (or more) nodes on different machines are exchanging messages. We want to be able to upgrade the software on each machine independently. Some upgrades may involve adding a field to one (or more) of the messag...

Why no dynamic bit pattern in function argument?

I am experimenting with bit pattern matching in Erlang: -module(test). -export([test/2]). %test(P,<<X:P,0:1>>) -> % X. test(P,X) -> <<Y:P,0:1>> = X, Y. when compiling the commented out version of test/2 i get a complaint that "variable 'P' is unbound". Is there any good reason for not allowing the first version to work th...

Is Erlang designed only for running on a single multicore machine, or can you distribute the processes?

My app runs well on my quad-core machine. It is 'embarrasingly parallel', with about 100K processes, and thus nicely suited to run on a cluster of machines. However, I have trouble finding documentation on how to spread all those processes out on all available nodes in the cluster. The documentation for distributed Erlang seems to focus...

ejabberd compile error

I'm a huge erlang noob, and while compiling ejabberd, I get this error: make[1]: Entering directory `/usr/src/ejabberd-2.0.5/src/mod_muc' /usr/local/bin/erlc -W -I .. -pz .. -o .. mod_muc_room.erl Function: '-process_admin_items_set/4-fun-0-'/2 ./mod_muc_room.erl:none: internal error in v3_codegen; crash reason: {{case_clause, ...

What's the best way to do something periodically in Erlang?

I have a process that needs to do some work every fifteen seconds. I'm currently doing it like this: -behavior(gen_server). interval_milliseconds ()-> 15000. init()-> {ok, _State = FascinatingStateData, _TimeoutInterval = interval_milliseconds () }. %% This gets called automatically...

Erlang on a JVM/CLR

I've just started reading Joe Armstrongs book on Erlang and listened to his excellent talk on Software Engineering Radio. Its an interesting language/system and one whose time seems to have come around with the advent of multi-core machines. My question is: what is there to stop it being ported to the JVM or CLR? I realise that both vi...

Handling .Net UTF-8 strings in Erlang

Hello, I'm playing a bit with erlang and the distributed db Mnesia. One of the first problem I'm facing is the incompatibilty beetween the 'int list' strings of erlang and .Net UTF-8 strings. Is there any good conversion library? Thanks ...

SOAP web services in erlang

Hello, Is there any good erlang library for creating / accessing SOAP web services? Maybe also handling plain XML is quite difficult. Is Json a good alternative? Any lib for that? My goal is interop with existing .Net web services. Thanks ...

How to add a node to an mnesia cluster?

Hello, I'm an erlang and mnesia newbie.. How do I add a new disc_only_copies node to an mnesia database that already has a schema? Thanks ...

how to do actors (erlang) in java?

I work on financial applications in Java and getting concurrency right is pain. Erlang and the actors model is supposed to be a good fit for massively concurrent applications but I can't figure out how to do it in Java. I know there are libraries such as Jetlang, FunctionalJava, kilim, etc., but they don't usually go beyond simplistic ...

Erlang Implementation of A Star Search Algorithm

Hi all, I need an Erlang implementation of the A* search algorithm. Any pointers? ...

Erlang vs The Real/Outside world, how to comunicate?

Hello, I'm learning erlang and I'm very fascinated by the mnesia db. I want to build some real world application in C# / F# using erlang as backend. I'm searching for a good solution to communicate with erlang nodes from the outside world. What I found so far: (A) OTP.net, an opensource .net library implementing the 'native' erlang c...

Implementing ESB (Enterprise Service Bus) in a functional language

I am hoping that an architecture question is reasonable on Stackoverflow, so I am asking this here. I have been trying to see where a functional language would be useful outside of math-oriented problems, and it dawned on me that an ESB (Enterprise Service Bus) would be perfect for a FP language, as there isn't anything shared between r...

how do I remove an extra node

I have a group of erlang nodes that are replicating their data through Mnesia's "extra_db_nodes"... I need to upgrade hardware and software so I have to detach some nodes as I make my way from node to node. How does one remove a node and still preserve the data that was inserted? [update] removing nodes is as important as adding them....

functional languages (erlang, f#, haskell, scala)

Hi, 1) Are functional languages suited for web applications development ? 2) Are functional languages suited for business/erp/crm type of applications ? ...

Convert timestamp to datetime in erlang

How can I convert a timestamp (number of milliseconds since 1 Jan 1970...) to Date or DateTime format in Erlang? Something like {Year,Month,Day}. ...

Simulate a set of airplanes in Erlang

Hello. I have a problem in one of my practical works to the university. This work is on Erlang and I have to build an Airplane Traffic and Collision Avoidance System. My problem is: how can a simulate an airplane trajectory, taking into account the velocity? I thought of using a process... Does anyone have some idea? Best reguards. ...

How can I restore process state after a crash?

What's a good way to persist state when restarting a crashed process? I have a supervisor in an OTP application what watches several "subsystem" gen_servers. For example, one is a "weather" subsystem that generates a new weather state every 15 minutes and handles queries for the current state of the weather. (Think the lemonade stand ...

Is there an ipython equivalent for erlang?

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. ...

Remove Whitespace using Erlang Regex

Hello, T = {xmlelement,"presence", [{"xml:lang","en"}], [{xmlcdata,<<"\n">>}, {xmlelement,"priority",[], [{xmlcdata,<<"5">>}]}, {xmlcdata,<<"\n...