[erlang-questions] reading traces from a file in c/c++

Serge Aleynikov serge@REDACTED
Thu Oct 21 21:50:55 CEST 2010

Hi Joel,

I don't have an immediate solution to your question, but this has been 
on my to-do list for a while as I am in the process of rewriting the EPI 
(http://www.erlang.org/pipermail/erlang-questions/2005-March/014930.html, http://code.google.com/p/epi/) 
to make certain Erlang-like features available in C++.

What I got working so far is:

1. Support for all types of terms: long/double/string/atom/pid/port/ref 
via reference counting or copying depending on object's footprint.  All 
terms are pretty intelligent and lightweight in a way that you never 
need to call new/delete in your code.
2. Support for an atom table.
3. All the marshaling/demarshaling functionality.
4. Distributed client-side connectivity to Erlang nodes and appropriate 
epmd connectivity for port discovery.
5. Support for mailboxes with fully asynchronous API allowing making 
non-blocking mailbox::recv() calls with completion notifications.
6. The entire application can run in a single thread (everything is 
non-blocking) or many threads if needed (currently using boost::asio for 
event looping, dispatching and networking).

The next item on my to do list is to add server-side support for 
creating a C++ Erlang node with epmd registration.

Reading Erlang terms from a file can be accomplished by writing a 
boost::spirit based parser, and a similar example is available here:


I am planning to release the project to public once it's in somewhat 
more complete and working stage.  However, if you wish to contribute, 
and write a parser to read and transform a text file in Erlang terms 
from my C++ library, there's room for some joint work.


On 10/21/2010 9:08 AM, Joel Reymont wrote:
> What is the easiest way to incrementally read through a file of Erlang traces outside of Erlang?
> I could not see any functions for reading terms from file in the ei library.
> Is it a matter of always reading in a chunk big enough for any term, trying ei decoding functions and reading more of the same chunk if decoding fails?
> 	Thanks, Joel
> ---
> http://twitter.com/wagerlabs
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED

More information about the erlang-questions mailing list