Yes, it would be possible but there would be quite severe restrictions on the C you could write. Three main ones are:<br><br>- no destructive operations on data as all data is immutable in Erlang<br>- global data is tricky<br>
- many of the basic C data structures don't map easily to Erlang<br><br>If you did it you would end up writing C in a very functional style. But you would get wonderful support for concurrency!<br><br>Robert<br><br><div class="gmail_quote">
2008/11/10 Steve Davis <span dir="ltr"><<a href="mailto:steven.charles.davis@gmail.com">steven.charles.davis@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is the ultimate time-waster question, but interesting to consider<br>
(or at least I think so).<br>
<br>
Would it be possible to write a program (in erlang with yecc etc of<br>
course) that transforms C source into Erlang Core and thus allows it<br>
to compile to BEAM files? If not, suppose you put constraints on the<br>
kind of C program you wrote (and I'm wondering what those might be)?<br>
<br>
Ignore this if the question upsets you - I said it was crazy - also,<br>
responses including the BIF open_port are disallowed by the rules ;)<br>
<br>
/s<br>
*ducks*<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br>