Discuss Scratch

500+ posts

Object-oriented language in Scratch

I created a simplistic object-oriented language in Scratch :)

Quick mental barf of everything you need to know:
- Everything's an object
- You can call methods on objects like so
3 + 4.
obj methodName.
obj method: x WithTwoArgs: y.
- Number/string literals:
- Nestable square bracket strings:
[this: [test] IsSomeCode: 3.14]
- Parentheses:
3 + (4 * 7)
- (there's no order of operations :) )
- Mostly case-insensitive, but capital letters distinguish between:
obj method: x anotherMethod: y.
which parses as:
(obj method: x) anotherMethod: y.
obj method: x WithTwoArgs: y.
which is a single call to the "method:WithTwoArgs:" method.
- Variable scopes are also objects

Still needs a lotta work like garbage collection and probably rewrite the type tracking system, but it's something. Once that's out of the way I can smooth out some of the details, determine the way to store newlines, implement graphical primitives, and we can have a Smalltalk-like in Scratch

Last edited by rdococ (April 15, 2023 10:44:25)

1000+ posts

Object-oriented language in Scratch


How did you make this?!

Generation 3: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.

Linux is cool

AT’s is becoming a dumpster fire

I need internet or north korea gonna blow up the world!!1!!1!1!!

1000+ posts

Object-oriented language in Scratch

This is very neat

software developer - artist - swimmer and occasional biker

I always seemed to get mad at people in 2022 posts and overuse things like :facepalm: If you are looking at one of those posts, just note I don't write like this anymore

Powered by DjangoBB