jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.51k stars 744 forks source link

Why can't I put a variable into a read-only menu slot? #3089

Closed brianharvey closed 2 years ago

brianharvey commented 2 years ago

Here's what I tried: split-by-block-test script pic (2)

I want to put ATTRIBUTE into each of those empty menu slots, but it won't let me. (This is true in general, not just for the OF BLOCK blocks.)

<I-told-you-so> Used to be, I could just leave those menu slots empty and FOR EACH would fill them. But nooooo, everybody wanted empty slot substitution not to work in FOR EACH. </I-told-you-so>

brianharvey commented 2 years ago

P.S. Yes, I know I can do it by using a RUN block to do the substitution.

cycomachead commented 2 years ago

The original question: This is because for orange set, we really prevent the otherwise-too-common issue of dragging orange blobs into regular set blocks.

But this set block is different, I do agree with that. @jmoenig Maybe we should remove the static type on this input, so it's a read-only menu, but accepts drops?

jmoenig commented 2 years ago

I really, really do not ever want English text to be indicators / selectors for anything in the language. This is somewhat of a Golden Rule for Snap's design, and it's tricky when going meta. But for a visual programming language it's just something that discriminates terribly against almost everybody anywhere in the world and I'd rather not support meta-operations at all than make them in a certain language. I know, I know, I've made it so that some strings can also be entered in English, but just because I've given in to a few cases out of sheer oportunism doesn't mean I'm going to make this a general principle.

All in all I have to say that after the near total fiasco of introducing meta-programming and its inaccessible history at SnapCon22 I'm seriously regretting going down that path in v8. I never should have. This feels like an overall mistake in hindsight, scaring off even our most loyal fan-users. We've failed hard at demonstrating how any of this can be turned into relevant, fun and insightful learning projects. And - frankly - this kind of intellectual impoverishment has been going on long enough for my taste.

brianharvey commented 2 years ago

Re: fiasco

Umm. This is taking me by surprise; earlier you seemed to be happy with my talk. I do confess that I'm nowhere near as good as you at coming up with great examples. But I think I've said all along that these are features for developers rather than directly for users.

It's entirely my fault that my preparation for the talk was so last-minute. In retrospect this was the wrong time to have me do a keynote. But I don't think it's my fault that I find writing metaprograms much harder in Snap! than in Scheme. I'm not pointing fingers, I'm just pushing back about hearing "It's obvious" from Jens about things that, sorry, aren't obvious to me.

Maybe the users will find it easier when we implement the pattern-matching macro style that comes with hygienic macros. I dunno.

About English: I agree with the principle as a principle, but whenever I run up against it in practice, it just seems to make life either difficult, like those numbers for categories, or impossible, as in this case. I think it's not so outrageous for people to want to copy blocks. If you don't want to let them program with the fields of a block, maybe we need a copy primitive that knows about all of them. Otherwise what happens is that people are tempted to go below the abstraction barrier and just treat the block as an array of bits without meaning.

I'm depressed.

jmoenig commented 2 years ago

Wait! This wasn't so much about your talk at all!!!

Remember how after mine the question came up immediately "where will it stop?", and then "how can we hide this new feature?". Those were the 2 thing we discussed after my talk, that is. So, yeah, everybody loves my talks for being "enthusiastic", but also nobody likes just what I'm showing to them. Talk about being depressed!

Essentially we've failed to make it apparent how meta-programming can be used for relevant activities. I get the disclaimer about library authors, but - frankly - that's a deathbed argument for any programming language. Remember how Smalltalk was meant to be a "language for making new languages"? Well, guess what, that never happened. Somebody wants to make a new PL, they use ... C, not Smalltalk. Same for Racket, which was also meant to be a "language for languages". Same there, only Racketeers use Racket for their little teaching subsets of the language. The "you can do anything you can think of in my language" argument has never worked for any of the languages I love. It's much better to be really good at certain things....

But let's not get into a competition about who's more depressed. I need a vacation and a fresh start in the fall. So do you. The past months and weeks with you and me working on DEFINE and macros have been a wonderful, energetic, and extremely productive and satisfying experience! Thank you for all of that.

Now the actual work has to start. And that is about creating learning activities around them!

brianharvey commented 2 years ago

Okay, yes, let's make good examples. After your vacation. Maybe I should take a vacation too -- just pretend I'm someplace without Internet.

jmoenig commented 2 years ago

It‘s not accessible to use untranslated selectors. I‘d much rather you‘d spelled it all out using just blocks.

Von meinem iPhone gesendet

Am 31.07.2022 um 23:18 schrieb Brian Harvey @.***>:

 P.S. Yes, I know I can do it by using a RUN block to do the substitution.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

brianharvey commented 2 years ago

Well, maybe we need "metatranslation" blocks in local language in English so I could say MAP (_ IN LOCAL LANGUAGE) (LIST category type scope ...)