erlang

What is Erlang's secret to scalability?

Erlang is getting a reputation for being untouchable at handling a large volume of messages and requests. I haven't had time to download and try to get inside Mr. Erlang's understanding of switching theory... so I'm wondering if someone can teach me (or point to a good instructional site.) Say as a thought-experiment I wanted to port ...

where can I find good erlang reference for "BIFs" ?

I have Programming Erlang book already and I use http://www.erlang.org/ site. But I can't find good reference site for BIFs and modules like lists:duplicate. I found brief explanation from the end of Programming Erlang book but I need more ;( (about parameters, example code.. etc) anybody can help me out about this? thanks ...

erlang type system

hello I've been scrounging around the web looking for various typing practices of Erlang programs and there seem to be a few... although its somewhat difficult to find a solid source of info namely Im looking for practical info about: 1."-specs" - this one looks pretty attractive. a few places mention that the functions that have an ass...

Erlang frames - dictionary datatype

I ran into some texts about the introduction of a "frame" datatype into Erlang, basically a dictionary(associative array) type thats common in other languages... one that would be preserved at runtime (unlike records)... any ideas about where this innitiative is at? will it be implemented in R13? R14? would be very usefull... I used "d...

Erlang, list comprehension syntax

I saw this code in Erlang: [X-$0 || X<-someFun()] In that line I found the -$0 syntax very useful. I read the code and estimated what it means, but I'm not quite sure: is it split all numbers? I'd like to see the explanation or man page of that syntax but I can't find it. Can anyone show me the right page? ...

Using two(multi) dimensional array in Erlang

These days I'm solving Project Euler problems in Erlang. Since I'm a C++ programmer from the beginning, sometimes I really want to code using two dimensional arrays. One of my idea is to use tuples and lists like this: List=[{X,0}||X<-lists:seq(1,3)] {1,0} {2,0} {3,0} Is there nice way to implement multidimensional arrays in Erlang,...

What problem characteristics promote the use of parallel/concurrent architectures?

I am quite excited by the possibility of using languages which have parallelism / concurrency built in, such as stackless python and erlang, and have a firm belief that we'll all have to move in that direction before too long - or will want to because it will be a good/easy way to get to scalability and performance. However, I am so u...

What is Erlang written in?

What is Ericsson's implementation of Erlang and Erlang/OTP written and compiled in? Is is assembly, C or Erlang itself? Update 1: Thanks to DrJokepu. If I understand correctly, Erlang source-to-VM compiler is written in Erlang itself. But the VM is written in C. Update 2: Hynek-Pichi-Vychodil pointed out a lot of details. VM and HW i...

Protocol simplicity versus "properness"

I have another argument with a friend of mine. Consider having a need to design a simplistic JSON-based protocol, which is basically used to send sort of events (messages) between parties. Say, something like { event_id: 1, chat_message: "Hello" } { event_id: 2, group_id: 3, presence: "online" } ... I propose to keep this protoc...

Design patterns for Agent / Actor based concurrent design.

Recently i have been getting into alternative languages that support an actor/agent/shared nothing architecture - ie. scala, clojure etc (clojure also supports shared state). So far most of the documentation that I have read focus around the intro level. What I am looking for is more advanced documentation along the gang of four but in...

Erlang - spawning processes and passing arguments

I keep running into this. I want to spawn processes and pass arguments to them without using the MFA form (module/function/arguments), so basically without having to export the function I want to spawn with arguments. I've gotten around this a few times using closures(fun's) and having the arguments just be bound values outside the fun(t...

Is Erlang ready for business applications?

I would really like to know about support for the following in Erlang. Support for Windows COM. COM support in itself covers all requirements regarding accessing Access, Excel and Word documents. Both read and write. PDF generation and printing. Note printing is easy if it can be done on a Windows printer server. And many printers don'...

pattern matching - implementation

hello Im wondering how pattern matching is usually implemented. for example in Erlang do you think its implemented at the byte-code level(there's a bytecode for it so that its done efficiently) or is it generated as a series of instructions(series of bytecodes) by the compiler? it is such a useful thing that I just have to put it into a...

erlang BEAM bytecode

hello well I hope Im not breaking some spamming rule here with this. I just asked a question about how the erlang compiler implements pattern matching, and I got some great responses, one of which is the compiled bytecode (obtained with a parameter passed to the c() directive): {function, match, 1, 2}. {label,1}. {func_info,{ato...

convert an integer to a string in Erlang

I know, Erlang strings should be avoided at all costs... but if I'm not doing that, how do I produce "5" from 5? in particular, is there anything like io:format("~p",[5]) that would return a formatted string instead of printing to a stream? ...

Is there an easier way to modify a value in a subsubsub record field in Erlang?

So I've got a fairly deep hierarchy of record definitions: -record(cat, {name = '_', attitude = '_',}). -record(mat, {color = '_', fabric = '_'}). -record(packet, {cat = '_', mat = '_'}). -record(stamped_packet, {packet = '_', timestamp = '_'}). -record(enchilada, {stamped_p...

How do I concatenate two binaries in Erlang?

How do I concatenate two binaries in Erlang? For example, let's say I have: B1 = <<1,2>>. B2 = <<3,4>>. How do I concatenate B1 and B2 to create a binary B3 which is <<1,2,3,4>>? The reason I am asking this is because I am writing code to encode a packet for some networking protocol. I am implementing this by writing encoders for th...

How, if at all, do Erlang Processes map to Kernel Threads?

Erlang is known for being able to support MANY lightweight processes; it can do this because these are not processes in the traditional sense, or even threads like in P-threads, but threads entirely in user space. This is well and good (fantastic actually). But how then are Erlang threads executed in parallel in a multicore/multiproces...

How do you design a schema to efficiently query nested items in a key-value database?

I'm using Mnesia with Erlang, but this question applies to any key-value db like couchdb, etc. I'm trying to break free of the RDBMS thought process, but I can't wrap my head around how to efficiently implement this kind of schema. Say I have a User record, and he has many SubItemA records, which has many SubItem B records, so: User -...

What weaknesses can be found in using Erlang?

I am considering Erlang as a potential for my upcoming project. I need a "Highly scalable, highly reliable" (duh, what project doesn't?) web server to accept HTTP requests, but not really serve up HTML. We have thousands of distributed clients (other systems, not users) that will be submitting binary data to central cluster of servers fo...