Snap! version 10.0.0 is out!

I don't know how I'm not seeing anything on the forum about the update. This is a HUGE update!

10.0.0:

  • New Features:
    1. Blocks all the way
    • all blocks in the palette are now custom blocks, except hat blocks and rings
    • bootstrap global custom blocks as primitives
    • new "primitive" (pragma) block for custom block definitions
    • support for associating custom block definitions with primitives
    • support for overloading primitives with custom block definitions and organizing them in libraries
    • new experimental (hidden) option to bulk-toggle the use-primitive switch in all customized primitives
    • export and include customized primitives in libraries
    1. New blocks and new block features
    • new "skew" primitive block for costumes
    • new "a new clone of 'Turtle sprite'" feature - makes a new temporary Turtle sprite that does not inherit anything
    • lazy translation support for data
    1. Customizing Blocks
    • color type input slots for custom blocks
    • variadic variables type input slots for custom blocks
    • destinations, locations, keys, data types, objects + self, sprites + self, collidables, object attributes, microphone, scenes, primitives, properties and extensions dropdown menus for custom blocks
    • upvars in custom blocks can now have different default names than their formal parameter names
    • "collapse" label support for variadic inputs in custom blocks
    • variadic "collapse" (prefix label) support for custom blocks
    • default values for variadic slots inside custom blocks
    • initial subslot number support for variadic inputs
    • special "receivers" type input slots for custom blocks (as in the "broadcast" primitive)
    • special "send data" type input slots for custom blocks (as in the "switch to scene" primitive)
    • max/min subslot number support for variadic inputs in custom blocks
    • new "input names" selector in the (attribute OF target) primitive reporter
    • prefixing a default text value in the slot-type dialog with dollar-underscore tags it as translatable selector
    • support translating custom drop-downs by prefixing items with $_
    1. Customizing the palette
    • custom blocks can be rearranged in the palette via their context menu, thanks, Simon Mong for pioneering this!
    • custom blocks can be grouped in the palette by adding vertical spaces in between them
    1. Customizing the IDE
    • new API configuration option to hide the project name, thanks, Bernat!
    • new API configuration option to hide project specific entries in the file/project menu
    1. Metaprogramming
    • new Metaprogramming library
    • allow (nested) lists of block label parts in the DEFINE command to express multi-line block labels
    • metaprogramming support for color type input slots (number: 13, spec: "clr", mnemonic: "color")
    • metaprogramming support for color type variadic variables slots (number: 14, spec: "scriptVars", mnemonic: "vars")
    • metaprogramming support for "collapse" labels in variadic inputs
    • metaprogramming support for c-slots with loop arrows (number: 15, spec: "ca", mnemonic: "loop")
    • metaprogramming support for "expand" (slot prefix) labels in variadic inputs
    • metaprogramming support for default values of variadic inputs
    • metaprogramming support for initial variadic subslots
    • metaprogramming support for message-receiver type multi-slots (number: 16, spec: "receive", mnemonic: "receivers")
    • metaprogramming support for send-data type multi-slots (number: 17, spec: "send")
    • metaprogramming support for max/min subslot number in variadic inputs in custom blocks
    • metaprogramming support for newlines in custom block labels ("$nl")
    1. Extensions
    • new "Code to Blocks to Code" library, translates text code to blocks and vice-versa
    • new 3D Beetle Geometry extension, thank you, Bernat!
    • new experimental "Embroidery" library
    • new EDC Early Maths Microworlds, thanks, Zak Kolar and Bernat!
    • new "writing and formatting" library, thanks, Tethrarxitet!
    • new "Outlines and Halos" library
    • new "snap" category with new "snap_block_selectors" extension primitive
    • new "bootstrap" and "un-bootstrap" extension primitives
    • new "bootstrapped(block)?" extension primitive
    • new "snap_yield" extension primitive
    • new extension primitives for encoding / decoding blocks to and from xml
    • new 'xhr_binary(url, webIDL_type)' extension primitive
    • new "binary data from (url) type (webIDL)" reporter in the web-services library
    • pixels library: new "grayscales of (costume)" reporter
    • pixels library: new "rectangle costume" reporter
    • new "sigmoid" easing function in the animations library (for neural networks)
    1. Hypermutation
    • new "changeBy(data, delta)" extension primitive
    1. Live Coding
    • new live coding "performer mode" setting, thank you, Bernat!
    1. Matrix-kernel convolutions
    2. Lisp code / codification
    • new LISP-like text syntax for blocks and scripts
    • new "Lisp code..." entry in blocks context menu
    • new "code..." entry to blocks context menu if "Codification support" setting is enabled
    1. User interface
    • copy text from variable watchers, block result bubbles and sprite speech/thought balloons to the clipboard
    • new Search feature for the library browser, thanks, Michael!
    • new "svg poly" export format for vector pen trails, optimized for speed and laser-cutting
    • export vector pen trails as embroidery files (DST, EXP)
    • added pen trails export options to the project ("file") menu
    • added ability to switch octaves in the piano keyboard menu, thanks, ego-lay-atman-bay!
  • Notable Changes:
    1. Blocks all the way
    • renamed "primitive" blocks into "extension"
    1. Blocks behavior
    • drawing a dot when moving zero steps now observes the flat-line-ends settings and draws a centered square or rhombus the size of current pen and in its direction
    • optimized FOR-loop and FOR-EACH-loop for speed
    1. Custom Blocks
    • keep the order & position of existing custom blocks in the project palette when overloading them with imported blocks
    • support for multiple separator lines in input slot dropdown menus
    • Libraries (and Costumes, etc) media files are now in a JSON format, which supports translation and additional search metadata.
    • arcs library: changed label wording to TurtleStitch convention, added "arc left" version
    1. Metaprogramming
    • automatically add generic inputs in DEFINE matching the number of placeholders in the label
    • when querying the defintion of a block via metaprogramming the number of inputs of the resulting ring now matches that of the header expression
    • block label symbols are now shown with their name prefixed by "$" instead of an underscore to avoid confusing them with inputs when metaprogramming
    • the metaprogramming getter for "translations" block attribute selector now always returns a list
    • custom block definition comments can now be deleted by setting them to nothing (empty string, zero or false)
    • the "define" block now always creates a new custom block definition instead of sometimes modifying the definition body of an existing one with a matching label
    • support for smooth animations in recursive control structures defined using metaprogramming
    • When programmatically setting the "slots", "defaults", "menus", "editables" or "replaceables" of a custom block to a non-list type, apply the type to all slots instead of just the first one.
    1. Hypermutation
    • the "change by" command for variables is now hyperized and even recursively mutates (!) data
    1. User interface
    • scroll long text inside result balloons instead of shortening it
    • Confirmation pop-ups when closing the browser tab only appears in the event of unsaved changes, thanks, 2-www
    • more help screens, thanks, Brian and the forum gang!
    1. Lisp code
    • splitting a LISP-formatted text by "blocks" returns a block-syntax tree
    • converting a block-syntax tree to "text" using the list-selectors reporters reeturns LISP code
  • Notable Fixes:
    • fixed a type error when using metaprogramming to copy default inputs from a primitive over to a custom block definition
    • fixed referencing system drop-down menus in metaprogramming
    • fixed correctly evaluating (reifying) static (irreplaceable) C-slots inside custom blocks
    • only capture the caller once in repeating recursive calls
    • fixed a rendering situation glitch for live rings
    • fixed a bug in the colors library, thanks, Brian!
  • Documentation Updates:
    • new Snap! Lisp Syntax documentation
    • updated extensions.md
  • Translation Updates:
    • German

BTW, I put this in Events because apparently I don't have access to the Announcements category. I think it's because I'm not a moderator.

I missed the new MicroBlocks library that let's you connect to a MicroBlocks programmed microcontroller using USB or BLE.

Wow -- still no other replies? Either people are still reading the list of new features and changes or I'm just not popular around here... :frowning:

You have definitely very little patience :wink:

I was mostly kidding, although I have felt quite unpopular, for some reason. I've lost count of how many times I've embarrassed myself on this forum...

Also, I haven't read all of this, mainly because I don't understand 70% of it.

I'm usually quite patient, thank you very much.

I NEEDED THIS! It was so annoying to have to save text files to my computer just to use them somewhere else.

This is great!

Great for the URL reporter.

Slightly less annoying now!

I minorly contributed to this. Granted, I only added help for the position reporter, but that's still a contribution, right?

That's the only language? That's anticlimactic.

You're welcome!

I'm not gonna lie, I literally woke up one day and decided to see if I could make the piano keyboard better, and then I created a pull request the day before snap 10 released (which made this the last new feature added before snap 10 released).

Just noticed a bug: Sensing's _ of _ block, when put into the ring in untitled script pic (5), removes the ring. Only the OF block does this, and it happens in all blocks with rings.
@ego-lay_atman-bay: Nice.

that's a feature! Some blocks do that automatically when the result is expected to be already reified.

Okay. I didn't know that. Thanks for explaining.

Absolutely!

This always happens when there is a new major version, because there are always new text strings to translate, and most of the translations are done by people outside our team. Other translation updates will trickle in over the next few weeks. (Sometimes the Catalan translation makes it into the x.0.0 release if Bernat isn't too busy.)

By the way, Jens somehow forgot to list the new streams 2.0 library in the release notes. :~( Thanks, @qw23!

You’re welcome! (and thanks to you ( @bh ) for all of your help!)

what are these?

IDK. I don't understand half of the changelog.

Shift click the settings menu, and you'll see the option. The option is to make every single primitive use their snap code instead of their javascript code.

Most programming languages provide an initial set of procedures (primitives) and allow users to create new procedures. In some languages, all the primitives use special syntax, such as the infix arithmetic operators, and so it's not obvious that there are primitives. But there are. Typically, the primitives are implemented in some lower-level language—in the extreme case, machine language (in the form of assembler notation). So, pre-v10, Snap! primitives, for example, have been implemented in Javascript.

But there are very few primitives that can't be expressed in terms of other procedures. The others are primitive only because it makes the language run faster. As a trivial example, > can be defined in terms of <, =, and the Boolean operators AND, OR, and NOT.

An example that's much more significant in Snap! history is that the higher order list functions MAP, KEEP, and REDUCE can all be defined in terms of list selectors (e.g., ITEM 1 OF) and CALL; the latter and its sibling RUN are the basis of all higher order procedures in Snap!. We are very proud of the fact that we can write MAP and friends in Snap!, without recourse to Javascript code, because we have first class procedures. In our earliest versions (in BYOB), the HOFs were indeed library procedures implemented in Snap! itself. This was a great virtue pedagogically; students could see that functions of functions aren't magic, and you can write your own. But it made the HOFs slow. That wasn't so important until people started using Snap! to handle large amounts of data, including, in particular, costumes and sounds. So we made the HOFs primitive, at the cost of making them opaque.

But in v10, we take an idea from Smalltalk, which was entirely written in Smalltalk itself. So almost all primitives include an implementation in Snap! code, visible when you edit them. Here's COMBINE:

The gray PRIMITIVE block calls the Javascript implementation if the Boolean input at the left is true (and returns whatever it returns). If not, though, it actually runs the Snap! code that comes after it.

This gives you the best of both worlds; you can have super fast primitives, but you can also see how their algorithms work, and you can make your own modified versions if you choose. (E.g., the Snap! code shown here doesn't quite give the same answer as the Javascript primitive if the input list is empty:

whereas the Snap! code always reports zero, regardless of the function input, if the list input is empty. This isn't because Snap! can't do what the Javascript code does. So, as an exercise, write a correct Snap! implementation of COMBINE, which, if the input is a variadic block, calls it with no inputs when the list is empty.)

Pedagogically, there's a tradeoff between a correct implementation and a readable one. Arguably it's good that the Snap! implementation of COMBINE leaves out the code to check for that special case. In the case of MAP, though, a similar question led to the opposite solution:

This implementation handles the case of supplying implicit inputs VALUE, INDEX, and LIST to gray rings in the MAP function input. Arguably it'd be better pedagogy to show it as

Taking this argument a step further, note that the Snap! code for MAP in v10 doesn't really behave like the primitive, which distinguishes linked lists from dynamic arrays:

What's a linked list? What's a dynamic array? Read this:
I copied a list to another variable, and then when I change the copy, it changes the original too! - #13

And continuing our exploration one step further, I note gleefully that Jens, who pooh-poohs my annoyingly repeated requests for FOR I = 1 UPTO 10 on the grounds that nobody except me ever gets bitten by the fact that FOR (and NUMBERS FROM) counts backward, has that exact bug in his Snap! version of MAP:

:~P

On the contrary: all other languages have been continuously updated in weekly patches while in production. It's only the specific v10 features that needed to be added to the translation, and since I'm German I've updated their German translation :smiley:

whats this:

and

also,

?

why doesnt the definition reflect that? (also how do you get the link block in snap although I know i can get it from the script pic)

I assume that's talking about how you can set the selector of a custom block to one of a primitive block (and also use the <> primitive [] block in a custom block).

That just means that you can do stuff like this

and

literally what is the point

oh. quite simple.