14 ms·
Show HN: Spanish Basic
- simlevesque 4y agoMe encanta eso ! Estoy aprendiendo la idioma y me parece muy interesante la idea de programar en español.
- phreack 4y agoI'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.
- dhosek 4y agoThey’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/ἰδίωμα.
- simlevesque 4y ago¡Gracias!
- guessmyname 4y agoThis reminds me of Latino [1] and Si [2]. Time to add Vainilla to the list [3]. [1] https://www.lenguajelatino.org/ https://www.lenguajelatino.org/ [2] https://akercheval.github.io/si/ https://akercheval.github.io/si/ [3] https://www.wikipedia.org/wiki/Non-English-based_programming_languages https://www.wikipedia.org/wiki/Non-English-based_programming...
- sandes 4y agoThank you, I did not know lenguajelatino
- asveikau 4y ago> [2] https://akercheval.github.io/si/ 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.
- deleted 4y ago[deleted]
- UmbertoNoEco 4y agoSupongo 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.
- Koshkin 4y ago> horrible Looks like Algol syntax to me.
- sandes 4y ago> "Para i=1 hasta 7 hacer" It's the standard spanish pseudocode
- UmbertoNoEco 4y agoThere 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?
- flobosg 4y agoOr 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.
- baisq 4y ago"no hace ningún sentido" makes no sense in Spanish either :)
- UmbertoNoEco 4y agoMeh, 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?lang=en https://twitter.com/raeinforma/status/1134042127565033473?la...
- Koshkin 4y agoAs 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
- dspillett 4y agoIn 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.
- waqf 4y agoIn 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".
- titaniczero 4y agoAs 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.
- deleted 4y ago[deleted]
- mgarciaisaia 4y agoHere's a really interesting talk (in Spanish) about programming in one's (natural) language: https://www.youtube.com/watch?v=cZ2ZGNUqWXg https://www.youtube.com/watch?v=cZ2ZGNUqWXg
- titaniczero 4y agoThanks, 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.
- gadrev 4y agoAgreed. 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.
- estebarb 4y agoNice, it looks a little bit like Micromundos (they translate the logo language). Personally I would prefer a C like syntax instead of Algol.
- cultofmetatron 4y agoof 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
- baisq 4y agoSpanish for "yes" is "sí", not "si".
- formerkrogemp 4y agoPedantic 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.
- Maken 4y agoIn 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í".
- bsnal 4y agoSome native Spanish speakers make abhorrent mistakes when using their language. That doesn’t make it okay.
- bigDinosaur 4y agoIt'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.
- 4y ago
- 101008 4y agoHey 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!
- deleted 4y ago[deleted]
- titaniczero 4y agoI 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.
- ksaj 4y ago"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?
- layer8 4y agoOffice 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 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.
- titaniczero 4y agoExcel 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.
- asveikau 4y agoNot 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)
- gadrev 4y agoYou're right about sino, most likely they collapsed it for parsing purposes.
- Maken 4y agoIt 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.
- dreamyfigment 4y agoI 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.
- musicale 4y agoI 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 https://dl.acm.org/doi/abs/10.1145/1238844.1238845
- underyx 4y agoThere was a lightning talk about a Spanish Python at PyCon earlier this month: https://youtu.be/xQ0-aSmn9ZA?t=34 https://youtu.be/xQ0-aSmn9ZA?t=34
- ksaj 4y agoBefore 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.