Show HN: Bato – A Filipino Programming Language
github.com
github.com
Related to this: In the 80/90s i saw a German BASIC variant floating around. Unfortunately i couldnt find it online
But… if you are into alternative-language programming languages i highly recommend you reading up on Plankalkül[1] - written by Zuse (after whom SuseLinux is named) which inspired ALGOL
Also worth knowing about is obviously GERMAN[2] a programming language much like brainfuck that is redused to only the most important German words.
Example code
SCHNITZEL BEER BEER BEER BEER BEER BEER BEER
SCHNITZEL BEER SCHNITZEL SCHNITZEL SCHNITZEL BEER SCHNITZEL BEER
SCHNITZEL BEER SCHNITZEL SCHNITZEL BEER BEER SCHNITZEL SCHNITZEL
SCHNITZEL BEER SCHNITZEL SCHNITZEL SCHNITZEL BEER BEER SCHNITZEL
More links: https://en.wikipedia.org/wiki/Non-English-based_programming_...Thanks for the German link, made my morning :)
This was pretty much the worst combination of languages, because Norwegian and Danish is similar enough that the code looked completely sane - it read as pretty much as valid Norwegian in most instances, but the keywords and function names deviated in all kinds of subtle ways.
While I understand why some would like to code in their native language, the big persistent problem is that it is not clear that it is a net improvement in communication - so much of our communication about code is international, and as not nearly all of our tools are context sensitive enough to understand when we are talking about code that would need to be translated in a very specific, and (programming-)language specific way, we're creating some very tough challenges.
In Greece we had (and maybe still have, but it has been almost two decades since i was there) programming lessons in high school. For the most part it was laughable (and TBH almost everyone ignored them) but what i personally found interesting was that someone went and designed a Pascal+BASIC hybrid where everything is in Greek. There wasn't any official implementation since this was supposed to be theory only (one of the laughable parts - how are you going to learn programming without actually doing it in a computer?), but some people decided to make their own implementations. I was one of them, but mine never went beyond a simple command-line interpreter which i gave to some of my classmates.
However there was a professor who went the extra mile and built an entire interactive IDE with interpreter, debugger and a full reference (the name of the language is simply "LANGUAGE" and the Greek word for that is the same as for tongue so the icon is a tongue :-P). Apparently he even got some certification from the government about it as being usable for actual learning in schools. You can see screenshots from it at [1]. It is in Greek of course, but it has a fairly simple UI (it actually looks a bit how QBasic would look if it was a Windows program around the late 90s/early 2000s :-P). The main window is an editor, at the bottom there is an "Execution" panel where you see the program output and interact with it, a watches panel for the debugger and at the right you can see a panel with all available commands, a panel with the variables (when in the debugger) that you can inspect and edit and a panel with an input file (IIRC the language doesn't have I/O support beyond some predefined files - it wasn't needed for the educational purpose after all).
There was also a Greek compiler for another Pascal-like language during the late 80s or early 90s (this was unrelated to the "LANGUAGE" i mention above which AFAIK was designed in the very late 90s). It was made for DOS and it came with an IDE that looked a lot like a Turbo Pascal 5.x (but in monochrome UI). This one generated actual standalone executables. I found it on a coverdisk much later but i don't know what happened to that and i can't find it today (thanks to the "LANGUAGE" having such a generic name all searches in Google give me that instead of what i want :-P).
(defpackage :foo
(:use :cl)
(:source-language :en))
(in-package :foo)
(defun show (:translations :de schau) ()
...)
EDIT (forgot): and then, if you needed to access the symbol directly by some particular language's representation, do something like foo:en:showIt contributed a lot in getting the students and the teachers in the lab to get some hands on experience with programming.
It also spawned the creation of other applications that embedded it and provided classroom management and automatic correction.
Although I am not a teacher anymore I keep it online and a lot of people still use it regularly. Even if you don't know english you can start programming in your native language at a young age.
Never got support from everyone though but it was fun and challenging to make it.
Everything from the editing component until the interpreter and the execution environment had to be made from scratch.
The code is in github https://github.com/sstergou/pseudoglossa.gr
I was under the impression that SuSE (now SUSE) stood for "Software und System Entwicklung" (Software and System Development, translated from German), are we referring to the same Linux distribution?
i always assumed it to be named as a nod to zuse the famous german computer pioneer.
but you might be right - might just be coincidence
I'd hope there is a Unicode mapping into other characters - is there any language that supports this? Even for libraries would be nice.
class Pessoa(models.Model):
idade = models.IntegerField()
nome = models.CharField()
Then some things wind up having mixed-language variable names: class PessoaForm(forms.ModelForm):Off course there are the accented characters but those are just transliterated to ASCII. Even when the language accepts unicode identifiers (like Python or Javascript) they are not transliterated to ASCII so "função" is not the same as "funcao". Everybody just sticks with ASCII for identifiers (occasionally people throw the Greek letter for pi or lambda in a formula but not on my watch).
The only thing more awful than these "Portunglish" codebases are Brazilian projects trying to stick with English names only. These are often full of misleading translations - for example using "Budget" instead of "Quote" because in Brazilian Portuguese the word "Orçamento" means both. Very confusing.
Does anyone know how governments in China, Japan or Korea handle this? Do they try to use non-english programming languages?
You can test this by changing your input method to Japanese or Chinese. At least in Japanese, the sound of the character is typed out using english letters (romanji) and various options are presented for autocompletion.
You are right that reading characters is probably faster, though.
Reading characters is a bit faster, but only because you had to memorize 10,000 of them already. People reading English will similarly chunk many of the words they are familiar with so that they are not so much read as they are recognized.
Technically speaking, Japanese have kana-based keyboard layout, where a single mora is a single keypress rather than two. However, there is still an extra (second) keystroke for dakuten/handakuten (か -> が), which is not required with romaji input (where it's just "ka" vs "ga"), so it's not a 100% speed increase. So, typing is somewhat more efficient than with romaji, but I think I've heard no one uses that, except for, possibly, professional typists.
In any case, even though mostly everyone prefers the IME on their computers, I haven’t seen any Japanese people who prefer romaji input on their smartphones.
Though, I wonder if the varying size of English words makes it easier to distinguish patterns just from the shape of the code.
https://docs.perl6.org/language/quoting
"Quoting" is all defined inside of a sub-language called "Q"
%<x>
%"x"
%{x}
%!x!
Unfortunately the rules are loose enough that even space is a valid quote character. So this too is equivalent to the above:
% x
("% x ")
A question mark followed by any other single character is treated as a string literal containing that character.
Perl 6's string quoting sub language has various feature flags that you can turn on or off.
Here are a few of the basic ones shown in valid code (comments and newlines included)
# start quoting with no features enabled
# (not even backslashing the delimiter is enabled)
Q
:scalar # enable $foo
:array # enable @foo[]
:hash # enable %foo{}
:closure # enable { 12/3 }
:function # enable &foo('bar')
:single # turns on backslashing the delimiter
:backslash # enable \n
:!exec # turn off executing it (redundant)
:exec(0) # another syntax for turning off a feature
{…} # various delimiters are allowed (generally punctuation)
There are shorter variants of each of the feature flags. :c => :closureI would like to point out that the parsing of the :closure and :function part of the sub language is reentrant. (Actually most of them add some form of reentrancy, it is just harder to show it for the others)
"a b &foo( "c d &bar( "baz" )" )"
Note that this reuses the base Perl 6 parser, and that is why it is reentrant.There are shortcuts for regularly used forms
「」 =:= Q[]
'' =:= q[] =:= Q:q[] =:= Q:single[]
"" =:= qq[] =:= Q:qq[] =:= Q:double[]
=:= Q:b:s:a:h:c:f[]
=:= Q:backslash:scalar:array:hash:closure:function[]
The ability to turn off features can be useful qq :!c [a {\n b\n} c] # { and } don't form a closure here
I would like to point out that the :foo syntax is used everywhere in the language for named parameters to routines and operators (most operators are implemented as subroutines) :foo =:= :foo( True ) =:= foo => True
:!bar =:= :bar( False ) =:= bar => False
:$baz =:= :baz( $baz ) =:= baz => $baz
If the delimiters are paired () <> {} 「」 «» “” ‘’ you can double up on them. q<FOO> =:= q<<FOO>> =:= q<<<<<FOO>>>>>
This is useful to avoid having to backslash a delimiter within the string, or trying to find a delimiter that isn't in the string. q<< <a> >> =:= q' <a> 'On osx, capslock is used to quickly switch between languages.
The default way to switch is control + space.
Pretty much nails it: https://temochka.com/blog/posts/2017/06/28/the-language-of-p...
In schools, kids learn to code using Algol-like language with identifiers in Cyrillic (essentially, Russian) abbreviations, e.g. "нц для i от 1 до n" rather than "for i := 1 until n do", but even here you see Latin letter "i" ;) However, it's not uncommon to just go with e.g. BASIC or Pascal.
There is also de-facto standard accounting & ERP software producs from 1C which use Visual Basic-like language with Russian identifiers like "Константа" for "Const", etc. It's widespread in its domain, but not used anywhere else. 1C programmers are sometimes (half-jokingly) considered to be of a different caste. Sort of like COBOL programmers, maybe, or - probably closer - SAP developers.
I don't think anyone has any serious issues with basic English language for identifiers. Literature, documentation, discussion - here, language barriers do matter (a lot!), but not for programming languages themselves. That is, unless someone wants to show off as a true hardcore Russophile, of course.
Code comments, identifier names and e.g. log messages are different matter. I don't think there is any common practice for this - more like a matter of personal preferences. Some try to stick with English, some use Russian or transliterated Russian (mixing it with some English) liberally so it's not uncommon to see something like `log.Error("Дом не найден %s, %s: %s", ulica, nomerDoma, responseText) /* TODO: Добавить поиск лучшего совпадения */` in their code.
This gives me nightmares of dealing with an old patched Joomla install, where the developers had managed to bring in plugins etc. that used multiple inconsistent encodings in comments, so you could get all of the code to render correctly with any single terminal setting.
Been there, saw that. The quoted part alone is way more than enough to give nightmares. I bet, encoding issues is just the icing on the cake. ;)
The number of keywords in a modern programming language is not very large, and most are short, so even a beginner with no prior knowledge of English would not have very hard time using something like Python (or Java, or Pascal, or whatever they use at their school).
There was (is still?) a project to translate all the German comments in Open/Libre Office into English, a legacy of the German company that originally wrote it.
Personally I prefer it when they use English obviously (I don't speak German), but it also means you don't get ridiculously long identifiers.
e.g.
// 教科リストを取得する。
String[] kyoukaList = getKyoukaList();
(Japanese university backend systems have two concepts of "a subject", with kyouka being a subject like math is a subject and kamoku being a subject like Algebra II is a subject.)
Back in 2000s, text editors often did not default to UTF-8, so if you are from Taiwan for example, your file might be in big5 encoding, and would require a change if open by an editor in utf-8. Now this is a rare practice.
I am lead to believe this usage of English for code and Chinese for comments is quite common given the code I've read from public repositories and other companies we worked with.
Variables in English, strings in Chinese when they have to (it manages a list of city names). I could work on that code and I don't know Chinese.
This is more or less what I see in code here in Italy. Sometimes somebody slips a variable name in Italian but among pro developers it's limited at cases when there is really no obvious English counterpart. Example: legal terms, they tend to be very specific and you'd need a lawyer to translate them correctly. Accounting too.
Other languages, like Russian or Japanese, can be transliterated pretty unequivocally, so transliterated identifiers are often found in source code, especially in business-related identifiers where a precise translation may not even exist.
It's technically somewhat amusing as it runs a morphological parser in order to deal with the Finnish word inflection system, which is then utilized as an integral part of the language grammar. As a consequence, since this allows relaxing constraints e.g. on word order, the resulting code does actually read like natural language.
"Natural" spoken Finnish abbreviates a lot and dispenses with many conjugations. Maybe I should fork this and build a Helsinki slang version...
What if you could run a program that would translate Bato programs into Ruby and vice versa? The variables would be a hard part so maybe it would hint you at a translation of it or you could add a hint yourself.
Or what if you had a language that had a javascript like syntax and a lisp like syntax. You would run a program that would translate it from one syntax for the other. You could add or subtract syntactic sugar.
Possibly relevant blog post from Brian McKenna, too: https://brianmckenna.org/blog/polymorphic_programming
Some toughts about that by Steve: http://futureofcoding.org/journal.html#niko-autios-microedit...
As an aside, this one stuck out to me: "One of the difficulties in allowing the keyword to be switched on the fly to a different language is that keywords have to be 'reserved' such that they cannot be used as identifiers"...
I find the concept of reserved keywords kind of strange. It seems like a "smarter" language/parser should be able to handle a keyword being used as an identifier.
A classic example is a C++ line such as:
a ** b
Before you know if a and b are variable names or type names, you do not know whether this line is a variable declaration or a multiplication or a syntax error.My point is that some keywords could be used as identifiers in some situations, but this might not always be the case.
One option would be to not have any keywords, just operators. Or maybe a special keyword decoration.
What you're asking for is called stropping [0], and it's actually a very old concept going back to the early days of Algol.
Algol didn't have any concept of reserved words. Instead, keywords were typographically distinguished from identifiers. In publications, keywords were typically rendered in bold and/or underline, and identifiers were not. Representing this in a computer encoding proved problematic, so people came up with a number of ways to distinguish keywords from identifiers. The most common way was to enclose keywords in 'apostrophes', and from there 'strop' originated as an abbreviation for 'apostrophe', giving rise to the term 'stropping'.
But despite the etymology, stropping doesn't have to use apostrophes. When Algol 68 came out, the spec defined three acceptable styles, called 'stropping regimes'. 'Quote' stropping was the traditional form using 'apostrophes', .point stropping would prefix .keywords with a .decimal .point, UPPER stropping would render keywords in ALL CAPS (which forces identifiers to be all-lowercase, but that's ok because Algol 68 offers something much better than CamelCase). There was actually a fourth stropping regime, res stropping, which is different because it would treat keywords as reserved words and thus restrict how you can use identifiers.
a68g, the only modern-day Algol 68 interpreter I know of, can be configured to use either UPPER or res stropping. UPPER stropping is preferred, as res stropping changes the way the language works (for the worse, IMO).
The really cool thing about stropping is that it enables you to put spaces in your identifiers, since something other than whitespace is used to separate your identifier names from keywords [2] [3].
[0] https://en.wikipedia.org/wiki/Stropping_(syntax)
[1] Example from an HTML-ized copy of the spec: http://www.masswerk.at/algol60/report.htm
[2] Here's an example from Algol 68 of a function called days in month (yes, with spaces), taken from Wikipedia. I've rendered the keywords using UPPER stropping for the benefit of anyone wanting to try it in a68g:
PROC days in month = (INT year, month)INT:
CASE month IN
31,
IF year MOD 4 EQ 0 AND year MOD 100 NE 0 OR year MOD 400 EQ 0 THEN 29 ELSE 28 FI,
31, 30, 31, 30, 31, 31, 30, 31, 30, 31
ESAC;
[3] Another Wikipedia example of a variable delcaration, showing how stropping enables both spaces in identifiers and identifiers that share words with keywords: INT a real int = 3;I am currently using the robot framework language which combines the worst of all worlds. It supports spaces in identifiers, but it does so by using “more than one white space” as a separator for everything. No parentheses, no commas, and of course identifiers are case insensitive.
I think that this is a recepie for confusion and misunderstanding, both for humans and for developer tools. I do not understand how can it be "cool" ?
Both inherited the restricted list from C so for legacy reasons they prohibit those keywords from being used as identifiers, but newly introduced keywords are always contextual due to compatibility concerns.
1. You could create a programming language where every keyword is a symbol: http://ccsenet.org/journal/index.php/cis/article/view/23904. This is what mathematics does.
2. You could also create a programming language where every reserved keyword is a special type and then expose that type to the programmer. Thereby allowing them to reuse that word just with a different type then the reserved keyword. This would come with a lot of complexity costs however because now you don't know if your generated AST is valid until the typechecker.
IF IF = THEN; THEN ELSE = IF; ELSE ELSE = THEN;
So, this feels like a huge step back and a great way for Filipino developers and companies to completely limit and restrict their selves.
It's a fun coding experiment, but my negative response is because you shouldn't want something like this to become popular.
(also recall this cute poem: http://www.ling.upenn.edu/~beatrice/humor/english-lesson.htm... )
Yes, English is huge and complex. However, the things we are trying to express are themselves huge and complex. A big language gives us many many colors to paint with. I mean different things when I say I am "sad", "down", "blue", "disconsolate", or "woebegone". There is a learning burden on English speakers to loading such a large language in their heads, of course. But, in return, we get a higher-bandwidth communication protocol.
The complaints about pronunciation are also common and valid in many cases. Things like the Great Vowel Shift lead to words that no longer sound like they are written for little useful reason. But in some cases, pronunication varies between similar-spelled words because their etymology is wildly different.
A word's spelling carries both pronunciation and meaning. When the pronunciation varies, it is often because the underlying morphemes are different even though they are spelled the same. This means the spelling doesn't teach you to pronounce it as well as you like, but once you can pronounce it, the pronunciation helps you know what it means.
And, as a lingua franca for the world, I think English is great. English is riddled with loanwords and is constantly assimilating terms from other languages that can't already be expressed well. In many senses, it's a global language because it is the set union of them.
"The problem with defending the purity of the English language is that English is about as pure as a cribhouse whore. We don't just borrow words; on occasion, English has pursued other languages down alleyways to beat them unconscious and rifle their pockets for new vocabulary."
It's also the only candidate. English is the most commonly learned foreign language by far[1], and I don't foresee any major economic movement to change that.
English has a momentum no other language have ever had. There is no language that has a larger body of knowledge online than English. Virtually all cross-border hobbyist communities, expert platforms, etc (eg Stack Overflow) are in English. People all over the world use English to communicate, even when nobody in the group has English as their native language. I was a member of a European student network called BEST, which had 0 member universities in English-speaking places and still the entire thing was in (bad) English. The entire EU is running on English informally, and I bet formally too a few decades from now (and not because we like the Irish so much). My startup has some customers in the UAE, in India and in Pakistan - their sites main (and sometimes only) language is English. The list goes on and on.
Chinese would've had a chance if they weren't so isolationist. Call me when the first Chinese language TV show gets popular outside China and Taiwan. I bet English language TV shows will be popular in China long before then (if they aren't already - I honestly don't know).
Like it or not, English has won.
[1] There's a bunch of sources, I liked this Duolingo post: http://making.duolingo.com/which-countries-study-which-langu...
To be fair, it's also centuries of important contributions from English-speaking countries in science, technology, industry, aviation, literature, etc, etc, as well as, since WWII at least, music, TV, film and other forms of popular entertainment.
https://github.com/echeran/clj-thamil/blob/master/src/clj_th...
Elango Cheran gave a talk about this: https://www.youtube.com/watch?v=MqjMZNwnYCY
[0] https://en.m.wikipedia.org/wiki/Esoteric_programming_languag...
Many Office users only speak their native tongue, are quite happy with the translations and don't even know that StackOverflow exists.
They rather buy books, https://www.fca.pt/en/catalogue/computer-science/office/page...
I think it was exactly the right thing to do. Excel formulas are often used by people with little knowledge of programming who aren't aware that "if" is a common keyword. Using the local variant makes formulas much easier to understand (and to get people closer to actual programming).
I have a programming background so I'm used to searching everything in English, even though that's not my native language.
I inserted sqrt() in my non-English Excel and it didn't work. I thought I had a completely broken version of the program. Took a while to figure out it was a language problem!
Searchability would be tricky, since google etc. might detect the very-similar-but-for-code-snippets links as duplicate/spam and bury them, but there are hopefully ways around that--up to and including asking google to somehow improve their algorithm; it seems like they might be sympathetic (because they're programmers and because there's money to be made) to a request to accommodate such search patterns.
Not only would that solve the problem you posed (googling for stuff on SO is tricky for you as a (presumably) English speaker if it's in another language), but it would also address a far wider-reaching problem with big implications: the relative inaccessibility of programming, especially at the early-beginning stages, to people who are not fluent English speakers.
I'm sure they will...
There's also http://www.emojicode.org
Everything is just alias-ed:
e.g. https://github.com/jjuliano/bato/blob/master/lib/bato/core_e...
edit:
Bato -> stone.
Ang 'Bato Programming Language' ay isang scripting language sa wikang Filipino. -> The Bato programming language is a scripting language in the Filipino tongue (T/N: or more specifially, Tagalog).
---
More interestingly in the following section: Bakit Bato? -> Why call it Bato?
Ang 'bato' ay hango sa Ruby Programming Language na may Filipino sintaks. Ang kadahilanang ginamit ang pangalang 'bato' ay dahil ang Ruby ay isang uri ng bato. -> Bato is made with Ruby using Filipino syntax. The reason to use the word "Bato" as a name is because Ruby is a kind of stone.
But for someone who is used to coding in the English language and syntax, they may find some of the wordings harder to understand and apply.
http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pd...
Thanks for sharing.
I recall Aheui (아희) programming language that was posted on HN a while back. It's truly exotic.
https://aheui.github.io/specification.en
> 밤밣따빠밣밟따뿌 빠맣파빨받밤뚜뭏 돋밬탕빠맣붏두붇 볻뫃박발뚷투뭏붖 뫃도뫃희멓뭏뭏붘 뫃봌토범더벌뿌뚜 뽑뽀멓멓더벓뻐뚠 뽀덩벐멓뻐덕더벅
will print hello world according to the example. Reading it phonetically in Korean, makes no sense at all.
If I knew how to design programming languages I would do it like this:
> ㅍㄾㄴHello Worldㄱ
this is the equivalent of the acronym for 프린트 (ㅍㄹㅌ) or print (english word phonetically typed in Korean) and then using the "N" and "G" Korean alphabet to depict a square parentheses.
> prt(Hello World)
인쇄(印刷) would be the more formal word in which case further simplifies the acronym.
> ㅇㅅㄴHello Worldㄱ
I would replace all operators with Korean characters:
* is ㅆ
|| is ㅣㅣ
&& is ㅃ
+ is ㅏ
= is ㄹ
- is ㅡ
== is ㅌ
> is ㅋ
< is ㄷ