Looking for suggestions/advice
Dan Shafer
revdan at danshafer.com
Thu Aug 11 15:11:31 EDT 2005
Being the Resident Curmudgeon (self-described and not universally
acclaimed), I figured I'd jump in with another viewpoint or two.
First, let me say I think this project could definitely be done well
in Rev. I haven't seen anything in your requirements or this
discussion that leads me to believe otherwise. That said, I think
your performance concerns may be valid on some level. I don't think
you need to (or necessarily should) conceive of your script
interpreter as a nested ball of if-then-else or CASE statements. I
think a table-driven approach might be far better, given Rev's
ability to deal with 2-D arrays and strings. So I'd see a data
structure like:
doplay,playTheGame,param1, param2
doscore, calcScore, param1, param2, param3
Then your code just locates the right line/row of the data structure
to find out what command to call and everything else on the line is
parametric data. I'm sure I'm probably oversimplifying here, but
perhaps my point is clear anyway.
Two other things occur.
First, at the risk of causing a firestorm here, REALBasic includes a
full-blown script interpreter, RBScript, that might completely avoid
the need for writing your own scripting language interpreter. To be
sure, development in RB is probably substantially slower than in Rev,
but for an Open Source project, it has some advantages that are
probably self-evident. Being object-oriented and given your
experience with Python, you might find yourself quite at home in that
world.
Second, if you do decide to do an interpreter, check out YACC (Yet
Another Compiler Compiler) at http://dinosaur.compilertools.net/
yacc/ . The tool may or may not be useful to help you generate what
you need here but I bet it'll help you think about your needs in a
more structured way.
Good luck with the project. Sounds like fun.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer, Revolution Consultant and Author
http://www.shafermedia.com
Get my book, "Revolution: Software at the Speed of Thought"
From http://www.revolutionpros.com, Click "My Stuff"
More information about the use-livecode
mailing list