Live data from Hacker News

λ Snap – An inviting programming language for kids and adults for CS study

snap.berkeley.edu

61–70 of 118 posts

Re: λ Snap – An inviting programming language for kids and adults for CS study

#61
post #21

Question (serious) - Why teach kids programming anymore?

If you're thinking that LLMs will be doing all the coding, well, in my experience I get far better results from the model when I say "Write me a function that does X. It should take parameters Y and Z, and its validation step should check for conditions A, B, and C" than when I say "Write me a function that does X" without any further guidance. With no guidance, the LLM can run off in weird directions, and if you don't have any programming experience, you might not realize why those directions are bad ideas.

LLMs, at least the current crop, are skill multipliers. If your skill is positive and large, you'll get great results. If your skill is positive and small, you'll get small results. If your skill is negative, the LLM will harm you more than it helps you.

Re: λ Snap – An inviting programming language for kids and adults for CS study

#62

https://news.ycombinator.com/item?id=38016554 [...] I'm also a huge fan of Snap!, which has all the advantages of Logo (Lisp without parenthesis) and Scratch / eToys / Squeak / App Inventor family of block based visual programming languages, but all the power of Scheme. If you know Scheme, then it's easy to think about Snap!: it's just Scheme with a visual block syntax, but with some functions renamed to make them ea…

> I think Snap! could take advantage of its equivalency with Scheme, and you could just parse Scheme into Snap! blocks, and the other way around. And ChatGPT knows scheme pretty well, though it's not as ubiquitous and standard as JavaScript.

There's already a right-click menu option called "Lisp code". Take the "turn left 15 degrees" block (the "15" is the default value but of course it's a parameter that can be set to anything), drag it out into the editor, and right-click the block. Choose "Lisp code" and `(left 15)` will be displayed in a results bubble; you can then right-click the results bubble and export it to a file or copy it to the clipboard. If you have two blocks put together then the resulting Lisp code looks like this:

    (
        (left 15) 
        (move 10)
    )
I haven't checked recently to see if they have finished the other half of that feature, the parse-Lisp-into-blocks half. But I know they want it to be in there; I forget what its status was last time I checked.

Re: λ Snap – An inviting programming language for kids and adults for CS study

#63

Snap is a little intimidating compared to Scratch. It's clearly designed for older students, but at that point some of the advantages of blocks are lost. Most of these systems suffer from the 'canvas' model, where you have many stacks of blocks scattered around the canvas as they are created, possibly in no particular or logical order. It's difficult to find things or to get a good overview, and really becomes a navi…

In Snap! version 12 they have added the ability to create tutorials, which are projects that load up with a limited set of blocks (you choose what set is available when creating the tutorial). This fixes the intimidation problem: you can even create a set of tutorials that, if the student goes through them in the recommended order, teaches the basics with just four or five blocks available at first, then slowly introduces concepts over time.

Re: λ Snap – An inviting programming language for kids and adults for CS study

#64
post #8

I guess universities suffer from NIH-syndrome just as much as big tech does.

Not true in this case; the original intent for BYOB (Build Your Own Blocks) was as an extension to Scratch. When the Scratch team decided not to merge it, the BYOB folks decided to build it into Snap! instead of abandoning the perfectly-functional code they'd written.

Re: λ Snap – An inviting programming language for kids and adults for CS study

#65
post #9

I don't love graphical programming environments like this and Scratch and I can't quite put my finger on why I find them so unattractive. A big part of it is that you can, to some degree, learn programming from this. But you absolutely cannot learn software engineering from this.

This supports making your own higher order functions. You absolutely can learn software engineering from this. What you can't do is get syntax errors, which makes teaching a classroom of kids by yourself intractable.

I skimmed the manual. It's more powerful than I thought. You can do metaprogramming directly in the language, which will deconstruct blocks into lists. It's basically Scheme as blocks,

Re: λ Snap – An inviting programming language for kids and adults for CS study

#66
post #59
post #3

Earlier quoted context omitted.

Scratch already allows you to create custom Blocks and features lists. This seems like a perfect example of reinventing the wheel (and fragmenting development communities).

When I looked at Scratch six months ago, its lists were deliberately handicapped in function. They could only contain text or numbers; they could not contain other lists. Nor could they be passed as parameters to functions (!!), which really made me say "Nope, this is not what I'm going to use to teach programming to kids". I looked at Logo, and was drawing up lesson plans when I noticed Brian Harvey (the primary des…

Not to mention first class continuations! :)

Thanks!

Re: λ Snap – An inviting programming language for kids and adults for CS study

#67
post #41
post #5

Snap is designed to be more expressive and powerful than Scratch. But I find debugging them is very painful. Changing the name of a variable or block for example, could create “holes” in the calling sites but the system can or cannot report an error and fails silently. Snap is IMO more flaky and the team seems more eager to add features than polish the existing ones or make the system mor robust and stable.

They've fixed surprisingly many of the quirks, but my biggest gripe with Snap is that they don't like to add documentation with new features. A lot of the older content has a nice "help..." context menu option with a description of what it does (which is often out of date itself, e.g. the "split" and "join" by blocks feature isn't shown on those blocks), and newer blocks have the context menu option... but nothing po…

The documentation problem is entirely my fault. I managed to stay up to date through version 8.0, but then so many things happened so quickly that I got swamped. Then I got depressed and gave up.

Also I made the mistake of writing the manual in MS Word. At the time, I couldn't find a standard way to insert pictures into a TeX document, or I would have used that. (Now, of course, there is a standard way.) There is an effort underway to convert the manual into a web-based format in a git repo that anyone can contribute to, but that effort is 90% done and you know what that means! :)

Re: λ Snap – An inviting programming language for kids and adults for CS study

#68
post #57
post #41

Earlier quoted context omitted.

They've fixed surprisingly many of the quirks, but my biggest gripe with Snap is that they don't like to add documentation with new features. A lot of the older content has a nice "help..." context menu option with a description of what it does (which is often out of date itself, e.g. the "split" and "join" by blocks feature isn't shown on those blocks), and newer blocks have the context menu option... but nothing po…

Six months ago I was teaching a beginning-programming course to six kids, using Snap!, so I was reading the forums. And there was a group effort to add documentation to many of the blocks that were lacking it. I haven't been back in a few months, so I don't know how that effort is progressing, but there were definitely some undocumented blocks that were getting documentation completed as I watched, and eventually add…

I have to clarify that the Snap! implementation is 99% the work of Jens Mönig. It was 100% Jens for the first two major releases, back when it was called BYOB ("build your own blocks") and was an extension of the Scratch source code. Then we wanted to use it in a CS course for non-majors at Berkeley so I got in touch with Jens and started complaining about missing features! The result was an intense collaboration in which the coding was still 100% Jens but I contributed ideas about user interface and features. I think my biggest contribution was teaching Jens about lambda!

Our team has officially grown to six people, adding Bernat Romagosa, Jadga Hügle, Michael Ball, and Joan i Pelegay. And several Snap! users have made major contributions, especially to libraries that extend the reach of the language. But the interpreter itself is still all Jens.

Re: λ Snap – An inviting programming language for kids and adults for CS study

#70
post #31
post #28

Any name that you can't type is going to be a problem.

That's more of a problem in text-based coding. One of the things I genuinely like about Snap (well, in my case NetsBlox, which is a fork of it) is the ability to have spaces and weird characters in a variable name. Edit: Oh, you meant the lambda in the post title? It's not really part of the name, but you can at least type it into Snap itself.

There's no need to type the word "lambda" into Snap!. As befits a visual language, we have a visual representation of lambda; it's the gray ring that you sometimes see surrounding an expression or a script. It's a discoverable notation; when you click on an expression you see its value, and when the expression is inside a ring the value you see is the expression itself. We inherited from Scratch the idea of using different shapes of input slots to represent the data type that's expected, round for numbers and rectangular for text. (They have since changed their minds about that, I'm not sure why. They do still use hexagons for Boolean slots.) We have an "expression" data type, and instead of a polygonal shape, we represent expression input slots by preloading them with an empty gray ring. (If you drag something with a gray ring around it into the slot, your ring is absorbed into the one that's already there.) This lets us write higher order functions that are usable by kids who haven't yet wrapped their minds around anonymous functions. It took us three tries to get the notation exactly right, but I'm super proud of it.
Post reply on HN