Re: Squirrel Discussion
Posted: Sat Apr 04, 2009 2:26 pm
I have a suggestion to make. You all talk about scripting languages, and that's ok. But what if we used a programming language as our scripting language? To make it short, I am talking about Java.
Advantages:
-Massive language library, supports for example:
-HashMaps
-ArrayLists (encapsulating arrays)
-Many usefull String operations
-Sorting of sortable Collections
-Importing of dll functions made easy through JNA
-Users can use the freely available development tool Eclipse which supports:
-Javadoc for scripting commands documentation
-Code completition
-Syntax checking
-Automatic script compiling
-Many language tools which can be used to build a scripting framework that can make thinghs very easy for RF users, having all default functionality without writing real code and still be able customize the whole system by overriding functions (We would have a base class RealityFactory and then you inherit from it - an empty class would be default, but then you can begin to override the methods....) This is absolutely not problem because in Java all functions are virtual.
-Object orientation with single inheritance, but as many interfaces as you want (interfaces are abstract classes where all functions are abstract=pure virtual, and have no member variables. They can, however, have static variables)
-Compiled language for good speed
-The language supports Multi-Threading natively. (We don't have to use this feature though if we don't need it)
-Scripts can run simultaneously and in different threads if needed, might need some twaking though. (Like above, we can make it so that they run after each other if needed)
-The language is still actively developed and in the past there were some speed opimizations regarding Java. We don't have to develop it further, instead it is developed FOR us (and i think that suits RF2 very well, seeing that Ogre is also actively being developed for us!)
-I don't think we even have to recompile RF2 to get access to the newly added language features of Java. This is because they are 'in' the language, and we would just implement an interface to Java in RF2's source code.
-I have just been looking at its license and it seems to fit for RF2 (http://www.java.com/en/download/license.jsp)
-throwing of Exceptions can make it easier to debug scripts
Disadvantages:
-Users have to install the JRE (and maybe the JNA, which simplifies the process of importing the scripting functions from RF) with RF.
I don't think speed of Java itself will be an issue, however it could becme a task to make the interaction to RF (into C++) and from RF to Java possible. Might become a task, but it IS certainly possible!
Also the base concepts of Java are simple to grasp in my opinion (the more complex thinghs are a bit more complicated yes, but not every user will need to write their own interfaces and abstract classes!).
Sme examples of how script writing could look:
The easiest 'game script' possible:
Overriding the setup() method of the RealityFactory class:
Eclipse presenting you the thinghs you can do with the object:
(The above samples are, of course, pseudocode)
Tell me what you think.
Advantages:
-Massive language library, supports for example:
-HashMaps
-ArrayLists (encapsulating arrays)
-Many usefull String operations
-Sorting of sortable Collections
-Importing of dll functions made easy through JNA
-Users can use the freely available development tool Eclipse which supports:
-Javadoc for scripting commands documentation
-Code completition
-Syntax checking
-Automatic script compiling
-Many language tools which can be used to build a scripting framework that can make thinghs very easy for RF users, having all default functionality without writing real code and still be able customize the whole system by overriding functions (We would have a base class RealityFactory and then you inherit from it - an empty class would be default, but then you can begin to override the methods....) This is absolutely not problem because in Java all functions are virtual.
-Object orientation with single inheritance, but as many interfaces as you want (interfaces are abstract classes where all functions are abstract=pure virtual, and have no member variables. They can, however, have static variables)
-Compiled language for good speed
-The language supports Multi-Threading natively. (We don't have to use this feature though if we don't need it)
-Scripts can run simultaneously and in different threads if needed, might need some twaking though. (Like above, we can make it so that they run after each other if needed)
-The language is still actively developed and in the past there were some speed opimizations regarding Java. We don't have to develop it further, instead it is developed FOR us (and i think that suits RF2 very well, seeing that Ogre is also actively being developed for us!)
-I don't think we even have to recompile RF2 to get access to the newly added language features of Java. This is because they are 'in' the language, and we would just implement an interface to Java in RF2's source code.
-I have just been looking at its license and it seems to fit for RF2 (http://www.java.com/en/download/license.jsp)
-throwing of Exceptions can make it easier to debug scripts
Disadvantages:
-Users have to install the JRE (and maybe the JNA, which simplifies the process of importing the scripting functions from RF) with RF.
I don't think speed of Java itself will be an issue, however it could becme a task to make the interaction to RF (into C++) and from RF to Java possible. Might become a task, but it IS certainly possible!
Also the base concepts of Java are simple to grasp in my opinion (the more complex thinghs are a bit more complicated yes, but not every user will need to write their own interfaces and abstract classes!).
Sme examples of how script writing could look:
The easiest 'game script' possible:
Overriding the setup() method of the RealityFactory class:
Eclipse presenting you the thinghs you can do with the object:
(The above samples are, of course, pseudocode)
Tell me what you think.