erlang

Ejabberd Memory Consumption (or Leak?)

I'm using ejabberd + mochiweb on our server. The longer I keep ejabberd and mochiweb running, the more memory is consumed (last night it was consuming 35% of memory. right now it's a bit above 50%). I thought this was just a mnesia garbage collection issue - so I installed Erlang R13B3 and restarted ejabberd. This didn't fix it thoug...

Erlang and processes.

Hi all, I'm very new to Erlang and I'm currently reading Joe Armstrong's book, chapter 'concurrent programming'. I'm trying to run a list of processes to calculate if a number is a prime (naive method). But my code runs as if there was no processes. Both methods have the same duration. Where am I wrong ? shell.erl: c(prime). %a list ...

Variable length of function argument list in Erlang.

Is it possible to define function with argument list of variable length? I know I can write just: function() -> function([]). function(X) when not is_list(X) -> function([X]); function(X) -> do_something_with_arguments(X). But I want to avoid this technique. ...

NoSql - which is best for my needs - i am having mental breakdown

I am building a Reddit clone in Erlang. I am considering using some erlang web frameworks but this is not the problem. I am having a problem selecting a database. How it works; I have multiple dedicated reddits. Examples, science, funny, corporate, sport. You could consider them sub reddits. Each sub reddit has categories. A user c...

Same Machine Erlang communication

I need an answer to the following question to help understand what approach I should be taking to interface with Erlang. AFAIK Erlang on a SMP UNIX box uses the multi-process approach. In this case it should do same machine IPC. Does Erlang use UNIX domain sockets for UNIX ? Does it use named-pipes for windows ? If it does not implem...

Erlang Documentation/SMP: single-node and multi-node per machine or per application, and the confusion that may follow.

I'm studying Erlang's process model at the moment. I have hit a snag in a tech report (section 3, paragraph 2) on Erlang: This explains why it in some cases can be more efficient to run several SMP VM's with one scheduler each instead on one SMP VM with several schedulers. Of course the running of several VM's require that the ap...

.erlang file in windows

Hi, there, I am reading Joe Armstrong's book on Erlang, "Programming Erlang: software for a concurrent world." In a couple of places he talks about a .erlang file that lives where the erlang library lives, and it is supposed to let you change your environment. I have tried it a few times, but nothing really seems to happen. Is the n...

erlang - startup script

To start my program I do the next sequence: $ erl > c(module1). > c(module2). > c(modulen). modulen:start(). Is there any possibility to create script that allow me to launch my program ? ...

Erlang : Returning from a function

I have a function in which I have a series of individual case statements. case ... of ... end, case ... of ... end, ... etc. I want to return from the function immediately when a particular case condition occurs in one of the case statements - so that the next case statement is not checked, and the function just exits/re...

Erlang compound boolean expression

I am still finding my feet with erlang, and I read the documentation about using "and", "or" operators, but why is the following not evaluating? X = 15, Y = 20, X==15 and Y==20. I am expecting for a "true" in the terminal, but I get a "syntax error before ==". ...

Erlang : Traversing N by N area

I am looking to traverse a NxN area, given the starting points X,Y and the size of the square to traverse. E.g. given X=10,Y=12,Size=2 - i want to generate 10,10 ; 10,11 ; 11,10 and 11,11. I came up with this, but it seems to go on and on infinitely: traverse({X,Y,Xend,Yend}) -> % print X,Y values here.... case (X == Xen...

Where does Nitrogen get the best performance - yaws, mochiweb, or inets?

The Nitrogen project web page declares equal support for yaws, mochiweb, and inets, but with which of these web servers is it going to perform the best? I.e. for a large scale application with mostly dynamic content with nitrogen + a web server which combination will be able to handle the most user load? ...

couchDB: storing MB per document

I am analyzing couchDB at the moment. Is it possible to storage MB worth of data per document? E.g. a JPEG image. I understand I would need to encode (base64 or something) the said data in order to fit the JSON container. Practical advice sought please. ...

How to make two different source directories in a Makefile output to one bin directory?

I have the following Makefile to build my erlang project: .SUFFIXES: .erl .beam .yrl ERL_SRC := $(wildcard src/*.erl) ERL_OBJ := $(patsubst src/%.erl,ebin/%.beam,${ERL_SRC}) all: main main: ${ERL_OBJ} ebin/%.beam: src/%.erl erlc +debug_info -W -o ebin $< clean: rm -fr ebin/*.beam I'm trying to update this to also ...

what good orm api will work well with scala or erlang

I'm considering taking up scala programming but i'm really concerned about what will become of my ORM based applications. I currently use hibernate as my ORM and i find it a really reliable tool. I'd like to know if there's any ORM tool as efficient but written in scala, or will hibernate work seamlessly with it. i don't want to have to ...

Mnesia asynchronous transaction

I would like to have a master-slave setup of Erlang nodes, where read and write operations happen on the master node only. Slave nodes are only kept as hot-standbys. As I understand the default behavior of Mnesia is to acquire the lock synchronously on all nodes before executing the write operation. This would result in high latency esp...

Fail to open a socket for multicast

Hi, I have problems to open an multicast socket in Erlang to receive messages: 88> gen_udp:open(5353,[{reuseaddr, true}, {ip,{224,0,0,251}},{multicast_ttl,4},{multicast_loop,false},binary]). {error,eaddrnotavail} I checkt diffrent IP addresses and ports and the option {active, false}, but nothing helps. What could be the reason? Tha...

Erlang vs. UI development as a career move

To expand on my previous question from here: UI Development vs Server Side Development As a career move, between the choices of server sided Erlang development and UI development (especially for handheld devices), what are the pros and cons as a careerwise decision? They both seem to me as very relevant in their respective areas. ...

An erlang database schema generator

Is there a way I can generate a database schema from an erlang application like I can do with hibernate. ...

Functional Programming: what is an "improper list" ?

Could somebody explain what an "improper list" is? Note: Thanks to all ! All you guys rock! ...