 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
SwedishFrog Site Admin

Joined: 25 Jan 2007 Posts: 273 Location: New York
Digg It |
Posted: Fri Nov 09, 2007 6:03 am Post subject: OpenPIE's method of compatibility with GlovePIE scripts |
|
|
We'd like OpenPIE's scripting language to be easy to adopt for GlovePIE users as well as other languages. We should decide how to accomplish this.
I can think of three approaches right now
1. Mimic GlovePIE's syntax exactly.
Pro: The basic syntax is already laid out.
Con: We are restricted to use that syntax.
2. Design our own syntax, and include a translation utility to convert GlovePIE scripts to OpenPIE scripts.
Pro: Our new syntax can be as slick as we want because we're not bound to any existing structure.
Con: It might be hard to explain this concept to your average clueless noob. We'd have to be very careful about the design of the GUI for importing scripts.
3. Design our own syntax, but also try to accept GlovePIE syntax with the same parser.
Pro: Easy to use
Con: We would have to be extra careful in designing the new syntax, because it must not conflict with the GlovePIE syntax.
Thoughts? Other ideas? |
|
| Back to top |
|
 |
luis_villase Site Admin

Joined: 28 Nov 2006 Posts: 172 Location: Mexico City, Mexico
Digg It |
Posted: Fri Nov 09, 2007 3:34 pm Post subject: |
|
|
Well, we talked about this before (I can't really remember if it was via email or forum thread). Anyhow, just to make it official, my vote goes to GlovePIE syntax. My choice is based on the primary pro: it's already there. But there's also another powerful reason: GlovePIE syntax is kind of a hybrid between Java and Visual Basic, for it accepts a great deal of definitions for a single expression. This may be a drawback, but I think of it as an advantage.
Not only you don't really need to know a programming language to use it, but also if you now (almost) anything, it will help. This gives the project a high level of maneuverability and flexibility.
About options 2 and 3, well... they're good options, but will result in almost double work. Designing the syntax can be simple enough (simple, not easy). But you will need to build a translator from GlovePIE anyway, so why bother? _________________ Not all mexicans enjoy tamales and piñatas, and tacos aren't really made that way!
Luis V. |
|
| Back to top |
|
 |
bellwethr
Joined: 05 Nov 2007 Posts: 25
Digg It |
Posted: Fri Nov 09, 2007 9:18 pm Post subject: |
|
|
I'd opt for as much flexibility as possible in your language. By requiring adherence to an older, pre-existing standard, you lock yourself into the feature set that that language uses.
#3 seems like your best bet.
Better, since you can start with just accepting GlovePIE scripts and add new language features later as desired. |
|
| Back to top |
|
 |
Cha0s Site Admin
Joined: 17 Jan 2007 Posts: 493
Digg It |
Posted: Fri Nov 09, 2007 9:44 pm Post subject: |
|
|
I'd say 3b. Basically, take GlovePIE's syntax at the beginning and then add stuff in when new features come up. I wouldn't "design" a syntax, but I would allow for the possibility of additions. The reasons are those stated by luis. While I personally would like a more uniform syntax (all if-statements have to be formulated the same way, for example), I understand the reason for the flexible syntax GlovePIE employs and think it is worth preserving and using in our own library. Just my 2¢. _________________ Cha0s |
|
| Back to top |
|
 |
kiddo7
Joined: 05 Feb 2007 Posts: 42
Digg It |
Posted: Sat Nov 10, 2007 12:12 am Post subject: |
|
|
I am very reluctant to post in this thread since have never written Java code and I still (regretfully) do not have a wiimote. I feel like I am overstepping my boundaries and butting my nose into "serious business"
If, however, you will overlook my forward behavior and hear me out, ignoring my n00b status, I would be honored to deliver what I have to say.
I too agree with Cha0s and bellwethr, that the third option would most likely be most practical if your approach was to start with the preexisting PIE language and expand it as the need and opportunity arises. Seeing as how i have been this shameless forgive me one more time and let me reiterate once again what i have been hoping to very subtly coax/encourage/pressure/manipulate (take your pick) you people into doing by mentioning it here and there; If you could expand the glovePIE script with custom/user-definable functions that can be called from the code. I believe you will have built a powerful and useful software.
Thank you for your patience with me. I shall now return to the shadows from whence I came... |
|
| Back to top |
|
 |
SwedishFrog Site Admin

Joined: 25 Jan 2007 Posts: 273 Location: New York
Digg It |
Posted: Sun Nov 11, 2007 5:18 am Post subject: |
|
|
Hey guys. I've been thinking about this grammar business and I thought of something we should discuss.
It's about the way Glovepie handles If statements. GlovePIE's if statements are also loops. When the If statement is executed, It checks the condition, and if it's true, it runs the code block. After the block finishes, it starts over and checks the condition and decides whether to run the code block a second time. It continues to loop like this until the condition becomes false.
I can understand why this is useful behavior for an input emulator -- It makes it easy for you to check a button state and run code to handle that button state continuously until it's no longer pressed. It's a good feature and we should support it
However I think there are lots of times where you would not want an if block to automatically loop over itself. I feel like we should support both normal If's and Looping If's.
Because i'm inclined to make this language consistent with 99% of the other languages in this world, I would want If's that don't loop unless you request it. Sadly this conflicts with GlovePIE's design
Let's say that non-looping If's would use the syntax:
| Code: | | If (condition) then ... endif |
and the looping if could be (for example)
| Code: | | While (condition) then ... endif |
The problem is that, if we import a Glovepie script, that script was written and tested assuming that those If's are going to loop. So if they don't loop when the program would not behave as expected. We could get around this problem 2 ways
1. Make the If statements loop by default and use some other syntax for non-looping if's.
2. Translate those If statements to While statements when you import the GlovePIE script. Unfortunately this requires a translation grammar, but it's a very simple one and shouldn't be a problem to write.
This is one of those wierd little areas where directly supporting the GlovePIE grammar becomes a restriction on how the language behaves.
What do you guys make of all this? How should we handle If's?
@kiddo: Thanks for the suggestion, Custom functions sure are useful. It's one of the features I really wish GlovePIE had. I don't think it would be a big problem to add them to this project, considering how modular the engine is going to be. BTW Everyone's input is welcome. It's a community project after all.
Last edited by SwedishFrog on Sun Nov 11, 2007 6:03 am; edited 1 time in total |
|
| Back to top |
|
 |
bellwethr
Joined: 05 Nov 2007 Posts: 25
Digg It |
Posted: Sun Nov 11, 2007 6:01 am Post subject: |
|
|
| Just for the sake of clarity, can we refer to your looping "If" as a while loop? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|