by gus_massa · 1w ago · 0 comments
Yep, "in" is a reserved word in Python. I expect that most programmers that speak Spanish also speak English (at some level), so English keywords would not be a surprise. The reverse is not true, and I expect unexpected collisions with Spanish keywords for English speaking programmers, or even worse for programmers that speak a third language.
For example in Racket you can add at the top a line #lang that select which of the language in the distribution you are going to use. Something like
#lang racket
(displayln (+ 1 2))
but you can use #lang rhombus
print(1 + 2)
and there are like other ~20 variants.For now, my guess is that you don't need something like this, but later if you get more users it would be nice to select which keyword are available. Something like
#lang coma/english
for only English and #lang coma/spanish
or #lang coma/castellano
for only Spanish, and #lang coma
for the mixed case. It also may help to add other languages later.PS: Is there a joke in the name about "punto y coma"?
Your Racket #lang inspired idea is really valuable, though I see two design challenges I'd love your thoughts on solving:
1. Minimal special characters: My programming language is built to use as few special characters as possible—just `|` (and `.` if you count that). Adding `#` would break that minimalist rule, so I'd need a cleaner way to declare it. 2. What should the default be? It seems most reasonable that omitting the directive simply falls back to the default mode, which brings back the exact collision issue you pointed out. Maybe the compiler should detect the conflict and show a helpful error message—for instance, if a Spanish keyword causes an error, it could explain how to fix it or switch the file to English-only mode (and vice versa).
And yes! `.Coma` is a pun on "punto y coma" (semicolon), among other things: first, the semicolon joke itself since the language avoids them; second, a play on C, C++, and C#—except instead of tacking `++` or `#` onto the end, it puts a `.` right at the start. When I came up with the name, I wanted something so silly that I'd regret it (I never did :) ) while still packing a lot of meaning behind it.