etoys for squeak, which is somewhat similar to scratch (and supposedly influenced its development) has the ability to switch between blocks and the smalltalk code that the blocks generate. so you can basically look under the hood (and also change the smalltalk code)