erlang

Run C Code Block in Erlang

How to Run C Code Block from Erlang? ( Or Call a C function from erlang? ) ...

Thread-ring benchmark

Today I was doing the thread ring exercise from the Programming Erlang book and googled for other solutions to compare. I found that the language shootout has exactly this the same problem as a benchmark. I had the impression that this is an area where Erlang should be fastest, but turns out that C and C++ are again on top. My suspicion ...

Erlang - Makefiles

Hope everyone is doing well I am having a problem with make files in erlang on windows. I can't seem to get the following code to work. .SUFFIXES: .erl .beam .erl.beam: erlc -W $< ERL = erl -boot start_clean MODS = main send get loops all: compile ${ERL} -pa 'G:\Documents and Settings\Administrador' -s main start co...

Erlang - C and Erlang

I am building a program that mainly parses binary data and does some number crunching on it. It's primary goal is to do it all as quickly as possible. It will be running on an 8 - 32 core machine [Xeon / Sparc T2]. I choose erlang becasue I beleive that concurrency is much easier as opposed to c++. However, about halfway through I start...

How to show effectiveness of Erlang for programming Robots?

Hi all, I am currently pursuing Masters in Embedded and for my thesis I have to study the effectiveness of Erlang for programming Robot. AFAIK Erlang's declarative nature and concurrency can be effective, so I made an Erlang code for "Adaptive cruise control" which takes sensor values from C program(because Erlang can not read sensor...

Erlang Programming: Will Learning Prolog Help?

Will learning Prolog help to learn Erlang in a way specific to Erlang? Erlang started as a concurrent Prolog, but is modern Erlang connected to Prolog (beyond syntax)? I understand that learning Prolog might be good in the way learning Lisp is good for programming in any language, but I want to know if learning Prolog will help me to lea...

Why Erlang process creation and message passing time less than java and C#

I was searching about process model of Erlang over internet and found out some graphs slides 3-4 in one of the talk given by Joe Armstrong. They shows a lot of difference between process creation and message passing time between Erlang , java and C#. Can anybody tell me the reason behind such big difference? ...

What is the significance of a Mnesia Master Node in a cluster

Iam running two erlang nodes with a replicated mnesia database. Whenever i tried to start one of them while mnesia ISNOT Running on the other one, mnesia:wait_for_tables(?TABS,?TIMEOUT), would hang on the node thats its called from. I need to have a structure where (if both nodes are not running), i can start working with one while the o...

Un-compressing gzipped data in Erlang

I have an Erlang app which makes a large number of http client calls using inets. I'd like to reduce my bandwidth bill by accepting gzipped data from servers that provide it. Is there an inets option that would handle this ? [can't find one]. Is there a zip library anyone could recommend ? [I've looked at the stdlib zip library, but it s...

Should separate Erlang applications share the same VM on the same machine?

I have a CouchDB instance running on one machine, and thus with its own Erlang VM process. If I have another separate Erlang application running on that machine too, is it be better to share the same VM between CouchDB and my application, or is it recommended to start a new Erlang node? ...

Reverse a Integer Erlang

I am looking for an easy way to reverse an integer in erlang. Example: 1234 to 4321. ...

CouchDB install on Linux crashing when running test suite

Hi I've been trying to install CouchDB on my webfusion virtual server. I followed the latest instructions from the webfusion forum (see: http://forum.webfaction.com/viewtopic.php?id=2355 ) and it runs (just) Futon is very sluggish and I get 502 errors. Anyway when I run the test suite it crashes and the browser hangs on the first two ba...

Erlang/OTP framework's error_logger hangs under fairly high load

My application is basically a content based router which will route MMS events. The logger I am using is the one that comes with the OTP framework in SASL mode "*error_logger*" The issue is :: I am using a client to generate MMS events with default values. This client (in Java) has the ability to send high load of events in multiple T...

List of strings to binary and back again

I've stumbled on a quite irritating problem; I'm trying to generate a binary of a string-list and back again. Eg erlang:binary_to_list(erlang:list_to_binary(["hello", "world"]) This will return "helloworld" and not a list with two different elements. Does anyone have any ideas of how to solve this? One solution might be to encode eve...

Erlang getting error ** 1: syntax error before: '->' **

Hi, I have started some hands on in Erlang and I am getting : ** 1: syntax error before: '->' ** whenever i am declaring any function for eg. to calculate sum of a list (this is experimental, of cource there is Built In Function for find sum of a list). sum([]) -> 0; sum([H | T]) -> H + sum(T). in erl shell (v 5.5.5). Thanks in adva...

ejabberd: installed, added users its working but ejabberdctl not working

installed ejabberd using synaptic package manager on Ubuntu 10.04 without any error. "sudo dpkg-reconfigure ejabberd" used to configure it. Added users too using http://localhost:5280/admin/ console. everything working fine except ejabberdctl command. knocker@ps0714-U:~$ ejabberdctl Failed RPC connection to the node 'ejabberd@ps0714-U'...

Using "oneway void" in Thrift function definitions

Hi all, I'm using a oneway modifier in one of my Thrift function definitions: ... oneway void secret_function(1: string x, 2: string y), ... When generating the respective Erlang code via Thrift, this is translated into: ... function_info('secret_function', reply_type) -> oneway_void; function_info('secret_function', exceptions) -...

Accessing socket from two processes

Is it allowed to have one process reading from and another process writing to a socket in Erlang? I have tried it and it appears to work but I would like to know if it's foolproof. ...

Erlang, membase and comet

Hello everyone, I was wondering if someone had already use this three technologies together. I know Erlang and Comet are widely used, buy I can't find anything related of Comet + Membase or Erlang + Membase. Are them together a bad idea for some reason? I'm doing a research using Freemind to map the ideas about these three technologie...

Problem with parallel quicksort in erlang

I am facing problem with writing quicksort in erlang. What I am doing is I am spawning two processes and then blocking the current process till I get the response from both the left and right sub-arrays. Getting both these responses I send a message to its parent giving it the computed list. Parent ! {self(), Lone ++ [H] ++ Ltwo} But I ...