Re:Ooc: new awesome language with site redesign, guide, and ...
by albertzeyer on Monday July 12, 2010 @04:30PM
(#1509310)
Why not just write the LLVM backend in C++? The C++ interface is actually pretty clean and really easy/trivial to use.
Re:Ooc: new awesome language with site redesign, guide, and ...
by nddrylliog on Monday July 12, 2010 @04:43PM
(#1509358)
Then we'd need to access the ooc AST from C++, which is also quite a piece of work. (I mean - it's easy to use ooc code from C in a C-like way, e.g. MyObject_myMethod(arg1, arg2), but in C++ that would be tedious/inacceptable)
Besides, what's the point in having a shiny language if we have to use C++ to implement part of its compiler :(
Re:Ooc: new awesome language with site redesign, guide, and ...
by albertzeyer on Monday July 12, 2010 @05:01PM
(#1509415)
Whoops, my bad, I didn't thought of the self-hosting. Somehow I thought that the compiler is written in C.
How complicated would it be to link against C++ code from within ooc code?
Re:Ooc: new awesome language with site redesign, guide, and ...
by nddrylliog on Monday July 12, 2010 @05:07PM
(#1509431)
Not too bad, use -linker=g++ and declare your functions extern "C" in the C++ code
Re:Ooc: new awesome language with site redesign, guide, and ...
by albertzeyer on Tuesday July 13, 2010 @09:10AM
(#1511197)
If it is easy, why not just use the LLVM C++ interface in the ooc compiler?
I only wish llvm-c would suck less, then we'd get proper bindings and be able to write the llvm backend in ooc.