Computer Languages and Logic

Post something you find interesting in this second half by connecting it to something you know a lot about.

During the discussion of Loglan and Lojban I found myself continually thinking about logic and how important it is when programming. 

The entire focus of Loglan was the create a language free of emotion, or rather based on logic. When working on a computer program, everything you do has to be done in a way that makes sense to a computer, and you learn to think in a very logical, specific kind of way. Furthermore, programming languages are universal (meaning a person in the US can understand a program written in C just as well as someone in Germany, or someone in China because the langage of C transcends the languages of English, Germans or Chinese). I would equate this way of thinking and “communicating” with the goals of Loglan as outlined in this book.

Okran mentions the power of mathematical notation, and how Brown tried to implement a clear syntax into his language, Loglan. The importance of syntax for clarity is exactly like the importance of syntax in programming for execution; miss one semicolon and you can forget about the computer “understanding” you!

Okran herself mentions the similarities between computer programming and Lojban:

Composing a sentence in Lojban is like writing a line of computer code. Choose the wrong function, drop a variable, forget to close a parenthesis, and it doesn’t work.

I found it fascinating to find that Lojban in fact has the language equivalent of a compiler online. Okran used it herself to check the syntax of her sentences when prepping for the conference. Interestingly enough, she finds when she gets there that while her syntax was correct, her meaning was a bit off. This is something computer programmers struggle with often; sure, your program compiles (meaning there are no syntax errors), but does it do what you want it to do, and if not, then where is your error?

When Okran described the vast amounts of discussion centered around how to properly say things in Lojban, I was reminded of a logic class I took many years ago for my degree. Because I had been programming for a while, I remember thinking that learning about truth tables, if statements and how to show that one thing yields another based on a certain set of rules was simple and fun. However, when speaking to non-programmers in my dorm about the class, I was shocked to find that the art history and English majors were really struggling with these concepts. To me, it all made perfect, logical sense, and for them stripping away the emotion left them confused and frustrated. 

Based on this experience, I am not all surprised that the people who tend to be interested in Lojban are science or math types. People who are skilled in those fields tend to be trained to think in a certain way, consciously or otherwise; their job requires it, and at some point or another they picked up the skill. Lojban caters to expression through this sort of thinking, and while I don’t think it’s excessively convenient, I do understand why it would appeal to the aforementioned people. 

One final bit of information on Lojban… on their main web site, the first bulleted feature of Lojban is:

Lojban is designed to be used by people in communication with each other, and possibly in the future with computers. 

Perhaps the language won’t be Lojban that we use to communicate with computers, but it wouldn’t surprise me at all if at some point in the future humans were communicating with computers through a language based in logic. At a low level, we do this already. “Hey, computer. Draw me a rectangle.” “Ok, person, here you go.” As computer programs and technology become more and more sophisticated, I think it’s just a matter of time before people can talk to computers.

Oh, wait. The time is now. (I’m kidding… mostly.)


Lojban Orthography, by Norman Friis. Final project for LIN312 - Klingon & Beyond (Bigham), Fall 2005, University of Texas at Austin

History and Origins of Lojban: Lojban is a constructed language related to Loglan created by the Logical Language Group (LLG) in 1987. James Cooke Brown, the creator of Loglan, had copyrighted Loglan so the LLG sought to circumvent this copyright by using a different vocabulary on top of the underlying grammar and structure of Loglan. 

After a lengthy court battle the copyright was invalidated, but regardless, Lojban‟s supporters had already adopted this new vocabulary and named their language Lojban: A realization of Loglan. 

Features of Lojban: Much like Loglan, Lojban is based on predicate logic. There are no irregularities in grammar or spelling. The language was designed to be easy to learn and culturally neutral. For these reasons, it lends itself to applications in artificial intelligence, machine translation of natural language text, and other similar linguistic and computer science fields.

Lojban is a synthetic SVO and sometimes SOV language. While Lojban‟s grammar is based upon and very similar to Loglan, there are minor differences. In addition, Lojban‟s grammar is formally defined using the tool YACC (with some formal “pre-processing” rules) which can create the code for a parser given a grammar written in BNF (BackusNaur form) notation.

Orthography: Currently Lojban uses the standard Latin alphabet without h, q, w but with the following three letters: , (syllable separator) (pause, or glottal stop) ‘ (θ [voiceless th sound]). In an effort to create an orthography which reflects some of the intended uses of Lojban, each character encodes within it some meaningful information as to its articulation. This is achieved by a simple 4 row, 2 column matrix. Starting with the top left element and moving left to right in a row major order, the elements are numbered from 0 to 7. Each element can be <on> or <off> and this is represented (in script form) with a dot. Connect the dots as long as they are adjacent except for dot 7, it is never connected to adjacent dots.

The meanings for each element (when they are „dotted‟) are as follows:
0 – stressed (only with vowels, and only if the word uses an unusual stressing pattern)
1 – non-sonorant
7 – end of word (see below)

1 = 0: Non-sonorant:
2 – bilabial/labial
3 – velar/post velar
2+3 – alveolar
4 – fricative
5 – stop
6 - voiced

1 = 1 and 6 = 0: Sonorant:
2 – bilabial/labial
3 – velar/post velar
2+3 – alveolar
4 – fricative
5 – stop
6 – vowel

1 = 1 and 6 = 1: Vowel:
2 – close
3 – open
2+3 – mid
4 – front
5 – back
4+5 – central

Each character has two (or four in the case of vowels which have stressed and nonstressed versions) possible realizations, one normal and one where the character appears at the end of a word. When element 7 is marked it takes the place of the space following the end of a word (this is different than the character „.‟ which means a pause or glottal stop). This is attractive because it cuts down on space used by text when represented on computers as strings of bits.

Consider the following line of Lojban text in traditional Latin alphabet:

.i le do nobli turni be la ter. ku se cfari

There are a total of 43 characters (including spaces), of those 10 are spaces (~23%). To represent this using ASCII it would take 344 bits (43 * 8 bits), of which 80 bits are effectively wasted space used only to help mark word boundaries.

By incorporating a way of marking word boundaries in the characters it is possible to reduce the number of bits required to represent this string (264 bits with the above proposed orthography). This may be an attractive feature considering potential applications with machine translation, storage and analysis of large bodies of text.

Seventh Language Review: Lojban

Hello again friends!

I’ve found a perfectly logical language! Well… I’ve found a very well thought out language. Lojban is the successor to Loglan, which was a proprietary engineered language that (apparently) nobody speaks.  Lojban does have a medium sized community, but it’s less than 5K in total.

The Good

Lojban’s morphology and syntax is unambiguous. When I say something like “I saw the homeless guy from my apartment” in English, it can be taken a couple of different ways. When I asked my coworkers what they thought I meant with that question, about 20% thought that I was looking out my apartment window and noticed the homeless guy. The remaining 80% thought that I meant that the homeless dude was from my apartment, and I had seen him somewhere other than at my apartment. Anyway, Lojban fixes that. Lojban’s phonemes actually make sense… a lot of sense. They match the IPA closely. Unlike Esperanto, when Lojban says “sounds match spelling” they actually mean that. Lojban is completely unbiased. Lojban words appear to be 100% a priori – they have nothing to do with any existing language; however being culturally independent in this case is probably more of a drawback than a benefit… 

The Bad

Lojban words are a priori. I cannot remember a single god damn word from one week of study. I can remember several dozen words from my one week with Esperanto. Like hundo for dog, kato for cat, kvalo for horse, nomo for name, etc etc. See, Esperanto kind of makes sense in this regard (and only in this regard). It’s somewhat recognizable. Lojban’s word for dog is (and I had to look this up… again) gerku. GERKU. What? While I was able to memorize a large portion of Lojban’s grammar rules in a few hours I’m very confident that its nonsensical vocabulary will take me many years to master. With Esperanto, hundo sounds like “hound” to me, so it seems to stick in my brain. What the fuck is a – dammit, I forgot the word again – gerku? Bah.

Lojban’s grammar is hard. It makes perfect logical sense, but it’s very very unique. So unique that I think it could be a solid steel road block for even the most ambitious language newb. Most people are used to prepositions… but Lojban is primarily predicate driven. Lojban’s “verbs” are kinda like functions, and the arguments to these functions would be the words following the “verb.”

Oh, and probably one of the most upsetting things about Lojban: they don’t have a nice website like Esperanto (the fancy lernu.net navigation system and built-in forum really makes me feel right at home, it’s the language that pisses me off). Lojban learning materials are lacking, but this probably because the community is small. More people like the Twilight saga than have even ever heard of Lojban… I’d take that bet.


I’m still investigating the world of constructed languages. I have many more on my list… but I’m not sure that they’ll be as clever as Lojban is. Lojban has the “mind expanding” potential of learning pure logic, but the lack of learning material and the uniqueness driven barrier-to-entry might keep the community small in the long run. I’d recommend checking out lojban.org to get a feel for the language… if it isn’t completely foreign and insanely difficult, then go for it, for you are a smarter person than I. 

Edit: Lojban is the successor to Loglan, NOT the predecessor. Thanks to dareal for pointing out my mistake.

Title: Loglan 1: A Logical Language

Author: James Cooke Brown

ISBN: 75-12985 (Library of Congress Catalog Number)

Year: 1975 (3rd edition)

For those interested in conlang, Loglan is the first logical language–a language designed to test the one variant of the Sapir-Whorf Hypothesis and see if Brown could create a language so different from natural languages that it would force speakers to think completely differently. Here Brown lays out his work (he considered it incomplete). Since other logical languages are occasionally referred to as loglans, to clarify, this is the language from which they derive that moniker.