On 13/05/2008, at 2:15 AM, Erick Tryzelaar wrote:
>
> Now that I've organized the compiler a bit, it's starting to get a
> little easier to see how we could do an [LLVM](http://llvm.org)
> backend for felix. One of the many challenges we'll have to deal
> with for that is what do we do for a foreign function interface. For
> those who don't know, one of the neat things felix does is compile
> into C++ code. This lets us easily define adds like this:
>
> {{{
> :::felix
> fun add: int * int -> int = "$1 + $2";
> fun sin: float -> float = "std::sin($1)";
> }}}
>
> {{{
> :::felix
> fun add: int * int -> int = "`(add ,_1 ,_2)";
> fun sin: float -> float = "`(ccall std::sin ,_1)";
> fun foo: int * int * int -> int = "`(add ,_1 `(sub ,_2 ,_3))";
> }}}
>
The likely problem is that no two languages have the same architecture,
if they did .. why bother with another language?
C and C++ are exceptions here, since one is derived from another.
--
john skaller
[EMAIL PROTECTED]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language