erlang

Should a client handling process be added to the supervisor tree?

Hi, in Erlang I have a supervisor-tree of processes, containing one that accepts tcp/ip connections. For each incoming connection I spawn a new process. Should this process be added to the supervisor tree or not? Regards, Steve ...

Replace keys in a tuple in Erlang

I have a list of tuples eg. [{1,40},{2,45},{3,54}....{7,23}] where 1...7 are days of the week (calculated by finding calendar:day_of_the_week()). So now I want to change the list to [{Mon,40},{Tue,45},{Wed,54}...{Sun,23}]. Is there an easier way to do it than lists:keyreplace? ...

Gaining a better understanding of functional programming

What would you recommend for an experienced OO programmer who wants to learn more about functional programming? Since reading Mark Dominus's Higher Order Perl, I've begun using more functional techniques in my day-to-day work, such as closures, currying, and lazy evaluation. However, Perl is of course not a purely functional language (...

lists:usort for nth element in tuple

I need to sort tuples according to the second element of each tuple but apparently usort/1 only works with the first element. So I have to swap the elements, usort them and swap back.Is there an easier way?Also is there a way to sort in descending order (I know sorting and reversing can be done, but just want to know). ...

Why is MPI considered harder than shared memory and Erlang considered easier, when they are both message-passing?

There's a lot of interest these days in Erlang as a language for writing parallel programs on multicore. I've heard people argue that Erlang's message-passing model is easier to program than the dominant shared-memory models such as threads. Conversely, in the high-performance computing community the dominant parallel programming model...

Best Practice: Erlang Application Deploy on windows.

When deploying a ready to use erlang application I don't want the user to Find the right erl release on the internet. Install the erl vm unzip and decide a location for the beam files (with the application) read a readme modify anything that even looks like a config file I have a couple of ideas of what could be a way but I would li...

Why is Erlang crashing on large sequences?

I have just started learning Erlang and am trying out some Project Euler problems to get started. However, I seem to be able to do any operations on large sequences without crashing the erlang shell. Ie.,even this: list:seq(1,64000000). crashes erlang, with the error: eheap_alloc: Cannot allocate 467078560 bytes of memory (of type ...

Is it possible to develop a Powerful WEB Search Engine using Erlang, Mnesia & YAWS???

I am thinking of developing A Web search Engine using Erlang, Mnesia & YAWS. Is it possible to make powerful & fastest WEB SEARCH ENGINE using these???? What will it need to accomplish this & HOW to start with???? If you have any suggestions, I'll be greatful to you. ...

Profiler/Analyzer for Erlang?

Are there any good code profilers/analyzers for Erlang? I need something that can build a Call graph for my code. ...

Architectural comments for queueing with RabbitMQ ?

I basically need a queueing technology that will enable to queue messages. These messages will then later be transmitted as SMS texts. RabbitMQ seems to be quite a good fit after I glossed over the apis. My current architecture plans: clients queue messages in RabbitMQ. Another daemon will reads messages off RabbitMQ and sends those ...

YAWS fronting Tomcat

Is there currently any easy way to set up a YAWS web server in front of Apache Tomcat Servlet container, similar to popular Apache httpd + Tomcat set up? ...

How do I make an already written concurrent program run on a GPU array?

I have a neural network written in Erlang, and I just bought a GeForce GTX 260 card with a 240 core GPU on it. Is it trivial to use CUDA as glue to run this on the graphics card? ...

Adding nodes dynamically and global_groups in Erlang

Erlang support to partition its nodes into groups using the global_group module. Further, Erlang supports adding nodes on the fly to the node-network. Are these two features usable with each other? As far as I understand, you have to name every node on startup to use the global groups. ...

Erlang syntax

Hi folks, I'm going to create Erlang language support plugin for an Intellij Idea. The big and first problem I have is in the JFlex erlang syntax definition. Does anybody know where can I get EBNF or BNF for Erlang? ...

Can someone explain the structure of a Pid in Erlang?

Can someone explain the structure of a Pid in Erlang? Pids looks like this : <A.B.C> , e.g. <0.30.0> , but i would like to know what is the meaning of these three "bits" : A, B and C. 'A' seems to be always 0 on a local node, but this value changes when the Pid's owner is located on another node. Is it possible to directly send a mes...

What is the fastest webserver solution with the lowest memory footprint?

I need a webserver to serve up very simple POST/GET requests as JSON. I don't need MVC, Rails, Django. I need something that takes up very little memory, preferrably around 5K per reqeust. The webserver will talk to backend services like Scribe using Facebook Thrift. Each http request will also access a SQLLite database, one for each...

Message Passing Concurrency Library for C?

I've been looking around, but I can't seem to find a message-passing concurrency (Actor) library for C (not C++). Ideally the candidate would be based on something like libevent underneath allowing for non-blocking I/O in most places. Does anyone know of such a library? ...

Is it possible to perform arbitrary data analysis in Erlang?

I want to answer questions about data in Erlang: count things, correlate messages, provide arbitrary statistics. I had thought about resorting to Hadoop for this but is it possible to build a solution in raw Erlang to do rather arbitrary data analysis not necessarily via map/reduce but somehow? I have seen some hints of people doing t...

Is it possible to build work queues in Erlang?

I have seen lots of chat examples in Erlang but what about lists, like a work queue? If I want to build a work queue system, like a project management system, is it possible to re-order messages in a process mailbox or do I have to use message priorities? Are there examples of workflow systems built in Erlang? ...

Is there a specification of the group leader protocol that handles IO?

In Erlang, every process has a group leader, and when a process wants to print something (i.e. it calls the io library or does something similar), it will send a message to its group leader. My question is, where can I find the specification of these messages? Or in general, the specification of what a group leader should do? I managed...