[erlang-questions] BASIC DOUBT

Michael Truog mjtruog@REDACTED
Tue Oct 6 06:32:20 CEST 2009


Hi Sumit,

You probably want either an Erlang port driver, an Erlang port, or an
Erlang cnode.  These are the 3 main methods to communicate with C code. 
You probably want to read about them here: 
http://erlang.org/doc/tutorial/part_frame.html

An Erlang port driver runs within the Erlang VM process, and can cause
many problems with the system because of this.  An Erlang port runs
within its own process, spawned from a fork within the Erlang VM.  An
Erlang cnode can be an independent process that connects as a separate
hidden node, talking to other Erlang nodes on a socket and speaking a
protocol that uses Erlang terms or something else.

- Michael

Sumit Chatterjee wrote:
> Hi Michael,
>     Thanks for your response. It's because we wont to make it work in
> an embedded environment based on C. Could you please help me with some
> other diretion to port the solution then?
>
> Thanks
> Sumit
>
> 2009/10/6 Michael Truog <mjtruog@REDACTED <mailto:mjtruog@REDACTED>>
>
>     Hi Sumit,
>
>     I am not sure why you are asking this question.  However, Erlang code
>     runs on a Virtual Machine.  Code can run partially native when HIPE is
>     used.  There does not seem to be a current project to convert Erlang
>     code to C code, since that would remove some of the benefits the
>     language currently has when ran on the Virtual Machine.
>
>     - Michael
>
>     Sumit Chatterjee wrote:
>     > how can i convert the erlang files to c source code?
>     > Thanks
>     > Sumit
>     >
>     > 2009/10/6 Cameron Kerr <ckerr@REDACTED
>     <mailto:ckerr@REDACTED>>
>     >
>     >
>     >> Tomas Abrahamsson wrote:
>     >>
>     >>
>     >>> Richard Carlsson wrote:
>     >>>
>     >>>
>     >>>> Yes, this is a known problem. The short answer is that the input
>     >>>> encoding for Erlang source code is defined to be Latin-1. [...]
>     >>>> What would be needed is something like a \u-escaping
>     preprocessing
>     >>>> stage, as specified for Java. But then, the tools must also know
>     >>>> about \u escape sequences and turn them back into the proper code
>     >>>> point in UTF-8 or whatever.
>     >>>>
>     >>>>
>     >>>>
>     >>> An option could be to adopt the way it is done in Python:
>     >>> it (re)uses the editor's encoding declaration. If it finds the
>     text
>     >>>   -*- coding: utf-8 -*-  or  vim: set fileencoding=utf-8 :
>     >>>
>     >>>
>     >>>
>     >> There is already a way to indicate whether something is UTF-8
>     (or UTF-16BE
>     >> or UTF-16LE for that matter), and that is a byte-order mark;
>     although the
>     >> BOM serves no useful byte-ordering semantic for UTF-8, it does
>     also have the
>     >> function of saying "hey, I'm UTF-8!", a message which numerous
>     programs
>     >> understand.
>     >>
>     >>
>     >>
>     >> ________________________________________________________________
>     >> erlang-questions mailing list. See http://www.erlang.org/faq.html
>     >> erlang-questions (at) erlang.org <http://erlang.org>
>     >>
>     >>
>     >>
>     >
>     >
>
>



More information about the erlang-questions mailing list