3 ms·
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_my
by nddrylliog 16y ago
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 :(
- albertzeyer 16y agoWhoops, 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?
- nddrylliog 16y agoNot too bad, use -linker=g++ and declare your functions extern "C" in the C++ code
- albertzeyer 16y agoIf it is easy, why not just use the LLVM C++ interface in the ooc compiler?