This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#26 2008-04-13 15:31:58

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Scratch Source Code

costellorob, as far as I know both Squeak Etoys and Scratch will be on the XO (the OLPC). Squeak Etoys already is on it, and Scratch is in beta right now.

Having a more "typable" version of Scratch is a wish I have read often in the starting days of Scratch, and it still comes up sometimes, so I guess there's some demand here. Did you know that you can write a "project summary" to disk (by shift-clicking on the Extras button), which contains all the scripts in a readable sort of pseudo code format? The problem is, you can't get this "summary code" back into Scratch. That's one of the reasons I have been experimenting with converting Scratch scripts to XML.

Scratch does not, however, at some point "translate" its blocks into Smalltalk (or any other programming language). The blocks of Scratch rather are the language themselves, and they are interpreted when a project is executed. Technically blocks often correspond to messages in Scratch's execution engine, which is implemented in Smalltalk. The syntax of these messages, however, is completely different from that of Scratch (which is basically syntax-free, meaning as long as two blocks fit together you don't have to worry about syntax at all).


Jens Mönig

Offline

 

#27 2008-04-19 02:44:13

_scratch_
Scratcher
Registered: 2008-04-14
Posts: 2

Re: Scratch Source Code

thanks Jens

yes, i've had a little dig into Squeak and see how - in principle - the blocks get mapped to Smalltalk commands; ran your project on adding new commands as well 

i understand that the blocks per se are the commands in scratch - and thats the idea of it

but i still think offering an *optional*  textual view of commands, within Scratch itself, in a more scripty / procedural manner, might  give scratch a bit more 'height'  -
ie would make a nice scaffold if you could see how the blocks were being translated into some sort of script - (not smalltalk itself) - which you could also write with, and see switch back and see how the blocks had changed / grown

being able to switch modes there might really launch some kids beyond Scratch this as well ..

Offline

 

#28 2008-05-22 20:51:39

harrypotter345
Scratcher
Registered: 2008-01-02
Posts: 100+

Re: Scratch Source Code

<abs( <round( <{  }><{  }><change{  }by( <direction><turn cw(10)degrees>


Do you like games with a twist?
Then you HAVE TO see my two new games: SEARCHLight and Park your carrot! They are awesome games that you just HAVE TO see!

Offline

 

#29 2008-05-26 17:58:28

N-Wear
Scratcher
Registered: 2007-08-13
Posts: 100+

Re: Scratch Source Code

Copied off my thread:

N-Wear wrote:

Ok, I have the scrach squeak code up and running, but I'm not that familer with small talk. I know Just-Basic* and tried to enter the date and time code:

Code:

time$

Code:

date$

But it didn't work. Is there a time and/or date code for small talk? Thanks!!

*Just-Basic: A simple programing language. http://www.justbasic.com/

Last edited by N-Wear (2008-05-26 18:02:45)


If bread crumbs are better than nothing. And nothing is better than cheese cake. Then, bread crumbs are better than cheese cake!  smile
The following sentence is true. The previous sentence is false.  hmm                              Treat others the way you want to be treated!  big_smile

Offline

 

#30 2008-05-27 01:24:09

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Scratch Source Code

answered in the other thread: http://scratch.mit.edu/forums/viewtopic.php?pid=38028#p38028


Jens Mönig

Offline

 

#31 2008-05-31 11:01:15

christo
Scratcher
Registered: 2007-06-08
Posts: 2

Re: Scratch Source Code

Hi Jens,

Interesting discussion. I've only just started playing with Scratch.

Jens wrote:

Having a more "typable" version of Scratch is a wish I have read often in the starting days of Scratch, and it still comes up sometimes, so I guess there's some demand here. Did you know that you can write a "project summary" to disk (by shift-clicking on the Extras button), which contains all the scripts in a readable sort of pseudo code format? The problem is, you can't get this "summary code" back into Scratch. That's one of the reasons I have been experimenting with converting Scratch scripts to XML.

... [Scratch] is basically syntax-free, meaning as long as two blocks fit together you don't have to worry about syntax at all.

I see what you mean. I look forward to having time to look into your work in this area. I have pondered this stuff while enjoying playing with the nice slick Scratch user interface with my enthusiastic young kids (surely, neither of whom share my following thoughts).

Firstly, typability in Scratch would be great. But perhaps just a full-featured keyboard-capable interface would mostly fix things for me. How could you make Scratch possible without a mouse? That's actually what I first thought you meant when you said typability but having read your XML reference I assume you mean in the sense of a textual representation.

Secondly your comments make me think about surface syntax. I think the spirit of a programming language ("what it wants to be", "how it changes how you think" etc.) is sometimes obscured to outsiders by surface syntax and this can be a marketing hurdle that designers try to avoid by being more conventional for the target audience (e.g. C++, Java) at that surface level.

So too has the Scratch project focused a huge amount of effort on surface syntax; making friendly toy-like blocks that are only controlled by the mouse. Kids with no programming experience are the target audience. But there is still a syntax and there are still syntax errors. You can't leave certain holes in your expressions and the fact that the editor constraints have such clear rules about the executability of what constitutes an atomic act of composition does not mean that there is no syntactical model. It's just more difficult to create syntax errors. (However that famous Noam Chomsky quote shows syntatically correct nonsense is easy: "Colourless green ideas sleep furiously.").

But this block syntax isn't the essential Scratch language, it's only a notation for it. An alternative is implemented in this very forum!

Finally I am interested in your use of XML as a representation format. No doubt you selected it for the same reason everyone else does - the surface syntax is parsed for free. But it isn't my idea of typeable!

An interesting article about XML in this context of surface syntax is actually what got me (re)thinking about this stuff. It's by Martin Fowler (ex-Smalltalker & Pattern pundit) and it's about the disproportional resistance developers have to using a DSL/minilanguage with a custom syntax even when it would suit the domain better than, say XML. I found it an interesting read:

http://www.martinfowler.com/bliki/ParserFear.html

Also I read somewhere that the typical angle brackets are not essential to XML, that it is only one (dominant) notation for it. I am led to believe that there are alternate (more typeable) notations available. You can probably easily imagine such possibilities.

Finally, thanks for your evident work in opening the world of Scratch+Squeak to newcomers like me. I really appreciate it.

Christo.

Offline

 

#32 2008-06-02 03:41:17

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Scratch Source Code

Hi Christo,

Thanks for your insightful comment! Actually, the reason I used XML was that I already had a DOM/Parser implemented in Squeak for another project, which I could just reuse. I'd really like the Scratch programming language to be more accessible from the outside (e.g. to share scripts on websites or have other apps generate Scratch projects/scripts)....


Jens Mönig

Offline

 

#33 2008-07-19 22:35:57

alexdz
Scratcher
Registered: 2008-04-09
Posts: 6

Re: Scratch Source Code

How come i cant get it? <stop all sounds>   mad

Offline

 

#34 2008-07-22 11:56:23

the3rdage
Scratcher
Registered: 2008-07-20
Posts: 100+

Re: Scratch Source Code

thank you i wanted to know where this was since i started

Offline

 

#35 2008-07-26 10:45:01

songhead95
Scratcher
Registered: 2008-03-19
Posts: 100+

Re: Scratch Source Code

Other than just flip, are there any other block making tutorials that maybe focus more on the different codes for effects?

Offline

 

#36 2008-09-24 16:48:10

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Scratch Source Code

Are you possibly going to release the 1.3 source?

Offline

 

#37 2008-10-16 17:12:06

bendad
Scratcher
Registered: 2008-06-14
Posts: 100+

Re: Scratch Source Code

MITscratcher wrote:

Thank you for your help, I had just figured it out last night. I had already downloaded "Squeak", and I may only be a kid, but I did learn a lot about it. My ambition is to go to MIT when I go up (and to become a programmer). Do you think smalltalk will be a good language for me to start with to learn and work my way up to more advanced programing?

Me Too!


Hi!  big_smile
Good to see you. (Even if I don't know you  wink  )

Offline

 

#38 2008-10-19 15:24:26

Surfer123
Scratcher
Registered: 2008-09-13
Posts: 33

Re: Scratch Source Code

I made some new blocks too on Scratch Source!


Muffins are awesome. Check out Worm!!

Offline

 

#39 2008-10-28 12:07:48

lipflip
Scratcher
Registered: 2008-05-17
Posts: 4

Re: Scratch Source Code

Does anybody know how the default sprite in the scratch source code can be replaced? I'm doing some experiments and I need to have a different sprite without replacing it by hand all the time.

Offline

 

#40 2008-10-28 16:27:43

jcubed
Scratcher
Registered: 2008-07-23
Posts: 65

Re: Scratch Source Code

lipflip wrote:

Does anybody know how the default sprite in the scratch source code can be replaced? I'm doing some experiments and I need to have a different sprite without replacing it by hand all the time.

it can be done but I don't know how, ask Jens


Jcubed
Proud founder of Icdzat Productions.

Offline

 

#41 2008-11-04 16:20:20

aresnick
Scratcher
Registered: 2007-09-17
Posts: 2

Re: Scratch Source Code

http://scratch.mit.edu/pages/source seems to be down, but the 1.2.1 code is still up at http://scratch.mit.edu/files/source-code/ScratchSource1.2.1.zip

-a.

Offline

 

#42 2008-11-29 04:46:13

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Scratch Source Code

Because there is no 1.3.1 source code released, I am trying to cause a bug in Scratch. I have the bug (Just paste a very long text in the say block) and I am able to open a browser.

But for some reason, when I click something in the 4th column to view the code I get an error message

"message not understood: isSeparator" in a red debug window.

Am I doing something wrong?

I am just experimenting with the source code of scratch. Things like Presentation mode in a window by taking out the fullscreen commands, and making the presentation mode look white instead of black  big_smile  (I did those things with the old source code)


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#43 2008-11-29 12:00:33

ericr
Scratch Team
Registered: 2007-03-21
Posts: 23

Re: Scratch Source Code

Hey JSO- the source for 1.3.1 was recently released, maybe that will help!

http://scratch.mit.edu/pages/source

Offline

 

#44 2008-11-29 15:19:07

jcubed
Scratcher
Registered: 2008-07-23
Posts: 65

Re: Scratch Source Code

in the sorce code you can't open scratch...
oh, well I've allready hacked into the real thing so I don't care!


Jcubed
Proud founder of Icdzat Productions.

Offline

 

#45 2008-12-01 12:59:20

ericr
Scratch Team
Registered: 2007-03-21
Posts: 23

Re: Scratch Source Code

hi jcubed- here's how to run scratch in source code version:

- click on the gray empty area to get a "world" menu
- click "open..."
- click "Scratch"

Offline

 

#46 2008-12-11 17:23:47

llamalord318
Scratcher
Registered: 2008-09-29
Posts: 1

Re: Scratch Source Code

I was just wondering how to get the old effect blocks by editing the 1.3.1 source.

Offline

 

#47 2008-12-30 20:36:45

MrMadMan
Scratcher
Registered: 2008-10-28
Posts: 100+

Re: Scratch Source Code

How do i open which program all i see is scratchsourcecode.image


http://scratch.mit.edu/forums/viewtopic.php?id=18385
Go to build a life  big_smile  Offical Member of Hero RPG

Offline

 

#48 2009-01-01 14:21:50

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Scratch Source Code

MrMadMan wrote:

How do i open which program all i see is scratchsourcecode.image

You need a program called Squeak Smalltalk.


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#49 2009-01-06 11:57:04

techy
Scratcher
Registered: 2008-12-17
Posts: 100+

Re: Scratch Source Code

I made a previous costume block  big_smile


Guppy Inc. making projects famous!
http://web-geeks.com/techy.gifhttp://web-geeks.com/grid.gifhttp://web-geeks.com/challenge.gif

Offline

 

#50 2009-05-14 18:23:09

Solarbuddy
Scratcher
Registered: 2009-04-14
Posts: 500+

Re: Scratch Source Code

Can somebody tell me how to do the open image file!


http://bit.ly/Vn3zid
                  View my latest project

Offline

 

Board footer