DonHopkins 7 years ago

Also:

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/

  • throw97 7 years ago

    I was very excited about this until I actually tried it. It is toooo slow. Donno why.

DonHopkins 7 years ago

I posted this before about a previous version of Snap!:

https://news.ycombinator.com/item?id=17056444

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! ;)

https://snap.berkeley.edu

Y Combinator: https://i.imgur.com/cOq8tvR.png

A* Pathfinding Demo: https://snap.berkeley.edu/snapsource/snap.html#present:Usern... (press the diagonal arrow button at the top to see the block code in the development environment!)

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

Snap! Tutorial IIIA1: Make a block https://www.youtube.com/watch?v=Bbl2fh3igQ4

Snap! Tutorial IIIA2: Custom Blocks with Inputs: https://www.youtube.com/watch?v=hZC2tDVYWBo

The Basics of Snap! https://www.youtube.com/watch?v=hAxqwwg4uhk

Prototypical Inheritance in Snap! (no audio) https://www.youtube.com/watch?v=lvlWvHgfrlw

Editing Formulas in Snap! (no audio) https://www.youtube.com/watch?v=ahHAl3p3gEU

jacknews 7 years ago

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.

  • ngmc 7 years ago

    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.

    https://en.scratch-wiki.info/wiki/List

    • jacknews 7 years ago

      Yup, tried setting a 'return' variable. It's less than elegant of course, and there are potential concurrency issues.

      Lists can't contain lists, nor can they be passed as inputs to blocks, unless you encode them as text or numbers.

    • TheAsprngHacker 7 years ago

      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.

sinuhe69 7 years ago

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.

TeMPOraL 7 years ago

What's the difference between Snap! and Scratch? They look prima facie identical.