Selecting a scripting engine - Part 2.
Aug 6th, 2007 by susheel
My quest for a scripting system for the O2 Engine continues. This blog is a continuation of the “Selecting a scripting engine” series. You can check out the first part here. I tried a couple of different approaches to try and attack the problem. I am currently in prototyping mode and things and decisions can and do change drastically. Also I have to test a lot of different techniques and scripting languages before deciding upon a final solution.
Python
I continued my experiments with Python with trying to integrate Python into a moderately sized project. Something that I had worked on before beginning with the O2 Engine. It has similar structure to the O2 Engine but is comparatively far smaller. Python is easy to bind (, than what I initially thought) but the party ends there. I must say I am a bit disappointed, extending the classes is turning out to be far more difficult that I had anticipated. As I mentioned in my earlier post, to build a game successfully with the engine you not only have to work with the engine classes but also engine design. Exporting the design was not very intuitive while working with python bindings . I am not ready to give up just yet, I have decided to look into how others are approaching the problem. Maybe look into how bindings for wxWidgets are written (wxPython).
New scripting language
I have no experience in scripting language creation but recently after a long conversation with an old friend of mine I was forced to look into ANTLR. ANTLR is a parser generator which could be used to create a brand new scripting language. Before I proceed I must warn you though that I am no expert in Lexers or Parsers and have no clue how to make a scripting language. My knowledge in this area is limited and I am just about getting my feet wet in this arena. Treat my comments in this area with a pinch of salt.
OK, coming back to the main topic. One or two of the people that I chatted with recently were of the view that it would be better off in the long run to implement a new scripting language from scratch. While this remains an issue of debate between us that is not yet resolved, the idea is ideal! Having a scripting language specific to the engine will be excellent for scalability. Grammar could be built into the scripting language itself. This would avoid archaic constructs that often arise out of bindings for languages like Python or Lua. I have found one more thing that bugs me a lot is, you do have to make design compromises to get all of your functionality in into the scripting language while using bindings. Again, I am not making tall claims. As is said, I am still working with this whole concept of bindings and scripting languages.
Tried my hand at ANTLR and could not make head and tail out of what it was. But I am very much a newbie at this and I didn’t spend too much time with it. Just maybe a couple of hours on Sunday. I did a lot of googling around and I can see that people have good things to say about it. Lets see how this turns out. ATM I have very little time to devote to this.