well, the tree example is just a recursive JavaScript function that calls Snap's turtle drawing primitives. Thing is, merely crunching functions and drawing stuff onto a canvas is probably fast enough in just any implementation programming language, the issues start once you start yielding to other processes and dynamically redrawing the display so users can visually follow what's going on (and interact with it). Even then you can optimize certain operations by making them atomic and by updating the screen only once after the operation is done ("turbo" mode). Instead of redrawing an extremely long list of damaged areas you can instead redraw the whole area in question (i.e. the Stage). That's the idea behind my "tree" example.
Offline
(....) Anyway I would not exchange my Byob 3.1 or Snap for any other programming language.
Let me explain why. As far as I am concerned I highly prefer the "user-friendlyness" of Scratch/Byob to the data-crunching capability of XLogo (which is really impressive for 3d applications).
Anyway XLogo proves that a Java interpreted application running inside a browser can be very fast compared to "compiled" languages applications. I think that the same data-crunching capability applies to Javascript (as your tree example proves it).
But the agenda of Scratch inventors was not datacrunching, and also is not what you aim at with Snap.
One can understaand (and we have had many discussions about that formerly ) that the Scratch user-friendliness (pick-and-stick, instruction panel, script area, multisprite stage etc) is not compatible with datacrunching performances. The "turbo mode" solution can be a good compromise.
Offline
....
data-crunching capability applies to Javascript
I'm wrong saying that. Logo-like turtle applications does not ask for data-crunching capabilities. As a result Byob 3.1 in Turbo mode is as fast as above mentioned interpreter like XLogo and DesignBlockJS. And Snap could be equally fast if necessary.
For mathematical applications in Byob there is still a difference between Turbo mode and Normal mode, but much less than for turtle-like applis.
As far as performance is concerned the real issue for Snap is probably to improve handling of lists which is very poor with Byob. We will see that in due time.
I also understand that they are 2 aspects : the front-office (what you see when the stage scene changes) and the back-office (computations behind the scene without visual effects like for example list handling).
Offline
Snap! update
the pre-pre-pre alpha prototype now sports script variables (temporaries), the first BYOB-specific, non-vanilla-Scratch feature. As of now you cannot directly rename them, which will come later.
Enjoy!
Last edited by Jens (2011-08-26 05:43:31)
Offline
Jens wrote:
Snap! update
the pre-pre-pre alpha prototype now sports script variables (temporaries), the first BYOB-specific, non-vanilla-Scratch feature. As of now you cannot directly rename them, which will come later.
Enjoy!
Yay!
Why does right-clicking, select 'a String-Morph' and than edit not work?
Offline
roijac wrote:
Jens wrote:
Snap! update
the pre-pre-pre alpha prototype now sports script variables (temporaries), the first BYOB-specific, non-vanilla-Scratch feature. As of now you cannot directly rename them, which will come later.
Enjoy!Yay!
Why does right-clicking, select 'a String-Morph' and than edit not work?
Use the ReporterBlockMorph spec.
Offline
scimonster wrote:
roijac wrote:
Jens wrote:
Snap! update
the pre-pre-pre alpha prototype now sports script variables (temporaries), the first BYOB-specific, non-vanilla-Scratch feature. As of now you cannot directly rename them, which will come later.
Enjoy!Yay!
Why does right-clicking, select 'a String-Morph' and than edit not work?Use the ReporterBlockMorph spec.
thanks!
Offline
@ Jens and others
Please find herewith an example of script using Script variables.
http://www.xleroy.net/ByobTuto/New/math01.gif
This script is supposed to compute cos x according to MacLaurin serie (ref to Scratch math gallery).This example shows that Script variables have this particular interest to avoid creating a lot of system variables only for temporary calculations.
Offline
You guys are doing an amazing job on Snap! Keep up the good work!
Offline
xly wrote:
As far as performance is concerned the real issue for Snap is probably to improve handling of lists which is very poor with Byob. We will see that in due time.
Yes, exactly! That and procedure calling. For example, try running this project even in turbo mode!
Offline
See one example of Script Variables Instruction (SVI):
http://www.xleroy.net/ByobTuto/New/math03.gif
You can implement several SVI in the same script.
I ignore which rules applies to variables in such a case !
I imagine that each SVI owns its own set of variables.
Offline
Our grant got funded!
This will speed up Snap! development and establish summer workshops to teach teachers our CS curriculum based on it.
So, if you're in the US and an interested high school or college teacher, get in touch with me -- and if you're in the US and a high school student, get your CS teacher to get in touch with me (or if there is no CS teacher, pick a teacher you think would be good -- not scared of computers, not scared of kids, ready to learn new things).
(Non-US people who are interested can get in touch too, but our travel budget won't reach you.)
The basic plan is that you get a regional group of around 30 teachers organized, and preferably a cooperating local college that provides space and TAs, and we send you a teacher experienced with the curriculum to lead a workshop that also involves taking our course online.
Oh, and, by the way, if you're a German lawyer-*-programmer, time to get even busier.
bh@cs.berkeley.edu
Offline
Nice! XD
I's love to go to MIT or Berkley.
Offline
xly wrote:
@bharvey & Jens
What is your course online ?
http://bjc.berkeley.edu has pointers to the online CS 10 curriculum.
And, yeah, we think it looks snappier with the exclamation point.
Offline
In case these are not already on the list of possible features to add to Snap:
- Ability to manually rename variables
- Potentially more controversial: when creating a variable, the default is "for all sprites". This is not what one should be doing most of the time, so it may encourage bad programming style. (On the other hand, one could argue that forcing people manually select "for this sprite only" makes them more aware of the local/global distinction). In any case, I would argue for "for this sprite only" to be the default.
Offline
knubee wrote:
should
That's sort of an unScratchly word. imho. I mean, when it comes to dealing with other people, yeah, one should be courteous and generous and all that, but when it comes to programming, and encouraging kids to program, our motto should ( ) be "Let me not admit impediments." If your program does what you intended, it's a good program. If it doesn't do what you intended, it might still be a good program:
When/if they grow up and start writing life-or-death software, someone else can whip them into shape.
Offline
xly wrote:
@bharvey&Jens
Brian, I've transposed into Byob your script, but surprisingly it does not reproduce the Snap! curve !?!
Yeah, well, for one thing I think it depends on the sprite's initial heading, and for another, I think maybe it's a bug in Snap!.
Offline