Live data from Hacker News

Show HN: Bato – A Filipino Programming Language

github.com

71–80 of 127 posts

Re: Show HN: Bato – A Filipino Programming Language

#71
post #32
post #25

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... 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 're…

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…

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

Re: Show HN: Bato – A Filipino Programming Language

#72

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] - w…

> 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/

Re: Show HN: Bato – A Filipino Programming Language

#73
post #21
post #13

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.

At least here in Brazil it's relatively common to mix English defaults and Portuguese variable names. So a Django class declaration would look something like: class Pessoa(models.Model): idade = models.IntegerField() nome = models.CharField() Then some things wind up having mixed-language variable names: class PessoaForm(forms.ModelForm):

Portuguese is rooted in Latin so it uses the Latin alphabet, the parent was concerned about other alphabets.

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.

Re: Show HN: Bato – A Filipino Programming Language

#74
post #40
post #13

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.

It's not a matter of alphabet because people still learn programming languages from English books. Pretty much nails it: https://temochka.com/blog/posts/2017/06/28/the-language-of-p...

Thanks for the link

Re: Show HN: Bato – A Filipino Programming Language

#75
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.

Re: Show HN: Bato – A Filipino Programming Language

#76

Earlier quoted context omitted.

Single chinese characters are inputted with more than one key press on the keyboard, so it won't be much different. 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.

Pinyin input for Chinese is similarly phonetic. Supposedly there is a method popular in Taiwan based on strokes. 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.

This is also a stroke system (Wubi) that's more popular and faster in China too. Maybe it's a related system to the one in Taiwan. Pinyin makes sense only if you're already familiar with the Latin alphabet and how they sound. Those are literally foreign concepts to the Chinese.

Re: Show HN: Bato – A Filipino Programming Language

#77
post #75

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 d…

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

Re: Show HN: Bato – A Filipino Programming Language

#78
post #13

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.

قلب is a Scheme-like programming language that is written entirely in Arabic.

http://nas.sr/%D9%82%D9%84%D8%A8/

https://github.com/nasser/---

Re: Show HN: Bato – A Filipino Programming Language

#79
post #13

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.

I looked for some Chinese developer on GitHub. This is the most Chinese source file I found https://github.com/hzxie/city-picker/blob/master/city-picker...

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.

Re: Show HN: Bato – A Filipino Programming Language

#80
post #75

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 d…

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

It's not pronounced wee-men. It's a shorter sound than that, but I guess I'm proving your point!
Post reply on HN