[erlang-questions] Crazy Question: C -> Erlang Core
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!
2008/11/10 Steve Davis <>
> 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 ;)
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions