From: Chad A. <ae...@ae...> - 2002-01-09 14:06:59
|
The issue here is whether it should be a full component system or something of a smaller magnitude. If you want a full component system, there really isn't a reason not to use CORBA or XPCOM. On the other hand, I'd love to make something a little more lightweight. It'd be nice to have some sort of automation in interacting with scripting languages, so a game could do something like: void someFunction() { } IScriptEngine* se = CreateScriptEngine("python"); if (!se) { error(); } se->defineFunction("someFunction", someFunction); se->defineMethod("someMethod", &C::someMethod); // or whatever that syntax is and then: se->execute("someFunction()"); // you pass in a script whoa, I just realized you could use typelists to automate script bindings... that's cool o_o Maybe that's what boost.org's automated python bindings do. I do have a rough idea of a design, come to think of it. Should I make a new module in CVS? What should it be called? I wouldn't really know how to design the interface without seeing example usage though. I just finished reading Martin Fowler's Refactoring (good book, btw), and I've moved away from doing lots of up-front design. We'll see if this is a temporary or lasting effect on my coding style. Are we going to have some sort of code review process for module owners? If I were a module owner, I'd like to at least look at all code that's going in. > after your talk about scripting languages and embedding them in a game, > i would really love to take part in building a module that would be > easily embedded in a game that would handle the loading of components > regardless of the language they were written in. i think that would be > really useful for all of the games in development for the club. i thought > since you're the smart/knowledgable guy on this scripting stuff that > perhaps i could get you to spearhead an effort to make such a module. i > figured you could perhaps take care of the overall design and then task > code monkeys like myself with work to get it implemented. |
From: Ben S. <bs...@vr...> - 2002-01-09 22:41:02
|
well i guess i'd rather have a more lightweight system. however, i don't particularly think it's worth our time writing bindings for various languages. however ... if you think we can do it with some fancy template meta-programming or reuse existing code out there that does binding to various languages, then i say go for it. now, i'm not familiar with doing scripting, but i would probably want to use the scripting engine along the following lines (ignoring error condidions): ScriptEngineFactory* factory = ScriptEngineFactory::getInstance(); IScriptEngine* se = factory->create( "python" ); se->execute( "myPythonFunction()" ); my point above is that i wouldn't necesarily want to have to define my functions before i can call them. i would hope that the scripting engine would be smart enough to be able to call the correct python function without me having to define it first. perhaps it would be up to the particular scripting engine to define the functions. or better yet, maybe we could dynamically load "plugins" that define functions in an arbitrary language. when loaded, they would register the funtions/classes they provide with the apropriate scripting engine. then when i use the scripting engine using code similar to above. as for a CVS module, here are some ideas: - grok - sanskrit - scribe - ogre - chickenscratch - chicken - pig - orc - goblin code review process ... i'd say that's up to the module owner. please, check in your ideas and UML diagrams ... i'd love to take a look at them and comment on them! cheers, ----- Ben Scott President ISU Game Developers Club Treasurer ISU Ballroom Dance Company bs...@ia... On Wed, 9 Jan 2002, Chad Austin wrote: > The issue here is whether it should be a full component system or something of a smaller magnitude. > If you want a full component system, there really isn't a reason not to use CORBA or XPCOM. On the > other hand, I'd love to make something a little more lightweight. It'd be nice to have some sort of > automation in interacting with scripting languages, so a game could do something like: > > void someFunction() { > } > > IScriptEngine* se = CreateScriptEngine("python"); > if (!se) { > error(); > } > > se->defineFunction("someFunction", someFunction); > se->defineMethod("someMethod", &C::someMethod); // or whatever that syntax is > > and then: > > se->execute("someFunction()"); // you pass in a script > > whoa, I just realized you could use typelists to automate script bindings... that's cool o_o > Maybe that's what boost.org's automated python bindings do. > > I do have a rough idea of a design, come to think of it. Should I make a new module in CVS? What > should it be called? > > > I wouldn't really know how to design the interface without seeing example usage though. I just > finished reading Martin Fowler's Refactoring (good book, btw), and I've moved away from doing lots > of up-front design. We'll see if this is a temporary or lasting effect on my coding style. > > > Are we going to have some sort of code review process for module owners? If I were a module owner, > I'd like to at least look at all code that's going in. > > > > after your talk about scripting languages and embedding them in a game, > > i would really love to take part in building a module that would be > > easily embedded in a game that would handle the loading of components > > regardless of the language they were written in. i think that would be > > really useful for all of the games in development for the club. i thought > > since you're the smart/knowledgable guy on this scripting stuff that > > perhaps i could get you to spearhead an effort to make such a module. i > > figured you could perhaps take care of the overall design and then task > > code monkeys like myself with work to get it implemented. > > _______________________________________________ > ISUGameDev-devel mailing list > ISU...@li... > https://lists.sourceforge.net/lists/listinfo/isugamedev-devel > |
From: Chad A. <ae...@ae...> - 2002-01-11 15:58:12
|
> well i guess i'd rather have a more lightweight system. however, i don't > particularly think it's worth our time writing bindings for various > languages. however ... if you think we can do it with some fancy template > meta-programming or reuse existing code out there that does binding to > various languages, then i say go for it. Eh? I'm confused by your statement "I don't think it's worth our time writing bindings". How else will we get scriptability? > now, i'm not familiar with doing scripting, but i would probably want to > use the scripting engine along the following lines (ignoring error > condidions): > > ScriptEngineFactory* factory = ScriptEngineFactory::getInstance(); > IScriptEngine* se = factory->create( "python" ); > se->execute( "myPythonFunction()" ); > > my point above is that i wouldn't necesarily want to have to define my > functions before i can call them. i would hope that the scripting engine > would be smart enough to be able to call the correct python function > without me having to define it first. perhaps it would be up to the > particular scripting engine to define the functions. How do you call a function if it isn't defined? If you have native functions that you want to reflect into a particular scripting language, you have to tell it that those functions exist. > or better yet, maybe we could dynamically load "plugins" that define > functions in an arbitrary language. when loaded, they would register the > funtions/classes they provide with the apropriate scripting engine. then > when i use the scripting engine using code similar to above. This requires features of a full component system, afaik. For example, being able to understand interfaces at run-time. > please, check in your ideas and UML diagrams ... i'd love to take a look > at them and comment on them! I'll do that. isugamedev/lib/scribe |
From: Ben S. <bs...@vr...> - 2002-01-11 17:08:43
|
> Eh? I'm confused by your statement "I don't think it's worth our time writing bindings". How else > will we get scriptability? [snip] i guess what i meant by not wanting to write bindings is that at the meeting where you talked about scripting you said that writing the bindings was not easy or fun. so i figure if we can find LGPL code out there that does most of the work for us, we can reuse it and refactor it a bit to get it to work with scribe. i figured that would be a better use of our time than trying to write the language bindings from scratch. > How do you call a function if it isn't defined? If you have native functions that you want to > reflect into a particular scripting language, you have to tell it that those functions exist. [snip] i guess i wasn't very clear. i see two ends of a scripting engine. first you've got the libraries you want to load that contains code in some arbitrary language you want to execute. second you've got your application (probably in C++) in which you want to implement a soft architecture where you can execute dynamically loaded code in said libraries. so i see all the libraries being in some predefined directory. when the scripting engine loads, it would load all the DLLs in that directory and call some initialization function. the libraries themselves would register/define what functions/classes they define in some sort of registry in the scripting engine. on the other side, my application starts up and loads the scripting engine. the engine loads and inits all the libraries containing the code i want to execute. then my application asks the scripting engine to execute some function. the scripting engine would look up the function and try to execute it if it found it and otherwise fail. is that more clear? would that work well, or is my lack of knowledge of scripting going to doom that design to failure? ----- Ben Scott President ISU Game Developers Club Treasurer ISU Ballroom Dance Company bs...@ia... On Fri, 11 Jan 2002, Chad Austin wrote: > > well i guess i'd rather have a more lightweight system. however, i don't > > particularly think it's worth our time writing bindings for various > > languages. however ... if you think we can do it with some fancy template > > meta-programming or reuse existing code out there that does binding to > > various languages, then i say go for it. > > Eh? I'm confused by your statement "I don't think it's worth our time writing bindings". How else > will we get scriptability? > > > now, i'm not familiar with doing scripting, but i would probably want to > > use the scripting engine along the following lines (ignoring error > > condidions): > > > > ScriptEngineFactory* factory = ScriptEngineFactory::getInstance(); > > IScriptEngine* se = factory->create( "python" ); > > se->execute( "myPythonFunction()" ); > > > > my point above is that i wouldn't necesarily want to have to define my > > functions before i can call them. i would hope that the scripting engine > > would be smart enough to be able to call the correct python function > > without me having to define it first. perhaps it would be up to the > > particular scripting engine to define the functions. > > How do you call a function if it isn't defined? If you have native functions that you want to > reflect into a particular scripting language, you have to tell it that those functions exist. > > > or better yet, maybe we could dynamically load "plugins" that define > > functions in an arbitrary language. when loaded, they would register the > > funtions/classes they provide with the apropriate scripting engine. then > > when i use the scripting engine using code similar to above. > > This requires features of a full component system, afaik. For example, being able to understand > interfaces at run-time. > > > please, check in your ideas and UML diagrams ... i'd love to take a look > > at them and comment on them! > > I'll do that. isugamedev/lib/scribe > > _______________________________________________ > ISUGameDev-devel mailing list > ISU...@li... > https://lists.sourceforge.net/lists/listinfo/isugamedev-devel > |
From: Chad A. <ae...@ae...> - 2002-01-12 10:14:58
|
[snip] > is that more clear? would that work well, or is my lack of knowledge of > scripting going to doom that design to failure? Yeah, that makes sense. Your definition of 'scripting engine' simply included more than mine did. The functionality you want can be implemented in terms of what I wanted, so we're all good. |