I'm intrigued by the idea of multiple syntaxes tha...
# thinking-together
p
I'm intrigued by the idea of multiple syntaxes that can map to the same AST, such as used in Forest: https://github.com/forest-lang/forest-compiler#FAQ I'm curious if anyone has seen something like this where the syntax structure remains the same, but keywords are translated to different natural languages. As in Forest, a layer between the code repo and editor would parse the code in its original language and translate the AST into the user's language, and do the reverse on the commit to the repo. One would have to take a bit of care to ensure that there are not namespace collisions between keywords and other names, but otherwise it seems possible to do. I'm also curious if anyone has taught an English programming language to non-English students, and how much the language mismatch was a burden?
m
you should check talks from Felienne, who does research in that area: http://www.felienne.com/public-appearances
1
almost all my friends learned programming languages with english as a second language, I know many professional programmers that don't speak even a basic level of english
they just learn the keywords to the meaning of what they do and code in spanish
👍 2
w
Keyword meaning doesn't generally match up well with English meaning either.
👍 2
n
I really like this idea as well. It's especially striking how such small differences can be so dividing: "Beyond languages, the arguments go on. Tabs vs spaces? Whitespace sensitive or curly braces? Semicolons or not?"
👍 1
Isomorf has a similar approach of multiple syntaxes, see: https://isomorf.io/#!/syntax-picker/tours-overview
j
@Paul Butler Two notable systems with multiple syntaxes for the same AST are Intelligent Software (where some “syntaxes” can actually be things like circuit diagrams) and Spiral (a system for superoptimizing numerical algorithms; I believe LaTeX math is one of the syntaxes)
e
In one of my earlier designs for Beads, i offered to people to replace the keywords of the language entirely with those in the native language and alphabet. I was sure that for Amharic, Arabic, and Japanese it would be a big win, but both the Arabic and Amharic test subjects rejected it. I think it would help with 12 year old age bracket, but overwhelmingly it was a "meh" response, so i haven't bothered to do it. Most languages only have perhaps 100 words in the language itself. It is the library parameters which constitute the most number of distinct words to learn, in my case it is about 1000 words total requiring translation. People have to learn so much english for all the other parts of the toolchain. I was surprised and slightly disappointed. I do know that Japan would appreciate it, as it is quite tedious to switch between hiragana, katakana and kanji while typing and adding romaji is adding a fourth alphabet to contend with.
s
@Paul Butler
I'm curious if anyone has seen something like this where the syntax structure remains the same, but keywords are translated to different natural languages.
ALGOL 68 does exactly this—it was even standardized in multiple languages. Hard to believe it was conceived when it was.
👍 1