[erlang-questions] Crazy Question: C -> Erlang Core

Robert Virding rvirding@REDACTED
Mon Nov 10 21:33:25 CET 2008


Yes, it would be possible 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
- global data is tricky
- many of the basic C data structures don't map easily to Erlang

If you did it you would end up writing C in a very functional style. But you
would get wonderful support for concurrency!

Robert

2008/11/10 Steve Davis <steven.charles.davis@REDACTED>

> This is the ultimate time-waster question, but interesting to consider
> (or at least I think so).
>
> Would it be possible to write a program (in erlang with yecc etc of
> course) that transforms C source into Erlang Core and thus allows it
> to compile to BEAM files? If not, suppose you put constraints on the
> kind of C program you wrote (and I'm wondering what those might be)?
>
> Ignore this if the question upsets you - I said it was crazy - also,
> responses including the BIF open_port are disallowed by the rules ;)
>
> /s
> *ducks*
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081110/68f9c1b0/attachment.htm>


More information about the erlang-questions mailing list