[Syntax] Relative quantities: Ratios based on a base ingredient unit #6
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#6
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?
Context
While baker's percentages are great, many recipes use ratios based on a specific unit of another ingredient. For instance, "1 egg per 100g of flour" (classic for pasta) or "1 garlic clove per 150g of beef".
Goal
Introduce a new syntax to express these ratios. This shouldn't be limited to discrete units; it is also necessary to support precise weight-to-weight ratios, such as "50g of egg per 100g of flour".
Extended Scope: Time Calculations
Interestingly, this syntax concept could also apply to step durations. For example: "Cook for 10 minutes per 200g slice of chicken". This opens the door to much more powerful computational expressions within the Gram language. Is there however that many cases where this could be useful and/or precise ?
Technical Challenges
The main complexity lies in designing an elegant, readable syntax that supports these advanced relational calculations without cluttering the language, and then implementing the underlying AST changes.