From reciproc@freenet.edmonton.ab.ca Sun Oct 31 15:21:51 1999 X-Digest-Num: 272 Message-ID: <44114.272.1512.959273825@eGroups.com> Date: Sun, 31 Oct 1999 16:21:51 -0700 (MST) From: reciproc@freenet.edmonton.ab.ca Subject: Re: Lojban and the Turing machine > > > Lojban texts are parsable, and it should at least be possible to > > > formulate computer programs in some lojban-compatible syntax. > > > > I was working on exactly that a while back... it never got > > anywhere, but if anyone's interested, maybe it could. > > I'm interested but for a different reason - spoken programming. I > suspect that speech recognition with lojban could be more accurate > than with English as well as faster. lojban sounds different enough > that you may even be able to automatically extract it from the speech > stream. What's the result? > > You can speak in English freely, but the computer is always > listening. It recognizes commands without a special command flag > ("Computer, blow up the Klingons"). And best of all, the semantics are > substantially simpler. Each sentence means one thing and one thing > only (that thing may itself be vague or abstract, but that's different > from needing to decide among several possibly contradictory > meanings and *then* dealing with vagueness or abstraction). > > > The annoying thing about writing a program in Lojban would normally be all > > the "ko"s and especially "ko gasnu le nu"s. > > Not all the "ko"'s would come at the beginning, even in an imperative > style of programming. Trivially: > > le darcu cu se gasnu ko -- just swap x1 and x2 places > -- the file, cause it to be! Yes, but regardless of where they are, there'd be a lot of 'em. I for one would like as little repetition as is reasonably possible. > > But what about database queries? > > ta'i ma do gasnu le darcu -- by what method do you cause the file? > -- How did you make the file? > ma gasnu le darcu -- Who made the file? Who caused the file? Hey, cool :) > > My idea was, rather than > > thinking of it in terms of ordering the computer to do something, you're > > describing a world that the computer tries to imitate... it would look > > Though it's not quite what you're suggesting below, there's the > declarative programming approach (typified by Prolog). The programmer > does not tell the computer how to do something, just what is to be > done. For example, code for a fibonacci number in Haskell (while > Haskell is often called "functional", its nature makes it easy to be > declarative): > > fib 0 = 0 > fib 1 = 1 > fib (n+2) = fib n + fib (n+1) > > If you look at a math textbook definition, it looks essentially the > same - except you can typeset it better in a book. Describe fibonacci > numbers in lojban and you get something similar, only readable aloud: > > le noboi pamoi la fibnatcis. -- Zero is first among the fibonacci > .i le paboi remoi la fibnatcis. -- One is second > .i la nyso'iremai fibnatcis. du le nyso'ipamai fibnatcis. so'i le > nymai fibnatcis. -- The (n+2)th fibonacci equals the (n+1)th > -- fibonacci plus the n'th fibonacci. > > Note that lojban's lack of ambiguity gives you a positional freedom > not usually found in programming languages. Since "la" is a name, we > know we're talking (implicitly) about a declaration. If we've seen > the name before, we're continuing the description, statement, > whatever. And this isn't even using lojban's built-in variable > assignment system. > > > something like this, only with better class names: > > > la .ap. cu ly'apra > > i le bi'u ly'uindo cu ly'uindo la .ap. > > Better class names indeed - if you're going to use lojban, I can't see > much point to prefixing things with letterals. That trick is for > dealing with old programming languages that don't have modules or some > other sort of name scoping/renaming possibilities. lojban can be > unambiguous with its name referents - so use that capability. > > > = > > > > App is-an-instance-of-LApp > > the newly-introduced LWindow is-an-LWindow-belonging-to App > > By using a fu'ivla ("uindo"), you're effectively creating new words > with their own place structure, aren't you? That doesn't seem like > such a great idea, as memorizing place structure seems to be a real > pain. This is like memorizing argument order when learning a new > library in programming - with bigger libraries, even experts will sit > down with all the reference manuals next to them. > > Note that people that *write* don't usually need to keep a dictionary > right on their desk. > > > = > > > > LApp app; > > app.AddWindow(new LWindow) > > Now the programmer's answer is that *this* is much more succinct and > legible. So what did you gain by using lojban? lojban is a full human > language - that means it is incredibly rich. Using it to duplicate C++ > functionality seems like using a Steyr AUG assault rifle as a > flyswatter. Yeah, you can do it, but your bare hand works better. :) Re all of the above: I completely agree. As I said, I never went very far with this. > But let's look at existing lojban words: mupli and mu'u. > > Mupli is a gismu meaning x1 is an example with common property X2 of > set x3. In c++ terms, an obvious programming semantics is: > > X3 x1(x2); // new variable called x1 of class X3, with initialization > // params x2 Following what I came up with, it doesn't even have to be a new variable--you could add a property to an existing object or variable using just "x1 mupli x2". > mu'u is a cmavo meaning "exemplified by", which suggests x1 mu'u x2 is > equivalent to "X2 x1;" > > > Even this strikes me as throwing good stuff (lojban) after bad > (C++). I think lojban can do better. .ie, but what kinds of things might we do with it, aside from the database queries? I had thought of protocol definitions, something along the lines of le telmrilu ritli .i do jorne le telmrilu samselfu goi ko'a .i do benji zoi my.USER .my. ce'o le cmene .i ko'a benji zoi my.+OK.my. .abo zoi my.-ERR.my. ce'o lo selcusku = The Mail-Receiving Rite [POP3] You connect to the mail-receiving server. You send "USER " then the name. It sends ("+OK" or "-ERR") then any utterance. co'omi'e xarmuj.