Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Moonshine syntax #23

Open
dethe opened this issue May 9, 2022 · 1 comment
Open

Simplify Moonshine syntax #23

dethe opened this issue May 9, 2022 · 1 comment
Assignees

Comments

@dethe
Copy link
Member

dethe commented May 9, 2022

Unify file / unit / script / library concepts. No syntax needed to start a file (which is a unit/library/script).

Allow metadata headers in the file (and probably other objects like sprite). Lines are metadata until a line without a colon is hit so you can have things like

name: Control
author: Jesse Faden
created on: Juneteenth of 2020
hue: 20
/* and then the rest of the library */

Hopefully this can simplify both Moonshine syntax and the AST (and thus JSON)

Objects within the library can be intermixed, but will be grouped together in the AST (so all blockdefs will be in one blockdefs list), so Moonshine -> AST is not perfectly round-trippable, but will be like running a beautifier over it.

If media is inlined, it will always be at the end of the file after three moon emojis.

Allow non-trigger block calls in the library, but grey them out in Tardigrade to show that they are not being called unless they're in a trigger call. Maybe you can double-click them like in Scratch.

@dethe
Copy link
Member Author

dethe commented May 17, 2022

The metadata is working well, but needs to be consistent across objects. Sounds and costumes for instance can be purely metadata (plus the complexities of caching).

Unifying unit/library/file has also made the AST much more manageable (less deeply nested). So far I think code will be easier to write and the code will be much easier to work with, with more generalities to exploit. The main risk is that the code begins to look less block-like, which is a legit concern, and one that I will ignore for now.

  • Apply metadata to all objects

Actually, now that I think about it, metadata won't work at all for things like blocknames, which have embedded typed parameters in them. Or, well, won't work the way I want it to. I'll see what makes sense and go from there. Maybe everything except actual blocks?

And hey, if I move back to implicit names (by position rather than labeled name: at least I will have explored the space more. I think metadata and forms may be a good symbiotic relationship.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant