
Show HN: Bato – A Filipino Programming Language - jjuliano
https://github.com/jjuliano/bato
======
andreasklinger
Awesome stuff - i think this kind of languages are more important than most
people (esp with strong english school background assume). I could see this as
educational language for kids.

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_...](https://en.wikipedia.org/wiki/Non-English-
based_programming_languages)

[1]:
[https://en.wikipedia.org/wiki/Plankalk%C3%BCl](https://en.wikipedia.org/wiki/Plankalk%C3%BCl)

[2]: [https://esolangs.org/wiki/German](https://esolangs.org/wiki/German)

~~~
badsectoracula
> I could see this as educational language for kids.

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).

[1] [http://alkisg.mysch.gr/screenshots/](http://alkisg.mysch.gr/screenshots/)

~~~
fiddlerwoaroof
It strikes me that in a language like Common Lisp, where the identifiers are
not strings but symbols with a name, you could give the symbols a map from
language->name and have the input language be nearly irrelevant: as long as it
was standard practice to distribute source as serialized symbols rather than
as text files.

~~~
fiddlerwoaroof
Or, maybe, you could add another segment analogous to the package segment to
each read symbol, e.g.:

    
    
        (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:show

------
rb808
One thing I'm completely ignorant of is how to people from countries where
non-latin alphabets are write code? Eg if you're Chinese, Arabic even Russian
do you have to do everything in English and English characters?

I'd hope there is a Unicode mapping into other characters - is there any
language that supports this? Even for libraries would be nice.

~~~
drdaeman
Russian reporting in. I think everyone here who writes code knows Latin
alphabet. It's just a basic requirement - it's a given that if you want to
code you'd better learn English, let alone alphabet.

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.

~~~
vidarh
> 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.

~~~
drdaeman
> old patched Joomla

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. ;)

------
beevai142
Another natural language programming language (in Finnish):
[https://github.com/fergusq/tampio](https://github.com/fergusq/tampio)

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.

~~~
jpatokal
Finn here: it reads like language that's tediously formal to the point of
being awkward, kind of like an old translation of the Bible ("And verily X did
beget Y").

"Natural" spoken Finnish abbreviates a lot and dispenses with many
conjugations. Maybe I should fork this and build a Helsinki slang version...

------
zitterbewegung
I've had ideas of where we abstract the syntax of a program language in a way
that there would be multiple 'views' of the code.

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.

~~~
BalinKing
I read about isomorf yesterday... it might be kinda like what you're looking
for?

Possibly relevant blog post from Brian McKenna, too:
[https://brianmckenna.org/blog/polymorphic_programming](https://brianmckenna.org/blog/polymorphic_programming)

[1] [https://isomorf.io/](https://isomorf.io/)

~~~
aaron_kent
This sort of translation is definitely part of our syntactic sugar mission. If
anyone wants to beta test particular languages for us just reach out.

------
dguo
A few months ago, I was daydreaming about creating a new programming language
and started thinking about language internationalization. I found this page,
with some interesting comments:
[https://blogs.msdn.microsoft.com/alfredth/2011/07/21/why-
are...](https://blogs.msdn.microsoft.com/alfredth/2011/07/21/why-are-all-
programming-languages-in-english/)

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.

~~~
yoz-y
It is always good to not have possible ambiguity in a language though.

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.

~~~
amyjess
> 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)](https://en.wikipedia.org/wiki/Stropping_\(syntax\))

[1] Example from an HTML-ized copy of the spec:
[http://www.masswerk.at/algol60/report.htm](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;

~~~
yoz-y
It feels good that somebody thought about the trouble that spaces in
identifiers can bring.

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.

------
tjwii
There are already way too many languages on this planet being kept alive by
all those pathetic governments limiting their citizens to their own (little)
country. English should already long be the World's 1st language for every
human being IMAO. I'm Dutch and it took me ages of struggling to get to my
current level of English and I'm still learning..

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.

~~~
FredrikMeyer
I agree that the would already should have had a lingua franca, but I must say
that it English is far from the best candidate. The language is huge, and the
grammar is full of irregularities. Pronunciation must be learnt case by case
(why are "women" pronounced "wee-men"?).

(also recall this cute poem:
[http://www.ling.upenn.edu/~beatrice/humor/english-
lesson.htm...](http://www.ling.upenn.edu/~beatrice/humor/english-lesson.html)
)

~~~
munificent
This is a common complaint, and one the purist in me is sympathetic to. These
days, I have a more nuanced perspective on English.

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.

~~~
taserian
One of my favorite quotes from James Nicoll:

"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."

------
undershirt
Clojure seems to be very conducive to this by importing a library of words in
another language:

[https://github.com/echeran/clj-
thamil/blob/master/src/clj_th...](https://github.com/echeran/clj-
thamil/blob/master/src/clj_thamil/%E0%AE%AE%E0%AF%8A%E0%AE%B4%E0%AE%BF%E0%AE%AF%E0%AE%BF%E0%AE%AF%E0%AE%B2%E0%AF%8D.cljc)

Elango Cheran gave a talk about this:
[https://www.youtube.com/watch?v=MqjMZNwnYCY](https://www.youtube.com/watch?v=MqjMZNwnYCY)

------
fny
TIL That Ruby lets you modify keyword parsing at runtime:
[https://github.com/jjuliano/bato/blob/master/lib/bato/ruby_p...](https://github.com/jjuliano/bato/blob/master/lib/bato/ruby_parser_patches.rb)

------
amrnt
This reminds me of
[http://nas.sr/%D9%82%D9%84%D8%A8/](http://nas.sr/%D9%82%D9%84%D8%A8/) (Lisp
in Arabic(?))

~~~
Cyph0n
Yes, that's Arabic, and it does indeed look like an Arabic Lisp!

------
petepete
Is it just Ruby with Filipino words?

~~~
perfmode
A language with Internationalized keywords would be pretty dope.

~~~
nuclearcookie
That's what they do with formulas in Excel. There it sucks HARD. Try googling
for documentation on StackOverflow for example. Anything you want to copy
paste doesn't work because Excel is expecting the commands in a different
language.

~~~
dx034
If you google in your native language you'll get results in that language. I
agree that it takes a bit to relearn all formulas (and I find it too confusing
to use different versions at the same time) but when I was still using a non-
English version I had no problems finding solutions.

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).

~~~
nuclearcookie
I agree it's a good move from Microsoft to make Excel more accessible. It's
just not something I was expecting the first time I stumbled upon the problem.

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!

------
AngeloAnolin
The effort into this I must say (I speak as someone who came from the
Philippines and knows the language by heart) is quite impressive.

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.

------
michaelterryio
Meanwhile, duolingo still doesn't support Taglog, much to my annoyance–since
my wife is half-Filipino but doesn't know it–and we thought it'd be a fun
challenge to learn it together.

------
handojin
Alternatively, you could skip the hegemony debate and just abandon natural
languages altogether...

[http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pd...](http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pdf)

------
IncRnd
At first I thought this was kidney, then upon reading github it hit me that
stone is the meaning ala Ruby.

Thanks for sharing.

------
pwaai
It's really interesting to see non-English languages being used as programming
languages.

I recall Aheui (아희) programming language that was posted on HN a while back.
It's truly exotic.

[https://aheui.github.io/specification.en](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ㄱ

~~~
half-kh-hacker
I feel like using 니은 and 기윽 for your quotations limits you in terms of
keywords quite a bit. AFAIK, in Korean, they use <텍스트> for their quotations.

~~~
pwaai
ㅋㅋㅋ perhaps in the capitalist counterparts. I'm envisioning a new Korean
alphabet only programming language, staying true to the Juche philosophy of
self-reliance!

I would replace all operators with Korean characters:

* is ㅆ

|| is ㅣㅣ

&& is ㅃ

\+ is ㅏ

= is ㄹ

\- is ㅡ

== is ㅌ

> is ㅋ

< is ㄷ

------
WindowsFon4life
Guess "boto" was already taken.

