Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/assets/Images/Interactive-tower-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/Images/Palette-drag&drop.mp4
Binary file not shown.
Binary file added public/assets/Images/brick-connection-uml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/Images/brick-disconnection.mp4
Binary file not shown.
Binary file added public/assets/Images/collision-detection.mp4
Binary file not shown.
Binary file added public/assets/Images/compound-brick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/Images/compound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/Images/expression-brick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/Images/expression.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/Images/simple-brick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/Images/simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: "DMP’25 Week 11–12 Update by Justin Charles"
excerpt: "Parsing the tree: building the AST pipeline to connect Masonry’s brick towers with the Program execution layer"
category: "DEVELOPER NEWS"
date: "2025-09-31"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this dated in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i might have messed up that part before with the month ... fixed it

slug: "2025-09-31-dmp-25-justin212407-week11-12"
author: "@/constants/MarkdownFiles/authors/justin-charles.md"
tags: "dmp25,sugarlabs,week11,week12,ast,justin212407"
image: "assets/Images/c4gt_DMP.webp"
---

<!-- markdownlint-disable -->

# Week 11–12 Progress Report by Justin Charles

**Project:** Music Blocks 4 Masonry
**Mentors:** [Anindya Kundu](https://github.com/meganindya/), [Sumit Srivastava](https://github.com/sum2it)
**Assisting Mentors:** [Devin Ulibari](https://github.com/pikurasa/), [Walter Bender](https://github.com/walterbender)
**Reporting Period:** 2025-09-18 – 2025-09-31
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the period ending in the future and longer than a week?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this blog addressed work done for the last two weeks together


---

## Parsing the Tree: Connecting Masonry and the Program

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend adding a few sentences adding some context, not just bullets.

Tell us what this is about and why it's important.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done .... ptal

### B1. Hardcoded Tower for Bootstrapping
- Built large sample towers (30–40 bricks) directly in the workspace.
- Covered **sequences, compounds (loops/conditionals with sockets), expressions, and mixed music/movement/system bricks** to stress-test the parser.

### B2. BrickTree with Stable IDs
- Every brick receives a unique, stable `BrickId` generated once.
- Types and props aligned with the shared registry, ensuring IDs in Masonry match AST node IDs in the Program.

### B3. Shared Registry / Config
- Created a **single source of truth** for all brick types.
- Defined form (simple/compound/expression), AST kind, sockets, and prop mappings.
- Guaranteed Masonry ↔ Program semantics don’t drift.

---

## Challenges & Solutions

- **Challenge:** Keeping IDs consistent between Masonry and Program
**Solution:** Stable ID generation and registry enforcement ensured 1:1 mapping

- **Challenge:** Handling nested compounds and socketed children
**Solution:** Recursive parsing with explicit socket assignments

---

## Key Learnings

- Stable IDs are the backbone of reliable AST ↔ Program integration
- A shared registry prevents semantic drift between UI and execution
- Validating early gives far better developer/user feedback

---

## Next Steps

- Validate the tree before running.
- Translate tree to AST deterministically
- Register the plug ins needed by the towers

---

## Resources

- [musicblocks-v4 Repository](https://github.com/sugarlabs/musicblocks-v4)
- [Documentation for AST compilation](https://docs.google.com/document/d/1C0t4iSze2eDEv6lWbloK3MnvJgAa6HvmXmk2sQ0lCZs/edit?tab=t.r7v91obun4vn#heading=h.gywsry3tia37)

---

## Acknowledgments

Thanks to my mentors for their guidance through this milestone: bridging Masonry’s visual towers with actual program execution.
306 changes: 306 additions & 0 deletions src/constants/MarkdownFiles/posts/dmp-25-justin212407-final-report.md

Large diffs are not rendered by default.