Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Spanish Basic (vainilla.app)
44 points by sandes on May 29, 2022 | hide | past | favorite | 46 comments



Hey there. I agree with some of the comments out there - a new language in Spanish does not make much sense in the pragmatic way: understanding English is a requirement for every coder out there.

However, most of the technical projects out there do not have to be usable by everyone or have an interesting goal. So kudos for creating a language from zero (I saw the code on Github and I am sure you learnt a lot doing this). Some people may think this is just "translating back to English and running Python", but you are the doing the whole parsing, so I think it is awesome.

Try to avoid the negativity that you may find in HN and be happy with this!

Abrazo che!


"understanding English is a requirement for every coder out there."

As a learning language, which it is, there is no need or requirement to already know English well enough to program for the masses. Teach this in a Spanish grade school, and there'd be a whole lot of benefit to the students. Why should they wait until they're proficient in English before they can even start to learn coding?


I want to make crystal clear that my comments are 100% in a pragmatic way, as a project it is awesome and very enriching. Kudos to the OP.


This reminds me of Latino [1] and Si [2].

Time to add Vainilla to the list [3].

[1] https://www.lenguajelatino.org/

[2] https://akercheval.github.io/si/

[3] https://www.wikipedia.org/wiki/Non-English-based_programming...


> [2] https://akercheval.github.io/si/

Suggestion: the replacement for the new keyword should be crear, not nueva. This makes more sense as a verb (even when translated back to English!) and side-steps the gender issues.


Thank you, I did not know lenguajelatino


I like it! I'm reminded of Apple's attempts at localizing AppleScript.

In addition to the standard English-like AppleScript syntax, Apple also developed [1] localized dialects including French and Japanese, as well as a "professional" query language syntax:

    English: the first character of every word whose style is bold
    Japanese: スタイル=ボ-ルドであるすべての単語の最初の文字
    French: le premier caractère de tous le mots dont style est gras
    Professional: { words | style == bold }.character[1]
(Any transcription errors are mine.)

The dialects apparently shared a common internal representation so you could write a script in one language and then view/edit it in another (of course comments would still be in the original language.)

From an interesting retrospective by one of its designers:

[1] AppleScript, HOPL '07 https://dl.acm.org/doi/abs/10.1145/1238844.1238845


Office 95 (and maybe 97?) had localized versions of Visual Basic, where the keywords and VBA objects were translated into the respective local language. I’m not sure if Spanish was supported, although the following page at least lists Spanish object libraries: https://mskb.pkisolutions.com/kb/211404

In any case, you might want to install a Spanish Office 95 version in a VM for inspiration ;). Microsoft soon dropped the localized VB versions due to interoperability considerations.


Excel formulas are a perfect example of how horrible localized versions can be for coding.

I hate them, all the good guides and docs are in english but if the application is in spanish then all the function names are different. I have everything in english in my computer because of this and to avoid context switching, but when my gf asks for help I have to google every corresponding function name. Terrible design choice IMO.


Supongo eres hablante nativo, pero la sintaxis es horrible:

"Para i=1 hasta 7 hacer"

no hace ningún sentido. En todo caso sería " Para i en (1..7)" o "Desde i=1 hasta 7" o "Para i=1 mientras i < 7; i++"

In any case, all these copy-paste-just-literally-translate-the-keywords languages offer nothing new.


Or a Fortran-like one: hacer i = 1 hasta 7

The problem with for/para statements is that the each/cada that follows is being omitted. My hacer one hides prepositions as well (para or con are suitable candidates), but I’m not sure how would I tweak a for statement in Spanish without increasing verbosity.


"no hace ningún sentido" makes no sense in Spanish either :)


Meh, it is documented since many many years ago and it is grammatically correct even if it is not considered "standard Spanish", although it is part of the common usage of many native speakers (me included), many similar constructions: "hacer ascos", "hacer falta", "hacer ilusion" ,

https://twitter.com/raeinforma/status/1134042127565033473?la...


> "Para i=1 hasta 7 hacer"

It's the standard spanish pseudocode


There is no such thing, as there is no "standard English pseudocode". What usually happens is that they use terrible translators for technical books, and we end up with monstrosities like this one. Why bothering to "create" a programming language in Spanish if it is going to be a literal word by word translation from English, a language with different syntax, semantics and pragmatics?


“For i=1 to 7” doesn't make any sense in English, either; BASIC, even if inspired by English, isn't at all English, ditto with every other programming language that borrows keywords and/or library function names from English.


> horrible

Looks like Algol syntax to me.


There was a lightning talk about a Spanish Python at PyCon earlier this month: https://youtu.be/xQ0-aSmn9ZA?t=34


Before Linux and GNU got internationalization, I worked on a French product cleverly named Ligne-X (Line X) to translate all of the display text (error messages, etc). Ironically, I don't speak French. But I didn't need to, since another team did that part.

That was an exasperating workload. So kudos to you on this. It looks like you put a lot into it.

Some people are going on about English being mandatory for programming. It isn't necessary for non-English speaking people learning programming to learn both English and Programming at the same time, so I disagree with that. Professionally, sure. But this is a learning language, and it looks nice and clean.

And there are a lot of people who code for fun, just for themselves, too. They don't need to learn English just to accomplish that.

I wonder how many people realize some Lisp implementations are localized to similar effect. Set the language, and then the keywords change to something more appropriate for those languages.


I feel programming languages for interactive fiction are the only place where non-english projects have any chance of being useful.

Inform7 in spanish would be neat to have for kids, for example. It's not about programming, it's more about expressing themselves through a game.


of this is cool a language specifically to help new programmers to learn programming when their primary language is spanish?

honestly this would a be godsend for my girlfriend. Most algol programming languages are super focused on english keywords that are very intuitive for a natibe speaker but nto so much for a Spanish speaker.

case in piint. "if" in spanish is "si", but "si" is also spanish for "yes"

as you can imagine, trying to explain with teh language barrier can get difficult


Accents are important in Spanish and lot of other romance languages. You are missing one here or didn't think it was important.


Spanish for "yes" is "sí", not "si".


Pedantic is being the friendly, correcting cynic. Native Spanish speakers use si as si in texts and informal messages all the time. It's understood from context; I think.


Some native Spanish speakers make abhorrent mistakes when using their language. That doesn’t make it okay.


It's not hugely different from using i instead of I as the first-person singular pronoun in English which I wouldn't class as 'abhorrent' but rather 'very informal', which is fine so long as the actual language itself is preserved.


In the case in question, a programming language, we can assume a context-free grammar, and therefore the keyword equivalent for "if" would be "si" and the keyword for "yes" would be "sí".


Not a native Spanish speaker, but i think they mixed up sino and si no.

This is a common typo and they are etymologically the same.

I guess by collapsing multiple words into a single token they collapse the two phrases. Eg. I look again and see finsi which seems strange from a Spanish grammatical sense (just like endif is clearly not English)


It is indeed a typo, and my guess is that the author tried to avoid an ambiguity in the parser there.

In Spanish "else" would be "si no", which is literally "if not". Assuming he supports negating any boolean expression with "no", this means the only way to differentiate between "else" and "if not <expression>" is to parse ahead and check if "si no" is being followed by a boolean expression or literally anything else. Also, under these conditions, assigning a boolean at the end of a conditional, e.g. "si no foo = falso", would always result in a parsing error.


You're right about sino, most likely they collapsed it for parsing purposes.


Me encanta eso ! Estoy aprendiendo la idioma y me parece muy interesante la idea de programar en español.


I'm not able to tell you why it is that way, but idioma (as well as the similar sounding idiota, and the similarly ending bioma) is a masculine word, so it'd be "el idioma". I wish it were easier to rationalize.


They’re words with etymological roots in Greek.¹ ἰδίωμα (and similar words that originated in Greek) is a neuter noun. When it was imported into Latin, it retained its grammatical gender (for Latin nerds, it’s third-declension so the genitive is idiomatis and not idiomæ as one might naïvely expect). When it entered modern Romance languages by way of Vulgar Latin, the neuter and masculine genders collapsed into a single masculine gender and thus it became masculine.

1. This is the case with many nouns that violate the expectation that an ending in -a would be feminine. The usual chapter one vocabulary word, nauta also comes from Greek, although in that case, the original word is ναύτης which is first-declension in Greek and remains first-declension in Latin, unlike idioma/ἰδίωμα.


¡Gracias!


As far as I remember, in Algol 68 the physical representation of the program was separated from the syntax. So, in theory one should have been able to write

  hacer
    ...
  recah


In memory BBC BASIC was tokenised so for instance PRINT was stored as just the byte 0xF1, so you could write a program lister that used other language's words (I remember at least one of those existing) and it would be similarly easy to go the other way too.


In fact this was used in the 100% official localisation of BBC BASIC … into American. The US edition of BBC BASIC 3 would print "COLOR" instead of the obviously correct keyword "COLOUR".


Nice, it looks a little bit like Micromundos (they translate the logo language). Personally I would prefer a C like syntax instead of Algol.


As a spaniard, please don't.

I'm fine with programming in english, this only complicate things for everyone involved. Imagine if every popular language out there had their own adaptations or even their own programming languages.

Also, you must know english for coding. There is no way you can be a good developer without a good english knowledge - docs, specs, protocols, guides, tools, books, remote jobs with international teams... everything is in english.


Agreed. I think it's a bad idea (for the stated purpose, not as a nice little project which is always good to see of course). There's already sort of a problem in spanish texts (articles, some books) where the author chooses to make up (often cringy) translations for terms that don't really have an accepted counterpart in spanish. So they just translate the thing literally, and without consistency. Each author decides what to translate and how. This is probably an issue too in other languages.

Example: "arreglo". Why would you call an array that way?

Learning a programming language is already hard enough (especially the first one) to add another axis to the process, and you'll get much less out of the experience if you are limited to a "vainilla" universe.


Yeah, that's a good one.

The terminology is well established and standardized in english, so if someone says things like bus, heap/stack allocation, driver, or even simple random things like timeout, tracker, to trim a string, to wrap an error, etc. everyone knows what you mean but when people write their docs in spanish and make up their own terms (let alone the mental effort required to translate every term), you can quite easily end up with a huge mess.

Por favor, programad en inglés y usando los términos conocidos y si tenéis un equipo a cargo forzad a hacerlo así, os lo agradecerán en el futuro!


I remember being completely mystified the first time I heard "arreglo" at my first job.

I have a theory that the frequency of the use of those translations (arreglo, aplicativo) in a workplace is directly proportional to the amount of bureaucracy in it.


It turns out that there may be a shared etymology from Old French "arraier" (I arrange, prepare, put in order; contrast En. disarray). So, as far as choices go it's not necessarily a bad one.


Until someone comes along and translates 'heap_alloc' as 'asignacion_al_monton' or 'DatabaseDriver' as 'PilotoBaseDeDatos' (I wish I had made up the latter).


Here's a really interesting talk (in Spanish) about programming in one's (natural) language: https://www.youtube.com/watch?v=cZ2ZGNUqWXg


Thanks, interesting project but I disagree with the proposal. Actually the project is more about using your own style for coding and then transpiling that, than the language itself. And both are terrible ideas IMHO.

In fact, what's popular now is to do just the opposite: linters and formatters which force the same coding style for everyone, which is way easier to implement for all the different languages and way more reliable.

And as far as the language itself is concerned, I'd say that it is a bad idea as well because of context switching, translating what you type into other languages (which is not a trivial task for both machines and humans) and because, as I said above, you still need a good english proficiency level if you want to be a good developer, so it makes sense to prepare your students for the real world by teaching programming in english and getting used to it.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: