News for hackers. Stuff that matters.
Re:Ooc: new awesome language with site redesign, guide, and ... by albertzeyer on Monday July 12, 2010 @04:12PM (#1509236)
You mean ooc -> (rock ->) C -> (clang ->) llvm?

I mean ooc -> llvm.

Not only that it is obviously faster and simpler, it is also better to maintain and better to optimise. And it gives more power and possibilities to the ooc compiler.

Re:Ooc: new awesome language with site redesign, guide, and ... by nddrylliog on Monday July 12, 2010 @04:16PM (#1509260)
Yeah, seems obvious right? But having a C backend (independent of LLVM) still has advantages. I will continue to maintain it, even if/when we get an LLVM backend.

I only wish llvm-c would suck less, then we'd get proper bindings and be able to write the llvm backend in ooc.

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?
Re:Ooc: new awesome language with site redesign, guide, and ... by gmaster1440 on Monday July 12, 2010 @04:17PM (#1509261)
rock -> C99 (compiled with clang)