The arduino version is very interesting. Actually, another approach to this might be to modify the generator to make GCC compatible C++ code. JavaScript is so close to C++, it might be easier than generating Spin. Also, the final code could be cleaner looking by including Simpletools.h or something...
But, I'm going to stick with Spin for the moment. I think Spin is slightly easier to understand than C++, and since this would be a ground zero learning tool, maybe that's better...
Ouch! Only if you don't talk about JavaScript's interesting features like: dynamic typing, first class functions, closures, lambdas, nested functions, prototypical inheritance, varadic functions, etc etc a lot of which are features that C++ is only just beginning to adopt in it's latest standards.
Spin is slightly easier to understand than C++
That might be the understatement of the year so far! I don't believe it is possible for a single human being to understand the infinite fractal complexity of the C++ monster.
Having said all that, I have no idea about blockly. Does it let yo use the full features of the languages it generates code for or is it enforcing it's own "syntax" and semantics on things?
For example in JS I can have an array like [42, 93, "Wednesday", someObject, 1000, someFunction, 666].
Clearly a jumble of types in an array like that cannot happen in C++ unless you define some variant base class to contain them all.
The BlockyDuino is proving very useful for showing how to hack into Blockly and add special things...
Also, I'll probably copy the way they handle strings...
Yes I agree. I'm all for it. It's just that the Espruino (JavaScript) and Arduino(C++ I guess) and others can do that already and cheaper. How can we show off the Propeller capabilities with this?
Yes I agree. I'm all for it. It's just that the Espruino (JavaScript) and Arduino(C++ I guess) and others can do that already and cheaper. How can we show off the Propeller capabilities with this?
You remove the "generated code" visibility and directly ship the output of the generator to a compiler and then a loader and you've just blinked or moved. OK, yes, there is Blocky for other controllers which make the Propeller a me too device with a dev board stuck out there. How many grade schoolers (second graders) are going to be plugging a circuit together with a breadboard and components? What you need is something interesting and rugged and grade appropriate plugged in at the other end of the cable.
A small animatronic bear, doll, etc.
A robot
An electronics "playground" with LEDs, servo/motor driven merry-go-rounds, a servo driven teeter-totter, a speaker (kids like noisy things), more LEDs, etc.
That's the tricky part, finding something engaging for the 2nd graders mind that also give programmable peripheral learning opportunities.
Stuff like that until they are ready for a P2 Liquid cooled super turbo development board!
Heater,
By adding blocks that let you do more propeller-y things.
And maybe allow multiple block chains to be part of the same "program" and they each run in a different cog.
Noticed "Extensions" for Scratch 2.0 (in offline mode) that would let you interact with Propeller.
Looks like most people are programming extensions in Python, which is great, except that I don't know how to code in Python.
There's also a helper Python library called BlockExt to help creating custom blocks.
There's also Snap!, very similar to Scratch, that these extensions should work with.
I see extensions for Arduino that may be easily modified by someone who is good with Python.
I found extensions that said they were for the Parallax S2 Scribbler robot. But, this turned out to actually be for a board that plugs into S2 and adds camera and bluetooth, not for Propeller...
I may try to hack the Arduino code, but I"m sure somebody who know what they were doing could make this happen a lot faster...
Just bringing you current on where we've been on this project. Today we have a working Blockly server http://blockly.parallax.com. The blocks are being defined and created, but there are enough to see that you can generate code, program and download.
Yeah, just use the C code generator for now - don't bother with Spin in this case. We've got better library support for the simple stuff with C.
You're all welcome to post any findings here. It's not going to be all that useful just yet since there are so many obvious fixes that there's little sense in bug-hunts.
We're reviewing our Blockly language definition on Monday. After that we'll be making high-speed progress towards a full Blockly multicore implementation!
Does anyone know how to get this working in Scratch itself, or at least get the icons more colorful?
We are starting to get a lot more demand right now for K-5 after school classes. These are public school kids at the end of their day, tired, their attention span vanished around 2 hours ago, etc. The Blockly color palette is much less engaging than Scratch (we've tested it) and I also like the idea of possibly incorporating stuff on that Canvas area while the robot is moving.
You're asking if it is possible to change the BlocklyProp colors to something like used in Scratch? It is possible to do this but Parallax presently has no interest in doing that in consideration of the number of projects we've already published with the current color scheme.
You may be using BlocklyProp with a very young audience. Are you?
You're asking if it is possible to change the BlocklyProp colors to something like used in Scratch? It is possible to do this but Parallax presently has no interest in doing that in consideration of the number of projects we've already published with the current color scheme.
You may be using BlocklyProp with a very young audience. Are you?
Ken Gracey
The ability to change the BlocklyProp color scheme is a desirable feature. While experimenting with BlocklyProp recently, my wife (who is also a multi-lingual/environment programmer) commented that the current BlocklyProp color scheme is a bit too harsh to be sitting in front-of for long periods of time. Color schemes are always subjective and every user has their preferences. Giving BlocklyProp the ability to have even a limited set of Color schemes would go a long way to pleasing a wider audience. Documentation could still use the default Color scheme for consistancy, which is what other environments do.
Comments
But, I'm going to stick with Spin for the moment. I think Spin is slightly easier to understand than C++, and since this would be a ground zero learning tool, maybe that's better...
Ouch! Only if you don't talk about JavaScript's interesting features like: dynamic typing, first class functions, closures, lambdas, nested functions, prototypical inheritance, varadic functions, etc etc a lot of which are features that C++ is only just beginning to adopt in it's latest standards.
That might be the understatement of the year so far! I don't believe it is possible for a single human being to understand the infinite fractal complexity of the C++ monster.
Having said all that, I have no idea about blockly. Does it let yo use the full features of the languages it generates code for or is it enforcing it's own "syntax" and semantics on things?
For example in JS I can have an array like [42, 93, "Wednesday", someObject, 1000, someFunction, 666].
Clearly a jumble of types in an array like that cannot happen in C++ unless you define some variant base class to contain them all.
Also, I'll probably copy the way they handle strings...
Try this out:
http://www.rayslogic.com/Propeller/Programming/Blockly/Test2/BlocklyTest2.htm
If you make this: and push the "Generate Code" button,
you should get this:
Maybe it wasn't "super easy", but you're getting there ;-)
Way cool!!! Totally brilliant!
Only problem is it has to be ser.str for it to send the string.
and if you have an embeded ' in the string, it escapes it to a \' which Spin takes literally.
I generated it, cut and pasted into PropellerIDE and it ran just fine!!
Well done, Rayman!!
Thanks for catching that so fast! I'll fix it now...
Ok, I think it's fixed...
That is cool. I have no idea what one would do with it but I'm impressed.
You barely need to type and you could make a servo move or LED blink or something like that...
Yes I agree. I'm all for it. It's just that the Espruino (JavaScript) and Arduino(C++ I guess) and others can do that already and cheaper. How can we show off the Propeller capabilities with this?
You remove the "generated code" visibility and directly ship the output of the generator to a compiler and then a loader and you've just blinked or moved. OK, yes, there is Blocky for other controllers which make the Propeller a me too device with a dev board stuck out there. How many grade schoolers (second graders) are going to be plugging a circuit together with a breadboard and components? What you need is something interesting and rugged and grade appropriate plugged in at the other end of the cable.
A small animatronic bear, doll, etc.
A robot
An electronics "playground" with LEDs, servo/motor driven merry-go-rounds, a servo driven teeter-totter, a speaker (kids like noisy things), more LEDs, etc.
That's the tricky part, finding something engaging for the 2nd graders mind that also give programmable peripheral learning opportunities.
Stuff like that until they are ready for a P2 Liquid cooled super turbo development board!
By adding blocks that let you do more propeller-y things.
And maybe allow multiple block chains to be part of the same "program" and they each run in a different cog.
@mindrobots,
Remind me again what actual age is a "second grader" in the Sates? So I know what we are talking about.
Here is what one young girl who has been studying such things found about teaching programming to young children:
http://www.youtube.com/watch?v=aiFOurKwy7M
http://learn.code.org/hoc/1
This appears to be Blockly and I see the name Blockly in the page source code.
But, no mention of Blockly anywhere... Strange...
Noticed "Extensions" for Scratch 2.0 (in offline mode) that would let you interact with Propeller.
Looks like most people are programming extensions in Python, which is great, except that I don't know how to code in Python.
There's also a helper Python library called BlockExt to help creating custom blocks.
There's also Snap!, very similar to Scratch, that these extensions should work with.
I see extensions for Arduino that may be easily modified by someone who is good with Python.
I found extensions that said they were for the Parallax S2 Scribbler robot. But, this turned out to actually be for a board that plugs into S2 and adds camera and bluetooth, not for Propeller...
I may try to hack the Arduino code, but I"m sure somebody who know what they were doing could make this happen a lot faster...
Ken Gracey
I see S3 in the board drop down menu, when do we get to play with that?
You're all welcome to post any findings here. It's not going to be all that useful just yet since there are so many obvious fixes that there's little sense in bug-hunts.
We're reviewing our Blockly language definition on Monday. After that we'll be making high-speed progress towards a full Blockly multicore implementation!
Ken Gracey
Sounds good!
dgately
Does anyone know how to get this working in Scratch itself, or at least get the icons more colorful?
We are starting to get a lot more demand right now for K-5 after school classes. These are public school kids at the end of their day, tired, their attention span vanished around 2 hours ago, etc. The Blockly color palette is much less engaging than Scratch (we've tested it) and I also like the idea of possibly incorporating stuff on that Canvas area while the robot is moving.
You're asking if it is possible to change the BlocklyProp colors to something like used in Scratch? It is possible to do this but Parallax presently has no interest in doing that in consideration of the number of projects we've already published with the current color scheme.
You may be using BlocklyProp with a very young audience. Are you?
Ken Gracey
The ability to change the BlocklyProp color scheme is a desirable feature. While experimenting with BlocklyProp recently, my wife (who is also a multi-lingual/environment programmer) commented that the current BlocklyProp color scheme is a bit too harsh to be sitting in front-of for long periods of time. Color schemes are always subjective and every user has their preferences. Giving BlocklyProp the ability to have even a limited set of Color schemes would go a long way to pleasing a wider audience. Documentation could still use the default Color scheme for consistancy, which is what other environments do.