Discuss Scratch

bharvey
Scratcher
1000+ posts

Snap! user discussion

BookOwl wrote:

I still wish Snap! had algebraic data types and pattern matching though.
Algebraic types: We do! The algebra is based on the set {pointer}. The identity element for type composition is pointer. Etc.

Pattern matching: Yes, that would be nice. Although writing a pattern matcher is a great programming exercise! When we get around to macros, I guess we're going to have to think about whether to implement syntax-rules, or whether to do old-fashioned fexprs, or both.

cycomachead
Scratcher
100+ posts

Snap! user discussion

bdilloughery wrote:

Does anyone know how (if you are able to) use Objects as inputs for a custom block?

I tried, but I just get the turtle icon. I can't drag a sprite onto it or click on it to select from a list.

In the Snap! reference manual it says this feature is to come in version 4.1 but I don't think this is released yet. Just curious if anyone has done this … such as a custom block to sense if sprite1 is touching sprite2 or sprite3. Something like this.

Thank you,
Brendan

Yes, it's possible right now, but slightly unintuitive. Use the “my ()” block in the Sensing palette. You can report “my (self)” or select another sprite.

Really, input types are hints - you could drop in a JOIN block or a variable and it will work fine. It's very likely that you're passing that input to a block that accepts text OR an object. If you're using OF in the block definition, you can pass an object or text with the name of the sprite and it will work.

Last edited by cycomachead (Sept. 6, 2017 23:51:09)

bharvey
Scratcher
1000+ posts

Snap! user discussion

xly wrote:

the reference book of Computer science: “Simply Scheme-Introducing computer Science.”
:blush: No, no, the reference book of CS is of course Structure and Interpretation of Computer Programs. Matt Wright and I wrote Simply Scheme as a “prequel” to SICP. We used it in the CS course for non-majors at Berkeley until Dan Garcia talked me into building a version that would be more appealing to nontraditional CS students, and that meant having a visual language with the power of Scheme, and it turned out that Jens had written a big part of what we needed, although not yet with λ. So my real claim to fame is that I taught Jens about anonymous functions.

But anyway, BookOwl is not ignorant of computer science! He knows things that I don't know. (Not saying he knows more than I do. )

Last edited by bharvey (Sept. 7, 2017 05:37:20)


888cinicobaka888
New to Scratch
1 post

Snap! user discussion

Has other users had problems accessing their SNAP! projects?

Some of my students save their projects regularly, then one day they try to open their project and all the code is missing.

This just happened recently.

Any and all help or feedback will be greatly appreciated!!

Last edited by 888cinicobaka888 (Sept. 7, 2017 13:31:51)

quat1024
New to Scratch
21 posts

Snap! user discussion

BookOwl wrote:

IMHO, object oriented design is overrated. I prefer the ML/Haskell like approach where you create lots of small immutable data types and use functions to transform them into the result you need.
They both have their places. I don't think it's very feasible to write something like a large game in a purely functional language. Or, I guess you could, but it would likely be a pain to write and quite slow.

oop works best when you *actually* have things that should be objects. When you get into the AbstractBlahManagerFactoryFactory, yeah no, and I think that's where oop gets part of its bad rap from.

I'm learning about prototypical inheritance - sounds similar to what you can do in scratch/snap with the clone block.

Google to find someone else's posts: ae2d2bcb-e9e3-4f9c-a847-290d71bd8bfd 222ec087-6694-42cf-8c41-064e9066f004
aWFtbml0cm9jaXBoZXI=80d463228430e6da3d72d989f4a27aca 80d463228430e6da3d72d989f4a27aca : 228430e6da3d72d989f4a27aca bf97b44a7fbd33db070f6ade2b7dc549 Vm0wd2QyVkZOVWRpUm1SWFYwZG9WbFl3WkRSV1ZsbDNXa1JTVjFadGVG ellipsepostpianolizard
bharvey
Scratcher
1000+ posts

Snap! user discussion

888cinicobaka888 wrote:

Some of my students save their projects regularly, then one day they try to open their project and all the code is missing.
The only situation I know about in which this happens is if someone loads a project with a ton of media, usually sound files but sometimes just a lot of costumes, and gets beyond a browser limit on memory use. Was that the case for your student?

birdoftheday
Scratcher
500+ posts

Snap! user discussion

If you're still unsure about how stupid OOP can get, try to figure out what an AbstractSingletonProxyFactoryBean is.

Or a InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState

Last edited by birdoftheday (Sept. 7, 2017 19:03:36)


Am I the only person who likes 3.0 better than 2.0, or do the people who do just not talk about it?
comp09
Scratcher
1000+ posts

Snap! user discussion

birdoftheday wrote:

If you're still unsure about how stupid OOP can get, try to figure out what an AbstractSingletonProxyFactoryBean is.

Or a InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
That's just Enterprise Grade™ Java.

(OOP when done reasonably can be fine.)


Visit the website of Andrew Sun!


bharvey
Scratcher
1000+ posts

Snap! user discussion

birdoftheday wrote:

Or a InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Oh that's hilarious. Unparodiable, sort of like Trump.

Boy, time was, I had to argue with people who thought OOP was the Only Right Thing, and now I have to stick up for it, withBookOwl. Are things changing out in the real world, or are you guys a self-selected functional programming minority?

Dale_Mahalko
New to Scratch
68 posts

Snap! user discussion

bharvey wrote:

Dale_Mahalko wrote:

but then the next question is how to get input back from those sprites.
Oh, you use CALL instead of RUN, and put a ringed reporter in the first slot.

We have library blocks TELL (for RUN) and ASK (for CALL) that hide the OF business. But it really does make sense; OF reports a script or an expression that's tied to the other sprite, and RUN or CALL evaluates it.

I don't completely understand what you're trying to do, but does CALL/ASK solve the problem?

What I am trying to do is to move all scripting into a single main script, rather than spreading out code fragments across many sprites. This has long been a limitation in Scratch that you can't have a single central script in the stage and command sprites to do stuff from that central script.

I don't know if I'm trying to push this limited language to try to act too much like a normal language, which may not have a concept of sprites but just stamps out bitmaps onto the background with every frame update, only checks for overlapping rectangles in code, and has no concept of “touching”.

Just doing this is a problem because AFAIK there is only the one background, and I can't create a floating drawing area over the background that can then be drawn on, and discarded when I am done with it.


The Say chat bubble for player interaction is very limiting. I've been contemplating trying to write some sort of GUI framework that uses tens to hundreds of tiny tiled sprites in a cluster to create clickable auto-resizable buttons with sprite-generated text labels inside them, and I'm trying to figure out a “proper” way to do it.

Last edited by Dale_Mahalko (Sept. 7, 2017 20:54:06)

blob8108
Scratcher
1000+ posts

Snap! user discussion

bharvey wrote:

Are things changing out in the real world
Yeah fam. Immutability(TM) and Functional Programming(TM) are Hot Topics in the JavaScript/ECMAScript 2017/Node.js world Right Now.

tosh · slowly becoming a grown-up adult and very confused about it
quat1024
New to Scratch
21 posts

Snap! user discussion

birdoftheday wrote:

If you're still unsure about how stupid OOP can get,
Oi, I gotta stop you right there, that's like me making functional spaghetti and going “Lol look at how stupid Haskell is!”

Local man discovers that the worst of $genre is, in fact, pretty bad.

Spring even says it's “Enterprise”.

Last edited by quat1024 (Sept. 7, 2017 22:30:32)


Google to find someone else's posts: ae2d2bcb-e9e3-4f9c-a847-290d71bd8bfd 222ec087-6694-42cf-8c41-064e9066f004
aWFtbml0cm9jaXBoZXI=80d463228430e6da3d72d989f4a27aca 80d463228430e6da3d72d989f4a27aca : 228430e6da3d72d989f4a27aca bf97b44a7fbd33db070f6ade2b7dc549 Vm0wd2QyVkZOVWRpUm1SWFYwZG9WbFl3WkRSV1ZsbDNXa1JTVjFadGVG ellipsepostpianolizard
birdoftheday
Scratcher
500+ posts

Snap! user discussion

I said “can get”, not “is”. And I don't deny that Haskell can get stupid, in fact it probably can be more stupid, I don't know or care. But that doesn't change or lessen the stupidness of other things.

Last edited by birdoftheday (Sept. 7, 2017 22:39:15)


Am I the only person who likes 3.0 better than 2.0, or do the people who do just not talk about it?
djdolphin
Scratcher
1000+ posts

Snap! user discussion

blob8108 wrote:

bharvey wrote:

Are things changing out in the real world
Yeah fam. Immutability(TM) and Functional Programming(TM) are Hot Topics in the JavaScript/ECMAScript 2017/Node.js world Right Now.
Pretty lit fam. But now that they've caught the attention of the JS world for a whole seven seconds, it's only a matter of time before the Next Big Thing(TM) comes along and Functional Programming(TM) is stinky and untrendy again.

!
birdoftheday
Scratcher
500+ posts

Snap! user discussion

Yeah, nobody cares about functional programming anymore. It's not 2012 and my name isn't Charles Babbage. As a code artisan I have better ways to spend my time and money, like this newest full stack framework everyone's using. It's called bilge.js, and it's not bloated–the minified version is only 2GB, you know.

Am I the only person who likes 3.0 better than 2.0, or do the people who do just not talk about it?
BookOwl
Scratcher
1000+ posts

Snap! user discussion

quat1024 wrote:

BookOwl wrote:

IMHO, object oriented design is overrated. I prefer the ML/Haskell like approach where you create lots of small immutable data types and use functions to transform them into the result you need.
They both have their places. I don't think it's very feasible to write something like a large game in a purely functional language. Or, I guess you could, but it would likely be a pain to write and quite slow.

oop works best when you *actually* have things that should be objects. When you get into the AbstractBlahManagerFactoryFactory, yeah no, and I think that's where oop gets part of its bad rap from.

I'm learning about prototypical inheritance - sounds similar to what you can do in scratch/snap with the clone block.
Notice I said “preferred”. Obviously there isn't a single paradigm that will perfectly fit everything, but I think that a (non pure) functional language like OCaml (which also has objects, if you really, really need them) is a better fit for most projects.

Or you can just use Rust and let the compiler turn your beautiful functional code like
some_iterator.map(do_something).filter(|x| is_something(x) && !is_something_else(x)).take(an_amount)
into efficient imperative code.

who needs signatures
birdoftheday
Scratcher
500+ posts

Snap! user discussion

some_iterator.map(do_something).filter(|x| is_something(x) && !is_something_else(x)).take(an_amount)
beautiful all ways but syntactically

Am I the only person who likes 3.0 better than 2.0, or do the people who do just not talk about it?
BookOwl
Scratcher
1000+ posts

Snap! user discussion

@xly
I'm sorry if I come off as arrogant or anything like that, that wasn't my intent at all. Certainly if anybody can make a good version of OOP for Snap! Brian (and Jens of course) can. I was just saying that from my experience I think that OOP has been overhyped and that a good functional (not necessarily pure) language that has support for things like algabraic data types and pattern matching can be much more pleasant to use.

(Of course, my experience writing large, business grade programs is basically nil, so take what I say with a large heaping of salt)

who needs signatures
djdolphin
Scratcher
1000+ posts

Snap! user discussion

birdoftheday wrote:

Yeah, nobody cares about functional programming anymore. It's not 2012 and my name isn't Charles Babbage. As a code artisan I have better ways to spend my time and money, like this newest full stack framework everyone's using. It's called bilge.js, and it's not bloated–the minified version is only 2GB, you know.
Woah, woah, woah, get with the program. JavaScript is out, and CoffeeScript is in again for some reason, this time with type annotations, inlined HTML, and goto statements, just for the heck of it. You simply transpile it to ES5, then run it on ayo.js running on Ubuntu running on an x86 emulator running on WebAssembly. It's only 17GB gzipped, so it's very lightweight.

!
BookOwl
Scratcher
1000+ posts

Snap! user discussion

birdoftheday wrote:

some_iterator.map(do_something).filter(|x| is_something(x) && !is_something_else(x)).take(an_amount)
beautiful all ways but syntactically
What's bad about it? The lambdas? The C style operators? The method chaining?

birdoftheday wrote:

If you're still unsure about how stupid OOP can get, try to figure out what an AbstractSingletonProxyFactoryBean is.

Or a InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
That's… I can't even…

How do Java developers stay sane!?!

Edit: Or maybe they all lost it and became Javascript devs.

Last edited by BookOwl (Sept. 8, 2017 01:25:15)


who needs signatures

Powered by DjangoBB