One of the coolest ways to learn programming I've ever seen is the Snap! visual programming language, which is written in JavaScript and runs in the browser.
https://snap.berkeley.edu
It's the culmination of years of work by Brian Harvey and Jens Mönig and other Smalltalk and education experts. It benefits from their experience and expert understanding about constructionist education, Smalltalk, Scratch, E-Toys, Lisp, Logo, Star Logo, and many other excellent systems.
Snap! takes the best ideas, then freshly and coherently synthesizes them into a visual programming language that kids can use, but is also satisfying to professional programmers, with all the power of Scheme (lexical closures, special forms, macros, continuations, user defined functions and control structures), but deeply integrating and leveraging the web browser and the internet (JavaScript primitives, everything is a first class object, dynamically loaded extensions, etc).
Here's an excellent mind-blowing example by Ken Kahn of what's possible: teaching kids AI programming by integrating Snap! with existing JavaScript libraries and cloud services like AI, machine learning, speech synthesis and recognition, Arduino programming, etc:
AI extensions of Snap! for the eCraft2Learn project
>The eCraft2Learn project is developing a set of extensions to the Snap! programming language to enable children (and non-expert programmers) to build AI programs. You can use all the AI blocks after importing this file into Snap! or Snap4Arduino. Or you can see examples of using these blocks inside this Snap! project.
I was hoping that second one was about Scratch, the visual blocks programming language for kids, similar to Logo, based on a Smalltalk development environment (which is a lot better than X!)
If you're interested in visual programming with a powerful Scheme-like language with first class functions, closures, special forms, macros, and even continuations so you can define your own control structures, check out Snap! (The exclamation mark is part of the name, so it's easy to get excited about Snap!)
It's a descendent of Scratch but more powerful, hand-written in JavaScript instead of Smalltalk, and it integrates easily with JS code. (There's a user defined JavaScript function block that you can use to integrate with the Snap VM and the browser!)
Snap was written by Jens Mönig and Brian Harvey, who know what they're doing! ;)
Snap! is a visual programming language inspired by Scratch. Run Snap! in your browser at http://snap.berkeley.edu/run The IIIA1 in the title means that this is the first tutorial corresponding to Chapter III, Section A of the Reference Manual at http://snap.berkeley.edu/SnapManual.pdf
Yes!
My son is getting into Scratch (50 projects in the last couple of months), but it has at least a couple of serious limitations as a programming language, namely no return values from functions/blocks, and lists are not first-class, making it unnecessarily complex to implement data structures.
The one thing keeping him on Scratch (or rather, away from Snap) is the Scratch community/sharing. I'll have him and his friends consider joining Snap now.
Scratch lists seem relatively first-class to me. Your son could probably have fun building simple data structures with them by making blocks that take an input. He can also update a "return" variable if the situation calls for it.
Scratch lists are not first class. You can only create them as variables; you can't create list "values" (there are no list literals) and you can't pass lists around. You can only provide lists as arguments by choosing list variables from a dropdown of certain built-in blocks.
I love snap! It's IMO the only visual system with them one can teach programming seriously and properly. The only problem is its slow loading speed. And I mean really slow. Any program takes minutes to load (on a iPad). In comparison, program in Scratch 3 (also implemented in JS) takes only seconds to load. Otherwise, it's a perfect system to teach children programming.
Scratch is a simplified version of Lisp/Scheme, without many important features like first class functions, lexical closures, continuations, special forms, the ability to define your own blocks and control structures, and everything being a first class object that you can bind to variables, pass around, and return from functions.
Snap! supports all those important features of Scheme (its original name was BYOB for "Build Your Own Blocks"), with the visual interface and sprite and stage and turtle graphics of Scratch, plus it's written in JavaScript, so it's efficient and easy to integrate with existing JavaScript libraries (see "etoys2learn"!), instead of running in a monolithic Smalltalk virtual machine.
Scratch does allow you to make your own blocks with optional input. My math students use them to learn about abstraction. The most recent implementation was released last winter and is written in JavaScript.
Scratch 3 does not enable one to define new functions only new commands. Snap! user-defined functions are first-class - they can be used to define higher-order functions.
Visual Lambda: Note how the gray block after the "report", shrink-wrapped around the "call (fn) with inputs (fn) []", is a visual "lambda". It looks like a "gasket" or "baggie" that insulates the code inside from being immediately evaluated, returning a closure instead.
Snap! takes inspiration from Scheme. I wouldn't compare Scratch to Lisp/Scheme at all, as IMO lambdas, cons-cells, and (the ability to make) expression-based control structures are all defining features of Lisp/Scheme, and Scratch does not have any of them. To my understanding, Scratch's design seems to be inspired by Kay-style OOP (Scratch's "broadcast" feature is about passing messages between sprites, and the first version of Scratch was written in Squeak).
Thank you! That answers all my questions. I'll go play with Snap! then.
BTW. you seem to know your way around these kinds of semi-visual languages; any opinion on NetLogo? A coworker recently introduced me to it, and it looks like a great tool for doing agent simulations. I wonder if you know of anything else worth paying attention to in this space?
I haven't tried it myself, but I've heard it's really cool, and have read people who've used it praising its virtues and discussing its limitations. It sounds like something I'd like, since it's great for agents and cellular automata.
NetLogo – A multi-agent programmable modeling environment (northwestern.edu)
"Gadget Background Survey" by Chaim Gingold (who made Earth Primer), research he did at HARC for the Gadget project with Dan Ingalls (who made Squeak and Lively), which includes Alan Kay's favorites, Rockey’s Boots and Robot Odyssey, and Chaim's amazing SimCity Reverse Diagrams, and lots of great stuff I’d never seen before:
https://news.ycombinator.com/item?id=17594403
One of the coolest ways to learn programming I've ever seen is the Snap! visual programming language, which is written in JavaScript and runs in the browser. https://snap.berkeley.edu
It's the culmination of years of work by Brian Harvey and Jens Mönig and other Smalltalk and education experts. It benefits from their experience and expert understanding about constructionist education, Smalltalk, Scratch, E-Toys, Lisp, Logo, Star Logo, and many other excellent systems.
Snap! takes the best ideas, then freshly and coherently synthesizes them into a visual programming language that kids can use, but is also satisfying to professional programmers, with all the power of Scheme (lexical closures, special forms, macros, continuations, user defined functions and control structures), but deeply integrating and leveraging the web browser and the internet (JavaScript primitives, everything is a first class object, dynamically loaded extensions, etc).
Y Combinator demo:
https://i.imgur.com/cOq8tvR.png
https://snap.berkeley.edu/snapsource/snap.html#present:Usern...
Here's an excellent mind-blowing example by Ken Kahn of what's possible: teaching kids AI programming by integrating Snap! with existing JavaScript libraries and cloud services like AI, machine learning, speech synthesis and recognition, Arduino programming, etc:
AI extensions of Snap! for the eCraft2Learn project
https://ecraft2learn.github.io/ai/
>The eCraft2Learn project is developing a set of extensions to the Snap! programming language to enable children (and non-expert programmers) to build AI programs. You can use all the AI blocks after importing this file into Snap! or Snap4Arduino. Or you can see examples of using these blocks inside this Snap! project.
https://github.com/ecraft2learn/ai
http://lntrg.education.ox.ac.uk/presentation-of-ai-cloud-ser...
Use devices with Snap!:
Orbotix Sphero guide by Connor Hudson and Dan Garcia:
https://docs.google.com/document/d/11wR53OTnofRtTtxZCmxnCUjI...
Lego NXT package by Connor Hudson:
https://github.com/technoboy10/snap-nxt
Nintendo Wiimote package by Connor Hudson:
https://github.com/technoboy10/wiisnap
Finch and Hummingbird robots package by Tom Lauwers:
https://www.hummingbirdkit.com/learning/snap-programming/
Parallax S2 robot package by Connor Hudson:
https://github.com/blockext/s2
LEAP Motion by Connor Hudson:
https://github.com/technoboy10/snapmotion
Speech synthesis by Connor Hudson:
https://github.com/technoboy10/snap2speech
Arduino package by Alan Yorinks:
https://github.com/MrYsLab/s2a_fm
Arduino package by Bernat Romagosa/Citilab:
http://snap4arduino.rocks/
Fischertechnik ROBOTICS TXT Controller by Richard Kunze:
https://github.com/rkunze/ft-robo-snap
Snap! for Raspberry Pi by rasplay.org:
http://downloads.rasplay.org/pisnap/
More Snap! extensions for CS education:
snap-apps.org provides Edgy for graphs, Cellular for multi-agent simulation, and more.
http://snap-apps.org/
http://www.snap-apps.org/edgy.html
http://www.flipt.org/#cellular
Netsblox for multiplayer networking.
https://netsblox.org/