erlang

Erlang JInterface - is OtpMBox thread-safe?

In my Java program, I create a OtpNode and a "named" OtpMBox. Whenever a message is received via this mbox, some time-consuming operation needs to be performed after which a reply message is sent back. Since this operation is time-consuming, subsequent messages sent to the mbox won't be processed immediately. So I want to use Java thre...

Suitable data storage backend for Erlang application when data doesn't fit memory

I'm researching possible options how to organize data storage for an Erlang application. The data it supposed to use is basically a huge collection of binary blobs indexed by short string ids. Each blob is under 10 Kb but there are many of them. I'd expect that in total they would have size up to 200 Gb so obviously it cannot fit into me...

Erlang - code analysis

I have to analyse some existing Erlang code. Does anybody knows about a tool able to visually / graphically trace the modules calls ? The behaviour should be : give a directory containing the source code, and get a gui / picture / file of the calls (module1->module2->module3....). Something like an UML reverse-engineering, but ala Erl...

Warnings about unused variables in Erlang

I recently started Erlang, and I notice I constantly get "Warning: variable X is unused" while compiling. For example, take the following function, which finds the maximum element in a list: max([Head|Tail]) -> max(Head,Tail). max(Element,[Head | Tail]) when Element < Head -> max(Head,Tail); max(Element,[Head...

Is erlang going to be the next big language?

From what I have heard, erlang is next java. Is that true? I mean all it needs is support from SUN/IBM/MS. And we are in business. Waiting for your comments. ...

How do you do modulo or remainder in Erlang?

I'm brand new to Erlang. How do you do modulo (get the remainder of a division)? It's % in most C-like languages, but that designates a comment in Erlang. Several people answered with rem, which in most cases is fine. But I'm revisiting this because now I need to use negative numbers and rem gives you the remainder of a division, which ...

Any way to convert a regular string in ActionScript 3 to a ByteArray of Latin-1 Character Codes?

I am having no problem converting a string to a byteArray of UTF-16 encoded characters, but the application I am trying to communicate with (written in Erlang) only understands Latin-1 encoding. Is there any way of producing a byteArray full of Latin-1 character codes from a string within Actionscript 3? ...

Should i write my own flash-server in Erlang or use Red5?

I'm a student about to start my exam project, where I will be responsible for the server implementation of an online game targeting the flash player. I have a hard time to decide wether i should write my own lightweight server in Erlang or use the open source Red5. My experience is that java-developers tend to overcomplexify things mak...

What are some good Erlang Primers/Tutorials for beginners?

What are some good links for diving into Erlang and functional programming in general? ...

What's the best way to unit test concurrent Erlang code?

I'm spending a bit of time with Erlang, and I'm wanting to apply TDD to code I'm writing. While EUnit in the standard lib provides a nice traditional unit testing framework for testing regular style code, there doesn't seem to be anything to help specifically with testing concurrent code, which is used a LOT in Erlang. Note that we're ...

What are some interesting projects to solve in Erlang for learning purposes?

I recently discovered Erlang and am now working my way through a couple of tutorials. By now I'm looking forward to actually implement something as a hobby project. I'm not really interested in yet another chat server. I would like to code something more interesting (yes I'm aware that this is a rather fuzzy term) which is also manageabl...

[Erlang] binary format, bitwise operations exist? eg. <<16#7F, 16#FF>> bsl 1

...

Haskell for a server?

With regards to making a game server, it seems Erlang always comes up as a language that is "built for this kind of thing" with its scalability and concurrency features. I don't have experience in either Haskell nor Erlang, but on the surface they seem the same. Looking into Haskell's docs it seems like it has support for multiprocessor ...

Preserving relational integrity with Mnesia

I've been diving into Erlang recently, and I decided to use Mnesia to do my database work given it can store any kind of Erlang data structure without a problem, scale with ease, be used with list comprehensions, etc. Coming from standard SQL databases, most rows can and should be identified by a primary key, usually an auto-incrementin...

How to ensure fast startup times of mnesia

Erlang with mnesia/dets is famous for it slow startup times after a crash. Basically the same issue as with fsck on older filesystems. But I also experience slow startup times after regular shutdowns: about 8 Minutes for 250 MB on-disk data on a beefy machine. So I have to do something special on shutdown besides typing "q()."? Is ther...

Are there libraries to perform xslt transformation in erlang?

I'm really new to erlang and I'm wondering how to manipulate xml. I've found erlsom but I need to do some simple transformation on a xml. I'm looking for an xslt (even 1.0) library, but I haven't found anything and reduced myself to do the transformations by hand working on the DOM, or whatever you can call a structure representing the...

Printing named parameters [solved?]

Archaelus suggested in this post that writing a new format routine to handle named parameters may be a good learning exercise. So, in the spirit of learning the language I wrote a formatting routine which handles named parameters. An Example: 1> fout:format("hello ~s{name}, ~p{one}, ~p{two}, ~p{three}~n",[{one,1},{three,3},{name,"Mike...

Flash communication with Erlang server

This is an erlang problem, it seems. I have this code to test the client sending data, written in Actionscript 3: var socket:Socket=new Socket("localhost", 2345); socket.addEventListener(Event.CONNECT, connected); private function connected(event:Event):void { socket.writeInt(12); //packet length, should be correct? 4 bytes each? ...

Naming nodes in Erlang

I'm playing with the distributed programming tutorial from the 5.4 documentation, and have run into a problem with node names. My MacBook's default name (jamess-macbook) does not play well with Erlang's node-naming scheme, due to the dash: (salt@jamess-macbook)4> {my_process, pepper@jamess-macbook} ! start ** exception error: bad argum...

What is the storage capacity of a Mnesia database?

Some places state 2GB period. Some places state it depends up the number of nodes. ...