[erlang-questions] Crazy Question: C -> Erlang Core
Thu Nov 13 16:40:22 CET 2008
C Flavoured Erlang???
Converting existing C projects to such a language would be a challenge. Even
if you could transform the language elements, calls to standard libraries
would need to be replaced with OTP.
2008/11/13 Alceste Scalas <>
> Il giorno lun, 10/11/2008 alle 21.33 +0100, Robert Virding ha scritto:
> > Yes, it would be possible [to compile C in Core Erlang] but there
> > would be quite severe restrictions on the C you could write. Three
> > main ones are:
> > - no destructive operations on data as all data is immutable in Erlang
> You could simulate destructive operations by using fresh variables. In
> other words, you could convert your C code into SSA (Static Single
> Assignment) form  and then compile it almost directly into Core
> That's what we are doing for compiling a Matlab-like language into Core
> Erlang. See .
> > - global data is tricky
> ...and very slow (you could simulate global variables using a server
> > - many of the basic C data structures don't map easily to Erlang
> Furthermore, if you need something like pointer arithmetics, you will
> need to simulate the memory as a global variable. Not very fun...
>  Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman,
> and F. Kenneth Zadeck. Efficiently computing static single
> assignment form and the control dependence graph. ACM
> Transactions on Programming Languages and Systems (TOPLAS),
> 13(4):451-490, 1991.
>  Alceste Scalas, Giovanni Casu and Piero Pili. High-performance
> Technical Computing with Erlang. Presentation at the VII ACM
> SIGPLAN Erlang Workshop, Victoria, British Columbia, Canada,
> September 27, 2008.
> Alceste Scalas <>
> CRS4 - http://www.crs4.it/
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions