[Research] Is Gram's syntax truly language-agnostic? (RTL, CJK, Word Order) #4
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#4
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
Because Gram is a markup language designed to be woven directly into natural language sentences, it inherently interacts with the grammar and syntax of the language being written.
Currently, Gram's syntax (
@,~,^,{},->) has been primarily tested with English and French. These languages share common traits: Left-to-Right (LTR) reading, spaces between words, and generally a Subject-Verb-Object (SVO) or imperative sentence structure.The Goal
As I expand Gram's internationalization (i18n), I need to ensure that the parser doesn't break—and that the writing experience doesn't feel unnatural—when used with languages that follow different linguistic rules.
Areas of Investigation
I am looking for feedback and testing from the community on the following potential friction points:
1. Languages without spaces (e.g., Chinese, Japanese)
In languages where words are not separated by spaces, does the parser correctly identify tokens?
Example:
加入@面粉{200 g}和@水{100 ml}. Will the parser fail because there is no space before the@or after the}?2. Right-To-Left (RTL) languages (e.g., Arabic, Hebrew)
When mixing RTL text with Left-to-Right (LTR) markup symbols like
@,{}, or->, the bidirectional (BiDi) algorithm of text editors can sometimes break.Do the curly braces appear inverted in the VS Code extension or the Playground? Does the text cursor behave unpredictably?
3. Word Order & The
[Action]tagEnglish recipes usually start with the verb:
[Mix] the @flour and @water.In Subject-Object-Verb (SOV) languages (like Japanese or Turkish), the verb comes at the end.
Does placing the
[Action]tag at the beginning of a line feel unnatural? Does the Gram parser force you to put it there, or is it fluid enough to be placed at the end?4. Complex Pluralization
Currently, Gram's unit dictionaries handle singular/plural pairs (e.g.,
cup/cups). Some languages (like Russian or Arabic) have complex pluralization rules depending on the exact number (dual, paucal, etc.).Will the current i18n implementation scale to these rules when rendering recipes?
How to help
If you speak a non-European language or a language with different syntactical rules:
Note: This is a long-term background topic. The goal right now is simply to gather data to determine if supporting these linguistic edge cases is genuinely necessary for everyday use, and if it's technically feasible without overcomplicating the core parser.
I'd love to hear your thoughts on this topic and eventually see your test cases.