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 > |