Hacker News new | ask | show | jobs
Show HN: Pakhi – Bangla Programming Language (github.com)
67 points by shafin_ 1932 days ago
18 comments

I’ve used programming languages with keywords in other languages but they don’t feel simpler to me. I am comfortable using “Fortissimo” even though I don’t speak Italian, and I view programming keywords the same way.

I would be interested in a programming language that reflected the grammar and structure of a non-English human language. Procedural languages are quite “englishy”, and while production (logic) languages aren’t, they don’t really feel like any human language I’ve used.

I think there’s an interesting line of research in looking into programming metaphors and syntax drawn from non-PIE-family languages.

I wonder if it’s possible for the programming languages to take advantage of the unique features in some languages, e.g. Agglutination in Hungarian and Turkish. Has any study being done to that effect?

I love the concept, this project has the potential to bring a whole new demography to the fold of programming.

I see programming as manipulating a bunch of semantic objects. Syntax is just the (bad) user interface to this. This shouldn't rely on a natural spoken language at all. For example instead of `case` or `if`, there could (and should) just be symbols for such common things. Languages like Java have a lot of English keywords to represent flaky, redundant concepts with bad semantics. It's also a bit cumbersome that these languages often prevent you from naming variables with these already taken words. Seems actually like every 10 years people realize they didn't need all those English sentences in their languages if you look at a lineage like COBOL -> Visual Basic -> Java -> JavaScript or whatever 2010 fad.
Since RPN is front page, let me note that Turkish can be viewed as an RPN language -- the verb comes at the end

(although agglutination etc make it not quite so clear cut)

The agglutination is very similar to properties on structs

object.time.by.ability.duration

Except that there is a fixed standard order, and every object (word) responds in the same way. -- Very similar to an inheritance hierarchy from a single object :)

A difference would be that every subclass a.k.a word has a meaningful way to respond to the dimensions of duration, ability, startPoint, byWho, and a few others that are not easily expressible in English but very convenient

Bangla also is a subject-object-verb language and I hadn’t thought of it like RPN before!
An interesting concept from Turkish is each word can directly give you all (or single) objects that do or can respond to that action

  yap -- make
  yapan -- the one who makes
  yapanlar -- all those who make
  yapılan -- then one being made
  yapılanlar -- all those being made
This would be like functions having a standard way to return lists of all objects they're related to

Or direct solving of some complex queries like 'Who can open this door?'

In Turkish that would be open_this_door_an, where '_an' is the standard way to get a list of all objects capable of doing it

  * yap: make
  * yapan: maker
  * yapanlar: makers
  * yapılan: made (I think, "then one being made" doesn't make sense to me)
  * yapılanlar: OK you got me there!  It may be another job for "made" or goods or a synonym eg: objets d'art.  Yes, I did just use three languages as my own in one sentence.
I'm not a linguist. I've managed to fail French and German and yet pass Latin (whatever the heck that is!) at O level (old UK exam at age 16.)

I don't think we have quite the same concept you are describing, in English as such but I think we might come close. You can generally take a verb and turn it into a closely related adjective, gerund and gerundive. Anyway, if there isn't a word available in English, we simply steal (sorry, borrow) someone else's - simples! I bet I routinely use a few Turkish words without even realising it. English is a proud mongrel - it was an amalgam from day 1.

(edit: I've forgotten how to do a list hereabouts - sorry, Ooh two spaces)

Nice work, and nice list. I also failed in many languages :)

  yapıcı -- maker
  yapıcılar -- makers
  yapılcı -- something with the job of being made
Yes, that last one doesn't make sense, which shows you are right, they are different concepts

  yapmayan -- the one who doesn't make
  yapmayacı -- the one whose job is not to make
  yapabilan -- the one able to make
  yapmayabilan -- the one not able to make
Interesting to correspond those to programming concepts! A DOM query for objects. The task makes me think natural language is designed more for controlling scenes in a video game or theatre, than for programming -- since concepts like duration, force and timing are so prevalent

A Turkish word I'd like to see in English would be

  Kolay gelsin
Literally may it come easy to you, meaning both bless you, and I see your hardship

No matter where you say it, it makes people smile

"Makee" and "makees" aren't in the dictionary but native speakers would probably understand what you mean
Perl's $_ is supposedly something inspired by linguistics.
Indeed. It's called "the topic".

In the Raku Programming Language it is set with various explicit commands, such as `given` (just set it) or `with` (only fire if instantiated). Method calls without an invocant, are executed on the toppic. Together with phasers, this combines into:

    LEAVE .disconnect with $dbh;
In other words: if you leave this block of code (by any means, including an exception), disconnect the database handle if it was instantiated)
We English speakers are incredibly lucky that programming languages first emerged based on our native language. It's easy to imagine scenarios where the first programming languages were based on Mandarin or Bangla or Hindi keywords.
> It's easy to imagine scenarios where the first programming languages were based on Mandarin or Bangla or Hindi keywords.

I don't know. To me that seems pretty far fetched idea.

Russian, or German, maybe? But I don't really see how the computer revolution could have started in SE Asia without fairly major changes in history

While I 100% applaud the effort - and I absolutely love the idea of languages in non-English languages - you should be aware that phonetically (and if you drop the 'h'), the name is a racist term in the UK at least.
I think it is we who decided it is a racist word. I was a guest instructor in a university class in Islamabad, and people there used that word quite casually. It surprised me how often I heard it, but also that it was never treated in a negative manner. An important differentiator is that they weren't using it as a label to call each other maliciously, but more to denote that something is from Pakistan.

Perhaps at least in this case, intent has everything to do with its interpretation. I still don't use the word because that nuance is too easily missed.

Probably both cultures (which apparently are directly related, in terms of overlapping histories) are aware of words like this, and not likely to confuse them for ill intent. A little like how Canadian Anglophone children make fun of the French word for 'seal', but Francophones who also use the English swear word that it sounds like clearly know when you're swearing, versus when you're talking about a seal.

There are plenty of terms in languages that are common words in that language but may sound like different and possibly offensive words in other languages. But that doesn't mean we should avoid using those words.
This is an ignorant statement. Pakhi means "bird" in Bengali. Check the translation.

Edit: To all the downvoters, I truly hope that ignorance is bliss for you. Maybe learn another language before you project your ressentiment tinged identity-politics idiocy onto something you don't even understand.

[1] https://translate.google.com/?sl=bn&tl=en&text=pakhi&op=tran...

You're probably being downvoted for the 1st sentence. And for the Edit.

Why is it ignorant? OP is just stating a fact. Is OP the PC police, or is he the canary trying to warn that the "cancel mob" might attack this project if they took offense at the name, I can't tell.

You saying it means "bird" is also just a fact...

I wouldn't go so far as to say it is ignorant, but just imagine if some english speaking person named their programming language or product "Bird", and one of the top comments brought up the fact that it was similar to a racial slur in their language.

I'm not saying it is wrong to point this out, but it must be slightly disheartening for the author of the language. And more importantly, Bangladesh was literally called East Pakistan, so I'm sure whoever made this is aware of the actual racial slur.

Also please note, I'm actually Bangladeshi, so I'm not speaking for a group I don't represent here.

It is ignorant because the concern stems from ignorance of the fact that many languages that are used by billions of people in the world treat the aspirated and non-aspirated versions of consonants as completely different consonants.
Well said. If I can add a final point, it's that it is nonsensical and inappropriate to judge how a word sounds in one language based on how it sounds in one which is only very distantly related (PIE at best).
One more casualty of the absence of retroflex consonants in English. Before you jumped the gun, you should’ve taken into account the difference between ‘Ka’ and ‘kha’ consonants.
Erm, I think you are confusing retroflex consonants with aspirated consonants. "Kha" is just the aspirated version of "Ka". English doesn't have two different alphabets for these two different sounds and which one is used depends on the context (king vs sink). Indic languages on the other hand treat these as completely different sounds and there are many pairs of words which differ only in the non-aspiration/aspiration of one particular alphabet.

Interestingly, even though the IPA has the aspiration modifier letter, the transcriptions that you find in dictionaries seldom care to use them. For instance, the Cambridge dictionary lists the pronunciation of the word king as /kɪŋ/ but almost everyone actually says /kʰɪn/.

https://dictionary.cambridge.org/dictionary/english/king

It doesn’t sound the same spoken. Pakhi (bird) is pronounced like “pa” (as in dad) + “khee” (as in “fee” but starting with an aspirated k). It’s not pronounced like the racist term, which is pronounced in Britain like “pack” + “e.”
Pakhi means bird in Bangla. Bangladeshis also used to be Pakistani, so they're probably fine. ;)
Also in Urdu “pankhi” - bird/winged thing. Speaking as one, I think the P***s will be fine with this one.
Yes, non-white Englishman here cringed when I saw the name having been on the receiving end of the term many times.
Isn’t “Paki” just shortened for “Pakistani”? I never knew the word itself to be considered racist; but it’s definitely been used often in a racist / degenerative context and manner.
The thing is that nobody should care about what is considered racist term by some people in the UK or the US. Customs of the anglosphere most definitely shouldn't define and limit language and culture in rest of the world.
Pakhi means bird in bangla. I was not aware it was a racist term when i named it.
How common are programming languages designed with base languages other than english? This is the first one i’ve seen.
IIRC, AppleScript was once usable in languages other than English.
Whether it's actually _designed_ with those languages in mind is a different question. VBA (in)famously was also translated for non-English versions of Office, but that only involved replacing the keywords by translated ones in the other language. German VBA read _very_ weirdly to me, back then.
This is a different take, but I have always been a huge fan of Damian Conway's Lingua::Romana::Perligata, a thought experiment in writing Perl in Latin.

Just a taste from the documentation: "To simplify the mind-numbingly complex rules of declension and conjugation that govern inflexions in Latin, Perligata treats all user-defined scalar and array variables as neuter nouns of the second declension -- singular for scalars, plural for arrays."

I vaguely remember reading about an esoteric programming language that was based on Klingon. IIRC, it was a functional language. (-:

But I do not speak or read or write Klingon, so I never looked at it, and I do not remember the name, either. It did make me chuckle, though.

Well there is Citrine: https://citrine-lang.org/ - it offers a specialized version for over 110 human languages.
Cool project! A bit off topic, but I’m a bad Bangladeshi and never learned the alphabet. Any sources you recommend to learn? I’m not great with (human) languages to begin with, but the character set is a real hurdle.
I would suggest watch bangla content with english subtitle. Thats how i learned english when i was young, by watching a lot of pokemon and transformers in english. I should also warn you bangla content of good taste is very hard to find. Here is a link to list of extremely good bangla movie:

https://asianmoviepulse.com/2020/09/20-great-bangladeshi-fil...

Well now here I was going to tell him how he was missing out on Swami Keno Asami or Mithun Chakraborty as Hitler.
I’m currently learning Bangla and there are a few basic apps for iOS that present the letter along with it’s name, pronunciation, and how it is to be written (as in how to piece together the strokes to write the letter). It’s definitely geared towards kids, but the one I’m using is called BorKnow.

Also I’m using a book by Hanne Ruth Thompson called Beginner’s Bengali that does a good job at introducing the script.

Thanks! May I ask what prompted you to learn Bangla?
No problem! My wife’s family is from Bangladesh, so it’s largely due to that. Plus there’s tons of great Bangla poetry and literature I’d love to be able to access eventually.

Unfortunately there’s not that many resources for English speakers, although between family and a great tutor I found on italki.com (and Anki) I’ve been making progress.

I can barely understand anything in that page though I wish you success and offer this Edsger W. Dijkstra quote, in good faith, for reflection.

"Projects promoting programming in 'natural language' are intrinsically doomed to fail."

Not sure how that’s relevant, given that it appears to be expressing the usual language constructs but not in English or via a Latin alphabet. A couple minutes with Google translate made that apparent.
Hold up, how is this different from programming in e.g. Python or Javascript with Bangla characters? Why does it need to be a different syntax too? Can I use English characters with the Pakhi programming langauge?
I don't think people will ever use this on serious work. It's not even close to python or javascript, so there is no reason to use this instead of those. You can name variables with english characters or any other utf8 characters (including emojis).

Its not a serious project, i worked on it during pandemic when all of our educational institutes were closed.

redacted
My mistake, I got confused. Corrected. But my question still stands.
No worries, I redacted my comment. Forgot that this ain’t Reddit for a moment.

I think the lexer and parser won’t work if you write `if` instead of `যদি`. Just as the opposite won’t work in Java.

Khub bhalo laglo dekhe. Consider simplifying primitives? _সংখ্যা -> ন etc.
ধন্যবাদ। ন টাইপ করতে কম সময় লাগবে কিন্তু ন _সংখ্যা এর মত অর্থবোধক না।
Shomoi kom lagar jonnoi bolchilam. Looked too verbose. But you are right.
Consider keywords :

ফেরত -> উত্তর

ফাং -> কাজ

For hashmap indexes, consider

name["key"]-> name.key

And while initializing

"name" -> "value"

consider syntax

name : "value"

Less typing.

If Tolkien's elves had their own programming language: https://imgflip.com/i/50ogs1
Programming language is more abstract than mere collection of glyphs. I am curious if the glyphs were replaced by English alphabet, what are the special aspects of this language?
This is super cool. Although I cannot read Bangla, is it possible to extend this to other Indian languages, like say Hindi?
I remember one being posted to r/programminglanguages in Hindi keywords, and another called ezhil with Tamil keywords.
Yes, i think i can have it support hindi language probably in a day
Off-topic: What exactly does the "Supported by JetBrains" banner mean?
They provided one license for every one of their product to use on this project. It was not mandatory but they requested to put a link to their website. So, i put it there.

Btw their products are extremely good.

my toy for programming in Chinese http://jiuzhang.cirru.org/ .
Wow love this
As an only English speaker - this is lovely to see!
Yes I love it
Thanks