Not entirely. If we eventually get around to implementing a project editor, it would save to itchy format, and when it comes around to publishing time, it would export to 1.x/ 2.0
Offline
bobbybee wrote:
Not entirely. If we eventually get around to implementing a project editor, it would save to itchy format, and when it comes around to publishing time, it would export to 1.x/ 2.0
I would not recommend that. What I thought (and what is probably best if you want to have a custom format at all) is that you would load Scratch 1.x/2.0 files and convert them into objects in memory. When running a project, you would compile it to bytecode (you can hotswap in changes if the blocks are changed while it is running). When saving, you would serialize the objects in memory as Scratch 1.x/2.0 files.
Last edited by nXIII (2012-10-01 19:49:25)
Offline
Bytecode = Good.
Perhaps, when you want to play a project, it "compiles" to bytecode (in the same way that C# applications do), saves the bytecode in memory (not in a file), and then a C++ procedure takes care of the execution. There's no real reason to write all that data to the disk -- you just have to retrieve it again.
As for in-execution editing: I honestly think it'll make our lives simpler just to ignore that feature, and allow the user to either edit scripts or play the project, but not both at once. Besides, all the stuff for dealing with the Itchy++ UI will interfere with the performance of the project. That's what happens with Scratch (at least, I assume that's why Scratch projects work so much better in presentation mode).
So, JIT compilation for the win.
Last edited by amcerbu (2012-10-01 21:21:48)
Offline
amcerbu wrote:
Bytecode = Good.
True.
Perhpas, when you want to play a project, it "compiles" to bytecode (in the same way that C# applications do), saves the bytecode in memory (not in a file), and then a C++ procedure takes care of the execution. There's no real reason to write all that data to the disk -- you just have to retrieve it again.
True.
As for in-execution editing: I honestly think it'll make our lives simpler just to ignore that feature, and allow the user to either edit scripts or play the project, but not both at once. Besides, all the stuff for dealing with the Itchy++ UI will interfere with the performance of the project. That's what happens with Scratch (at least, I assume that's why Scratch projects work so much better in presentation mode).
False.
Scratch was slowed down when in editor mode intentionally (still not a good idea.) As long a the editor is not redrawing every frame, there should not be a problem at all.
So, JIT compilation for the win.
Figure out how to do it and I will give you a cookie.
Last edited by MathWizz (2012-10-01 20:17:34)
Offline
amcerbu wrote:
Perhpas, when you want to play a project, it "compiles" to bytecode (in the same way that C# applications do), saves the bytecode in memory (not in a file), and then a C++ procedure takes care of the execution.
Yes, that's what I meant.
So, JIT compilation for the win.
Do you mean bytecode -> machine code or on-the-fly script -> bytecode?
Now that I think about it, incremental compiling would also be cool.
Last edited by nXIII (2012-10-01 21:01:30)
Offline
I just caught that embarrassing typo ("Perhpas")... whoops.
Anyway, I don't know that we have the capability to do the whole bytecode to machine code thing. I was just drawing a parallel. Rather than parsing directly from the .sb file, the part of Itchy++ in charge of running the program would simply scan through the so-called bytecode, which would be generated from the scripts. We might be able to do it with an array of function pointers, each member representing one block (just putting out an idea -- I don't like the idea of a huge switch statement). I was thinking that each bytecode value could represent an index in that array of function pointers, and we could call the appropriate function by feeding it the current byte value.
Last edited by amcerbu (2012-10-01 21:30:12)
Offline
nXIII wrote:
bobbybee wrote:
Not entirely. If we eventually get around to implementing a project editor, it would save to itchy format, and when it comes around to publishing time, it would export to 1.x/ 2.0
I would not recommend that. What I thought (and what is probably best if you want to have a custom format at all) is that you would load Scratch 1.x/2.0 files and convert them into objects in memory. When running a project, you would compile it to bytecode (you can hotswap in changes if the blocks are changed while it is running). When saving, you would serialize the objects in memory as Scratch 1.x/2.0 files.
Exactly what I was thinking because this is meant to be a C++ PORT so it will use the 2.0 format for saving.
Offline
Aren't you trying to make an editor as well? In which case you need to write .sb/sb2 files as well, so you'll need to convert back from your "itchy" format as well. Isn't that just complicating things unnecessarily?
Offline
blob8108 wrote:
Aren't you trying to make an editor as well? In which case you need to write .sb/sb2 files as well, so you'll need to convert back from your "itchy" format as well. Isn't that just complicating things unnecessarily?
There is no itchy format except the objects in memory.
Offline
nXIII wrote:
blob8108 wrote:
Aren't you trying to make an editor as well? In which case you need to write .sb/sb2 files as well, so you'll need to convert back from your "itchy" format as well. Isn't that just complicating things unnecessarily?
There is no itchy format except the objects in memory.
Whoops, missed a page Sorry, ignore me.
Offline
blob8108 wrote:
Aren't you trying to make an editor as well? In which case you need to write .sb/sb2 files as well, so you'll need to convert back from your "itchy" format as well. Isn't that just complicating things unnecessarily?
That's what I've been saying about this the whole time. At least someone understands why I dislike creating another format.
We've also come to an agreement, there will be no Itchy file format, just an internal memory structure.
Offline
MathWizz wrote:
blob8108 wrote:
Aren't you trying to make an editor as well? In which case you need to write .sb/sb2 files as well, so you'll need to convert back from your "itchy" format as well. Isn't that just complicating things unnecessarily?
That's what I've been saying about this the whole time. At least someone understands why I dislike creating another format.
Heh, yeah
We've also come to an agreement, there will be no Itchy file format, just an internal memory structure.
Sounds good
Offline
MathWizz wrote:
[...]
We've also come to an agreement, there will be no Itchy file format, just an internal memory structure.
yep. Maybe we could serialize it to a file to turn a project into a .exe, but for now no format...
Offline
Working on a wiki page for Itchy.
Not done yet, but it's located here: http://wiki.scratch.mit.edu/wiki/Itchy%2B%2B.
Last edited by pwiter (2012-10-02 17:18:24)
Offline
nice progress guys!
i get sometimes seg faults, but most projects are working
keep going!
if this helps, here is an error message i get on some files:
itchy: /build/buildd/cairo-1.12.2/src/cairo-pattern.c:187: _cairo_pattern_set_error: Assertion `status < CAIRO_STATUS_LAST_STATUS' failed. Aborted (core dumped)
Offline
roijac wrote:
nice progress guys!
i get sometimes seg faults, but most projects are working
keep going!
if this helps, here is an error message i get on some files:Code:
itchy: /build/buildd/cairo-1.12.2/src/cairo-pattern.c:187: _cairo_pattern_set_error: Assertion `status < CAIRO_STATUS_LAST_STATUS' failed. Aborted (core dumped)
What os are you using?
Offline
TRocket wrote:
roijac wrote:
nice progress guys!
i get sometimes seg faults, but most projects are working
keep going!
if this helps, here is an error message i get on some files:Code:
itchy: /build/buildd/cairo-1.12.2/src/cairo-pattern.c:187: _cairo_pattern_set_error: Assertion `status < CAIRO_STATUS_LAST_STATUS' failed. Aborted (core dumped)What os are you using?
i'm using windows with slashes
jk, linux
Offline