I’ve recently released the code of the Game Editor project (http://game-editor.com).
Game Editor uses the C as script languae to make the games and, currently, uses the EiC library to
interpret the C codes. Now, I think is a great idea replace the Eic by clang. The project will gain
many improvements with this change (like better performance and code refactoring).
My purpose with this message is to invite you to take a look the Game Editor project and, if you like
it, help me to make this little C IDE based on clang.
You can see the initial request of this replacement here:
Look some screenshots here:
Read more about the project evolution here:
Thank you all,
This is definitely a direction that we’d like to go with clang. There are already people in the community that are very interested in interpretation specifically (e.g. read/eval/print loops), and Clang is built to be reusable in many different ways. We also already use and support clang as a JIT compiler. If you’re interested in this, this talk from the llvm developer meeting is useful:
Building an Efficient JIT
In any case, I think Clang would be very well suited for this sort of use!
I really hope have clang working in Game Editor, and I think the results of this integration will be valuable to the clang project too
Chris Lattner wrote:
This is definitely a direction that we'd like to go with clang. There are already people in the community that are very interested in interpretation specifically (e.g. read/eval/print loops),
Some time ago I did a bit of experimentation for this and was happy to conclude that clang's modular design makes it really easy.
The changes required were mostly about exposing APIs that are currently private, some methods on the Parser and Sema.
What are the expectations of people on how a C/C++ REPL should work ?
I mean, certain interpreters allow mixing expressions and declarations e.g, you can define a function and evaluate an expression without switching declaration contexts.
Using Clang almost as is, would need some kind of a declaration context switch, (like "type in expression context>"), would this be reasonable ?
I was not thinking in use clan as an interpreter, but using it to:
- making refactoring in the game code
- show, in the IDE, information about any selected token (type, name, …) and the possibility to change the properties in a grid control (even for functions)
- compiles the final game code and generates the llvm bitcode
The only use I can see for interpretation in this context, is to debug the game. But, is this not a feature provided by the llvm (may be in future versions)?