Refactor timing calculation logic and introduce Gantt chart visualization #15
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I've talked a lot in the documentation about visualizing recipes as Gantt charts, so I think it's time to actually build one and include it in the Playground for the v1 release!
I first need to refactor how the compiler handles timing calculations. The current logic needs to be a bit more robust to accurately track the exact start and end times for both active cooking steps and passive background tasks so they can be plotted on a timeline.
Objectives:
The Gantt chart is already implemented, I worked on it this whole weekend (I just forgot to create an issue about it). However, seeing the timeline laid out visually made me realize that our current scheduling logic doesn't quite fit real-world cooking.
Right now, the system schedules everything "as soon as possible". If a step doesn't explicitly depend on something else, it gets pushed to the very beginning of the timeline. For example, if a batter needs to rest in the fridge for 24 hours, the oven preheating step gets scheduled 24 hours in advance. Obviously, that doesn't make sense in a kitchen!
This means the core logic needs a deeper rework to support "Just in Time" cooking. The goal would be to have these independent prep steps automatically align themselves right before they are actually needed (an "As Late As Possible" scheduling approach). I'm still not 100% convinced that's the right path forward though, I'm still exploring alternatives. My biggest concern is that it would complicate the syntax even further.
Either way, this is a much bigger structural change, so I'll be looking into the best way to handle it moving forward—either by updating the scheduling algorithm to calculate backwards, or by introducing explicit section-level dependencies.
gram viewlabels every timer as "min" —~{1h}displays as~1min#25