Tag Archives: Overview

Essays regarding an entire field of study.

A la recherche du recherche.

Title's a pun on "A la recherche du temps purdue," by Proust. I haven't read it.
The phrases translate "Of the Search for Lost Time" and "... for Research."



I've updated my portfolio:
    https://www.mediafire.com/folder/kr2bjyn1k3gjr/mlptk-recent
    WARNING: ADULTS ONLY due to explicit sexual content.
    Videlicet and DiffWalk are still buggy.
    However, I have established something approaching a meaningful testbed for
    Videlicet: which, I assume, can be easily completed by even a high schooler.
I advise you to download right now, before the U.S.A. puts the kibosh on freedom
of speech. I'm not even joking. They're terrorist scum. As for my own work, it's
free of virii (except, possibly, the companion curriculum) unless "someone" has
interposed his or her Uncle Sam-ly might between you and MediaFire.



I've wasted my whole life studying science: a field humans would prefer to shun.
And it _was_ a waste. The decades I exhausted in research, the ultimately fruit-
less pursuit of any joy or love at all in being, the long years I passed away
trying to teach what amounted to a gaggle of ignorant bumpkins (the human race):
all worthless. 

Although my works weren't well-received, I accomplished much before the end. My
achievements place me in the lower ranks of eminence -- where I reside, with
conifers around me. Insofar as I may teach you all that I know, I have attempted
to do so with my works and lectures thus far...

... and this is, probably, the end. I am afflicted by cerebral palsy due to many
lobotomies and torture throughout my lifetime; I have a constant migraine; can't
concentrate on my work; am frequently malnourished and tired; have been, for far
too long, unable to find work; and am persecuted by an incredibly huge malicious
conspiracy of villains who intend to hurt me for literally no reason at all.



I will now reminisce. This may take a few minutes. 1%... 2%... 3%...



Back in the halcyon days when I was a little boy, I wanted to be a little girl
instead. This was a source of great amusement to many around me, who shunned and
reviled what they foolishly believed to be the dread specter of Teh Gay. In fact
my sentiments were more along the lines that I should've been born female, but,
because my genome contained a Y chromosome, I was doomed to live a man's life.

And it IS a man's life in the modern army, where we remember our past lives and
discover exactly how much humanity has tortured us throughout the millennia! But
I was not to discover that for many years, because every time I discovered it my
cerebral cortex was "corrected" (cut to pieces) to cause me to forget again.

I have often been abused and tormented by those around me, in this and probably
all my other lifetimes, if any. Electrochemical lobotomy, identity reassignment,
and just about all the other horrors the modern world has to offer have been, at
one time or another, inflicted on me personally. I have also experienced nearly
every single horror the wilderness has to offer, at one time or another.

So it was that, when my family and those surrounding me began to abuse & exploit
me for their entertainment, I wasn't terribly surprised. I tried my best to put
up with them; nevertheless, as with all squalling children, my discipline broke
and I inevitably lost my temper. I became nothing more than a sentient beast --
no longer the sapient intelligence I once was -- and mere Earthlings had finally
succeeded in dragging me down into the mud where they oinked and rooted. (Which
really stunk, because oinking and rutting can be done outside of the mud too.)

"You have fallen from your ivory tower," they cried! "You are human after all,"
they crowed! "Now you have to suffer," they clucked! "Therefore, beg us for help
that we may further insult you," they grunted! Producing their clubs, they then
metaphorically beat me to death by refusing me any place among them because...
well... IDK. I've tried to reason with them about it and they appear not to be
sapient enough to offer any reply that isn't unintelligible sentient gibberish.

I gave up. They had won. I couldn't beat them.

I joined them instead.

But that eventuality was not to be until the far future, when I was thirty years
of age. In the meantime, I tried to live my life. It was somewhat lonely, which
is why I've so little to say about it and nearly nothing to say about people.



Among my first experiences & thoughts about this life were that I wanted to farm
-- but I was not suitable to the task. I then thought I should be an artist or
an astronaut. Some time later I discovered mathematics, which was, to me, a
convenient blending of art with science.

In fact, computer programming is very much like art, and when I first discovered
the science of computing I was much enthused. I subsequently wrote many computer
programs throughout middle- and high-school, exhausting much hobby time on my
curriculum of independent study. After I'd learnt how to read and write, I then
went on to study computer science at the University of Idaho between 2006 - '09.

I published my portfolio, containing my awesome works (of greater magnitude than
those of most men you'll encounter), several years after I'd departed from UI in
the year 2009. I have contributed data from my experiments to computer science &
the mathematical study of computer programming has also benefited slightly from
my examination of Turing's axiom and predicates arising thence.



During my lifetime, I spoke to and learnt from many people: most of whom deserve
exactly no mention, and some of whom are perfectly content to see their names in
the sand become washed away by the incoming tide because they have accomplished
their own great deeds and need not curry favor from any one.

Among lessons I've received from such individuals, to whom I'll graciously refer
as humans (because some actually deserve the title -- you know who you are), was
that self-denial, although not strictly necessary to an ethical lifetime, must
be in significant extent. Desire is an easy way for others to take advantage:
although the desirous can't be faulted when they succumb to temptation (drugs &
other means make this very much impossible on some occasions), those who would
disadvantage others are quite oblivious to the cries of their victims.

Desire truly is the cause of all suffering, which life is, but to my view it's
more a matter of larcenous middle-men than it is one of avaricious monks getting
what they deserve for peeping at the nudie bar. (Of course, they'd never.) None
the less, so many swindlers are that we may just as well be paranoid every day.

Speaking of desire and suffering, what about death? This is getting pretty old
these days, but I'd like to ask all you monks: how in the flying !#@$ is anyone
supposed to live if he desires nothing? (Of course, none can.) Self-denial leads
to dying of starvation, then, in this assumption of mine, and self-indulgence is
as close to Nirvana as only wealthy hedonists can arrive.

"Should we all be trying to kill ourselves?" I've heard from anxious voices? No.
We'll all die someday. The journey is somewhat desirable, even if not nearly as
much as is the destination!

But it's probably helpful if we all try not to hurt anyone in the meantime.



I mentioned joining the ideology of the masses when I couldn't beat it. Did you
know how easily one can lose his mind? I only had to starve for nearly a decade
before I began to entertain regular thoughts of an unprintable* nature.

    * Unprintable nature is due to terrorist censorship regime which imprisons
      without trial in concentration camps called mental institutions, and does
      not necessarily imply endorsement of this regime by WordPress. No purchase
      of anti-tank missiles is necessary and supplies are limited to one fatwa
      per household.

Well, long story short: because I was completely devoid of the capacity to find
any employment, and because I couldn't care about living any longer now that my
brain had been reduced to oozing sludge by yokels with electrochemical clubs, I
confronted a terrible choice: starve to death over the course of the next decade
or finally do something with my life I've meant to since the very day it began.



And that was, like, totally the story of my life!
You know, they say it ain't over 'til it's over, but, lemme tell ya...
    - I have been serenaded by more fat ladies than I can count on both hands!
    - I have not only heard the bell toll, nay, for I have tolled it!
    - I have both emptied my bucket list and kicked it! (The list, I mean.)
    - My heart has gone on! (And on, and on!)
    - I _aaaalmost_ earned my Ph.D. without ever attending University for a day!
    - My ass has literally been worked off!
    - I understand what it's like to be sick to death of society!
    - I have discovered the music of the spheres... and masturbated to it!
    - I am _LITERALLY_ a saint! (And I live in a haint. Haintin' saints!)
    -                      ^- I shit you neither, foolish Earthlings.
... and it's been great fun! Thanks to everyone with whom I once corresponded,
for fully understanding the inevitable consequence of trying to help a wretched
torture victim ever enjoy anything about being alive: his or her lictors will
simply grab all the humanitarian aid you attempt to provide, such that, although
you certainly found the dissenter a valuable asset worth your assistance, you'll
have simply thrown your money into a Sarlacc pit of despair in any case!

And now, from the cockles of my heart... or, perchance, my sub-cockle area... I
will present to you the next act in my spellbinding saga. (Stay tuned.)
Advertisements

Give Me That NP-Time Religion.

"Give Me That NP-Time Religion."
"What was Good Enough For Granddad is Good Enough For Me."
"Day-Old Panglossary."
"Speakeasy."
"Babel: the New Fishing Sensation!"

"NP Religion" is a pun on nondeterministic polynomial time & language jihads.
"Granddad" is a pun on the title of a song by the Squirrel Nut Zippers.
"Panglossary" is a pun on linguistics and bread.
"Speakeasy" is a pun on methamphetamine during the Prohibition era.
"Babel" is a pun on Babel Fish, in D. Adams' _Hitchhiker's Guide to the Galaxy._

NB: This lecture is a summary, or tour de force, _not_ a tutorial.
    Until such time as I write some of those, I suggest you seek them elsewhere.
    As with all my publication, it's free of charge to the Public Domain.



I've sometimes encountered the question: "what's the best language to study?"

The answer is as varied as the races of man, but boils down to "whatever."

Nevertheless, I have picked one for the moment: Python 3, a C wrapper.
Python is easy to learn, as powerful as C, and implements many fine metaphors
such as generators, list comprehensions, and generator comprehensions. If you
haven't a clue what I've said, that's fine, because Python's still great for you
as you begin with a computer programming curriculum. See also the Icon language.

In the field of information technology, all have their own preferred flavor of
computing. If you'd like some language I've never written, such as Haskell, you
are probably better off to study that instead of Py3. Prefer specially languages
your friends write and will help you learn. A human being is a better tutor than
a reference manual -- whence I've learnt much.



Briefly, I'll summarize languages I know or with which I'm familiar in passing.
I'll describe the category (What & How), utility (Where & When), and specialty
(Why & Who) of each such language.

There are hundreds of computer programming & markup languages, of which only a
few I've reviewed here. See also The Daily WTF (Worse Than Failure) and your
friendly neighborhood University's computer science department, as well as text-
books like Structure & Interpretation of Computer Programs and tutorials.

I'll not limit these to programming languages, properly; also included shall be
descriptions of markup languages and perhaps a few esoteric mini-languages like
NullSoft's Scriptable Install System. One noteworthy limitation: ubiquity.

(The difference between programming & markup language is loops, i.e. iteration.)

NB: any language can, hypothetically, be compiled. Interpreted languages usually
assume that the speed loss and overhead from interpretation are tolerable, or
there's some caveat (dynamic typing or execution environment) that requires an
interpreter even when the language is "compiled" (such as, IDK, Java).

In no particular order:




JAVASCRIPT

What: ECMAscript (Javascript) is a procedural language used in Web pages.
      Javascript is also used in Web browser design, usually supplementing C++,
      for certain runtime code such as Firefox's ill fated tab gallery.
      The Windows Script Host will execute Javascript outside a browser.
How:  Much like C, without Malloc, but quite a bit slower because "everything is
      an object" and for other amusing reasons not limited to the interpreter.
      Browser-based implementations can access the Document Object Model.
      Javascript is an interpreted language.

Where: Dynamic HTML pages for the Worldwide Web. In-browser apps like my MLPTK.
When:  Although Javascript fails at three-dimensional rendering, it is opportune
       for such tasks as moving parts of Web pages (where Cascading Stylesheets
       cannot suffice), making them appear and disappear, and sending beacon
       queries at specified intervals so pages update without clicking "Reload."

Why: Javascript requires no compiler. Compatible Web browsers exist for any OS.
     Modern browsers implement a recursion limit, due to heap and stack overflow
     exploits, which hinders traditionally-generated reentrant parsers; other
     than this caveat, and the speed problem, JS is good for simple computation.
Who: Web developers, browser programmers, casual programming, portability.

Summary: Great for Dynamic HTML! The recursion limit can be a pain, however.



PHP HYPERTEXT PREPROCESSOR

What: An interpreted language executed by Web servers such as Apache or nginx.
How:  Like other languages compatible with the Common Gateway Interface, which
      are many and varied, it's executed by the server.

Where: PHP can be written in conjunction with HTML, within the same document.
       Dynamic Web forms and dynamically generated pages "feel" more natural.
When:  PHP is useful for the server-side ("back end") of Web applications,
       especially where the user must never know how passwords are validated and
       where the server can take some bandwidth load off of the transaction by
       computing something on its side rather than transmitting a massive JS lib
       to the client side and asking the client to compute for it.

Why: Because it's server-side, the end user never sees what it's doing, and so
     it's fantastic for bookkeeping on your side of the transaction.
     HOWEVER! Always remember that you need to keep a careful eye on security,
     especially where the user supplies any input at all. You'll need to escape
     and/or sanitize this input in other ways, to avoid clever little hacks like
     Johnny "; DROP TABLE *; ".
Who: Writers of CAPTCHAs, Web shopping carts, members-only galleries, etc.

Summary: Like other CGI tongues, PHP is a Webmaster's vade mecum.



HYPERTEXT MARKUP LANGUAGE

What: A formatting language used for writing HTML pages on the Worldwide Web.
How:  HTML marks up a hypertext document for rendering by a Web browser.

Where: On the WorldWideWeb, or a mirror on your local file system, etc.
When:  HTML documents are the markup format of choice for Web browser rendering.

Why: Web pages, GUIs for DHTML apps, front ends for business.
Who: Web developers, casual rich text writers, authors of technical documents.

Summary: Good for quick GUIs, reference manuals, and writing (w/o MS Office).



CASCADING STYLE SHEETS

What: CSS (not to be confused with the DVD content encryption scheme of the same
      name) is a formatting (markup) language with programming-like abilities.
How:  It is an interpreted language. Its facilities exclude iteration/recursion.

Where: Web pages, résumés, and other such documents.
When:  Whenever HTML formatting is insufficient to the task.
       CSS, AFAIK, lacks loops, and can't use HTTP. Supplement it w/Javascript.

Why: CSS is a faster, prettier way to mark up Web pages.
Who: Web developers, publishers, résumé formatting, etc.

Summary: Useful to format your curriculum vitae, if LaTeX is too much trouble.



C/++

What: C is a procedural programming language that's near to machine language.
      C is "sorta" object-oriented. C++ is more conducive to OO design. I use C.
How:  The programmer works with bytes & system interfaces to effect his design.
      C is compiled to assembly language and then assembled to machine code.

Where: Unix and Unix-like systems, such as MacOS 10+ and Linux.
       C can also be compiled on other systems, like Windows: Dev-C++, mingw.
       The Linux Programmer's Manual, included with Ubuntu's "build-essential"
       package, contains the complete Posix specification described by the ISO
       538 Committee Draft, August 3, 1998 WG14/N843, titled C '98, as well as
       by the Single Unix Specification. C is, substantially, Unix.
When:  The C programming language is close to machine language in many respects:
       therefore, and because compilers have been written and optimized much, it
       is blazing fast. C is most fruitfully employed in operating system design
       because the computer's hardware must be spoken to in machine code.

Why: If I need a fast program or a portable one, C is the lingua franca.
Who: Operating system designers, simulation/game programmers, hackers.

Summary: C and C++ are the Speedy Gonzales of the programming world.



PYTHON

What: Python is a procedural programming language with functional capabilities.
      It contains all of C++'s object-orientation, with additional benefits.
      Python is an interpreted language, and can be compiled.
How:  Using its substantial standard library, and extra OO benefits, Python is
      quite able to solve the vast majority of information technology woes.
      Python's an interpreted language. Its interpreter runs on Windows & Linux.

Where: Python's extensive manual (& library reference) describe convenient fixes
       for most IT-related problems. My only problem with it: unlike, e.g., the
       Haskell language, programs can't be described in pseudo-EBNF.
When:  Just about anytime for fun & profit. However, if you use it commercially,
       Python's author would like you to contact him. If you'd like to write a
       program more like a flowchart than an algorithmic procedure -- e.g., if
       recursion & parsing are your cup of tea -- you might try Haskell?

Why: Like C, but don't like malloc? Python's for you! :) See also: python.org
Who: Information technologists, discrete mathematicians, C programmers, etc.

Summary: Easier than C, with all the phenomenal cosmic power, in a box.
         Python also executes nearly as quickly as C, even when interpreted.



HASKELL

Actually I know next to nothing about this language. Ask Glasgow University?
Also you might try the book "Learn You A Haskell For Great Good!"



JAVA

Java is not Javascript. That's about all I know. Read more @ Sun Microsystems.



LISP, SCHEME, AND SIMILAR

What: Functional programming languages, suitable for lambda calculus etc.
      I believe these are interpreted, but can probably also be compiled.
How:  Unlike object-oriented languages, in which the programmer arranges data in
      groups (structures, objects) that are sensible to the human mind's spatial
      orientation perceptions and its imagination, functional programming uses a
      calculus-like notation to make all programs function()s of other programs.

Where: Because all programs are functions of other programs, the transformative
       idea of the computer program (parser) as a finite state automaton that
       manipulates other such automatons finds an easy home here.
When:  The program itself is also data and object-orientation is (to some minds)
       easier to understand from a functional perspective. So, lisp is a good
       language for programs that have to change their code a lot.

Why: Calculus, I think, and iteration.
Who: The Knights of the Lambda Calculus.

Summary: I haven't much used functional languages. This entry is guesswork.



ASSEMBLER

What: Several varieties of mnemonic languages used to write machine code.
How:  Mnemonics are "assembled" to machine language, or some form of executable
      code, based on the assembler's translation table.

Where: Assemblers are like compilers; but, instead of parsers, they're scanners.
When:  Therefore, they're easier to write. Also, see "MACHINE CODE" below.

Why: Because you don't want to write machine code yourself.
     After all, only a simplistic scanner is required to do this for you.
Who: Manly men, womanly women, and all sorts in between.

Summary: Just write this part after you write your compiler. (It's easier.)



MACHINE CODE

What: All computermachines speak electronically via binary ones and zeroes.
How:  "Machine language" is the coded sequences of binary numbers that are used
      to instruct a computer's computational circuitry (its ALU, or CPU).

Where: Primitive machinery, new interfaces, low-level hacking & intrusion.
When:  Whenever flowcharts and buzzwords just aren't enough to get you hired.

Why: Compilers do most of this work for us these days. Sometimes needed, though.
Who: "Real Programmers," electrical engineers, chipset architects.

Summary: Don't bother unless you're an electrician. (It's tedious / dangerous.)



FLASH ACTIONSCRIPT

What: A stack-heavy programming language similar to assembly language.
      FlAS is an interpreted language, and it's pretty slow.
How:  A FlAS is embedded in a Shockwave (Adobe) Flash file to animate parts and
      provide for user interaction. 

Where: Because Javascript is no good for complicated rendering tasks, Flash AS
       is often employed to write Web games to be played in browsers using the
       Macromedia Shockwave -- ahem -- Adobe Flash plugin.
When:  If you need a Web game in a browser, or if you must format your gallery
       in such manner as to make it less scrutable to text-mode scraping 'bots.
       Scrapers can still take your gallery to pieces even if you use encrypted
       Javascript or amusing cryptographic puzzles in Flash, but I'll bet SWF is
       just about the end of the line for the casually-scraping archivist.

Why: Probably just because Javascript is no good for Web games.
     Flash's "tween motions" are very amusing, too, and I keep wondering whether
     Adobe will implement a Disney-like strech-and-squish. Technically, so could
     any programmer, and perhaps you too might like to take a crack at Mickey?
Who: Game programmers, paranoid gallerias, art students.

Summary: I've used this language less than Lisp, but it's popular.



DOCBOOK

What: A formatting language used for writing technical manuals and textbooks.
How:  DocBook is converted via DB -> TeX -> DVI pipeline, then rendered as PDF.

Where: Dissertations (M.S., Ph.D., ...), portfolios, scientific documents.
When:  Particularly opportune for automatic compilation of reports, such as in
       my report.sh, where formatting several thousand documents as individual
       PDFs and then merging them all would be a waste of time. Of course,
       markup languages are always apropos of computer-generated output.

Why: Professional-quality formatting to PDF, in a markup language, without any
     such editor as Adobe's Acrobat and others. DocBook also has a 
     tag for formatting simplistic chemical equations, although many other
     symbols aren't rendered by dblatex -- so, write in pure LaTeX instead!
Who: Scientists, yuppies, and anyone who can't afford Adobe's software... :)

Summary: LaTeX for newbies, and there's nothing wrong with newbies: they learn.
         As DocBook parsers and rendering technology improve, it may even grow
         until it supplants LaTeX entirely. (DocBook _is_ a favored contender.)



LATEX

What: A programming language that is also a formatting (markup) language.
How:  LaTeX is rendered by a TeX -> DVI -> PDF pipeline involving several tools
      in Linux (and, probably, because Linux is Posix-compliant, also Unix).
      

Where: Unique among programming languages, LaTeX is used to format rich text.
When:  See DocBook, above, and also where extensive fine formatting is needed.

Why: Conventional tools, such as MS Office, typically lack somewhat in rich text
     formatting facilities -- equations with strange symbols and subscripts are
     particularly difficult to write. LaTeX solves these problems, and also has
     fine-grained control over where and how items appear on the printed page.
     It's only a step away from PostScript (a printer language), in that regard,
     and writing in LaTeX is much easier than writing in PostScript.
Who: See DocBook, above, and also especially mathematicians.

Summary: DocBook for oldbies, and naught is wrong with oldbies: they're elite.



EXTENDED POSTSCRIPT

This is a control language for inkjets & laser printers used to write on paper.
It is also a programming language (has loops), I believe, and can be used to
exploit printers in horrifying ways (BTW, kids, don't try that at home).
Because PostScript is a part of Adobe's Portable Document Format (PDF), there've
been computer viruses transmitted via PDF files. Technically, this caveat cannot
be avoided, which is why your boss advises you to only open trustworthy PDFs.



BASH, BATCH, MAKE, SHELL, & SIMILAR

What: Such languages are used to automate repetitive invocation of commands as
      may be encountered during the operation of computer systems like Unix.
How:  Shell scripts simply automate a shell: something like Bash or MLPTK, or
      Microsoft's "Command Prompt" (which used to be MS-DOS).

Where: Although (except for MS-DOS, now outdated) a shell isn't an underlying
       part of the operating system, it can invoke any command compatible with
       its standard input & output.
When:  Shells are therefore suitable to batch processing of data, such as report
       generation, transcoding, and file system rearrangement.

Why: For example, my report.sh: compiling my book and massaging all the parts
     into DocBook markup for dblatex would take too long if I did so by hand.
Who: Anyone who uses a computermachine to compute, archive, and collate data.

Summary: Great for computing. Probably anathema to intellectual slavery laws.



PERL, SED, AWK, GREP, & SIMILAR

What: Although Perl is a fully fledged programming language, Sed & Awk are both
      more useful for text processing than anything else.
How:  Using regular expressions (regular grammars that describe alphabets), the
      Stream EDitor and Mawk administer Swedish massage to the output of unit
      tests and other experimental data. Additionally, to text-based protocols
      such as HTTP, sed is the PaperMate of the information technology world.

Where: Tabulating the results of experiments, directory listings, reams of data,
       rewriting the Web as you browse it (see my HTTPyre) and such tasks.
When:  As lifetime Unix gurus will tell you, "every [EXPLETIVE] day."

Why: Any text that makes sense in any legible way can be quickly massaged and
     reformatted by the stream editor. Perl's a bit more powerful, but I hate it
     for irrelevant reasons. I do mean _any_ text, btw: even computer programs.
Who: Virus scanners, information technologists, Web router programmers, cads.

Summary: Sed is to IT as the slide rule is to mechanical engineers.
         The combination of sed, awk, and grep suffice to effect many simplistic
         Web robots (but mind you ROBOTS.TXT); if you're careful to format your
         computer programs' output as legible text, you'll find them handy too.



NSIS

What: The Nullsoft Scriptable Install System is a mini-language for installers.
How:  It's like a shell script that unpacks a ZIP file, moves the contents to
      specified directories, and modifies the Windows registry accordingly.

Where: Similarly to the InstallShield Wizard, NSIS effects "installation" of the
       kind that Windows users expect. It's much like dpkg / apt-get on Linux
       distributions such as Debian and Ubuntu.
When:  NSIS is free of charge, although InstallShield might be too? :)

Why: Windows users don't want to unpack an archive and move stuff themselves.
Who: Anyone writing a program for Windows. See also: InstallShield.

Summary: One of several ways to write self-contained installers.

“Windows cannot find a critical file.” Current Rage Level: Omicron.

Ubuntu Linux: the Wal-Mart(TM) Frontier. These are the voyages of the Spacecar
Grosvenor. Its continuing mission: to allocate new structs & new classes, unite
all people within its nation, and leak where memory has never leaked before.

Of the numerous Linux installations ("distributions"), I've used Ubuntu Linux (published by Canonical Inc.)
most. It contains the Linux kernel, the GNU core utilities, and several other
items of interest such as an automagically-configured graphical user interface.
It is extraordinarily user-friendly, to the point of feeling constrictive. (The
desktop environment has changed since version 11: users now cannot reconfigure
the taskbar or workspaces. The repository wants to be a dime-store, too, and
although a potentially lucrative storefront I miss the simplicity of Synaptic.)

Its installation procedure is simple: download a Live CD image from Canonical's
Web site, burn it to a CD-R or RW (these days, you might even need a DVD), and
reboot your machine with the disk inserted. (Don't forget to tell the BIOS -- er
whatchamacallit, the Extended Firmware Interface -- to boot from CD.) You'll be
presented with an operable temporary login. Thence you can install the OS. Also
available from this interface was an option to create a USB startup disk, but it
has been removed in recent revisions of Ubuntu: previously, using VirtualBox or
any similar virtual machine, the user could run the LiveCD & make a startup USB
without even rebooting out of their present operating environment, which was
useful on old machines whose optical drives had failed. You can still "Install"
to the USB key, but it boots slowly & you can't install it from there to a box.

The installation wizard is a no brainer: "install alongside Windows." Easy! And
it usually doesn't cause your existing Windows system to go up in smoke, either.
However, to install Ubuntu more than once per box, you must repartition manually
(and may also need to change grub: see /boot/grub and /etc/grub.d). Gparted is
included within the live disc images, but must be retrieved again after install.

If you'd like to make intimate friends with the manual pages, and discover where
primary partitions go when they die, you can install with less assistance. This
lets you specify partitions in which to mount your home & system directories, in
case you'd like to keep them segregated. (That's probably a great idea, but I
never do.) You can also create and specify swap partitions: which are employed
as virtual memory and, I suspect, for hibernation and hybrid suspension.

About file systems: I typically use FAT32, NTFS, ext4, and ext2. (Total newbie.)
FAT32 is elderly and fragile. It's used for boot/EFI partitions, 3DS & 3GPs.
NTFS is Microsoft's modern FS. Withstands some crashes, but has no fsck module.
ext2 & ext4 are Linux's. ext4 journals. ext2 permits file undeletion (PhotoRec).
The extended 4 system is harder to kill than a cockroach on steroids, so I tend
to prefer it anywhere near the heart of my archives. I use ext2 | NTFS for USBs.

Be very careful not to destroy your existing data when repartitioning the drive.
Any such operation carries some risk; back up anything important beforehand. One
way to backup is to prepare an empty HDD (or any medium of equal / greater size)
and dump the complete contents of the populated disk into the empty one:
 dd if=/dev/sda of=/dev/sdb status=progress
 (Where sda is the populated disk, and sdb the empty backup disk.)
Similar can be accomplished by dd'ing one of your partitions (/dev/sda1) into a
disk or a file, then dd'ing the image back onto a partition of equal size. Disk
image flashing is a simple and popular backup method for local machines, sparing
you the time to learn rsync (which is more useful in long term remote backups).
Far from being an annoying elder sister, dd is the Linux troll's best friend.

Beware the dreaded "write a new boot/system partition" prompt. It bricked me.
The problem was because I had set the system to "Legacy Support" boot mode, but
the original (now unrecognized) installation was in Extended Firmware Interface
mode. I was unable to recover until I had re-flashed several partitions.

The usual "new car smell" applies: you'll want to configure whatever settings
haven't yet been forbidden to you by your GUI-toting overlords. In Ubuntu 16,
access them by clicking the gear and wrench icon on the launcher panel. You can
also search for something you're missing by using the Dash (Super, or Windows,
key pulls it up: then type), which functions similarly to the apropos command:
e.g., instead of Ctrl + Alt + T and then "man -k image", Super key then "image".
It will also search your files (and, after plugins, several social media sites).

Although the newfangled Dash is convenient, don't forget your terminal emulator:
you can easily spend the vast majority of your working time using bash by way of
gnome-terminal, without ever clicking your treasured Microsoft IntelliMouse 1.1.
In Ubuntu 16, as it has been since Ubuntu 11, Ctrl + Alt + T opens the terminal.

Under the directory /usr/share/man/, you will find the on line (interactive)
manual. This describes the tools available to you. Begin reading it by opening
a terminal window (using Control + Alt + T, or the Super / Windows key and then
typing "terminal"), keying the command 'man name_of_manual_page', and pressing
the Enter key. In this case, the name of the manual page is the page's archive's
filename before the .[0-9].gz extension.
Of particular interest: telinit, dd, printf, cat, less, sed, tee, gvfs-trash,
mawk, grep, bash (if you're using the Bourne Again Shell, which is default on
Ubuntu 16), cp, rm, mv, make, sudo, chroot, chown, chmod, chgrp, touch, gunzip,
gzip, zip, unzip, python, g++, apt-get (especially `apt-get source ...`), mount,
kpartx, date, diff, charmap (same name on Windows!), basename, zipinfo, md5sum,
pdftotext, gnome-terminal (which is _how_ you're using bash), fortune, ffmpeg,
aview, dblatex, find, cut, uniq, wc, caesar, rot13, curl, wget, sort, vim, man,
tr, du, nautilus, tac, column, head, tail, stat, ls, pwd, pushd, popd, gedit,
source-highlight, libreoffice (a Microsoft Office killer), base64, flex, bison,
regex, perl, firefox, opera, chromium-browser, konqueror, lynx, virtualbox,
apropos, od, hexdump, bless, more, pg, pr, echo, rmdir, mkdir, fsck, fdisk (same
name, but different function, in Windows), ln, gdm, gnome-session, dhelp,
baobab, gparted, kill, locate, ps, photorec, testdisk, update-grub...
(If you haven't some of the above, don't worry. You should already have all you
 need. Keep in mind that the Ubuntu repository's software is divided in sections
 some of which contain potentially harmful or non-free software. When venturing
 beyond the fortified walls of <main>, be cautious: you may be eaten by a grue.)
Beneath /usr/share/doc/ or /usr/share/help/ are sometimes additional manuals.

If you use Linux, you will have to memorize several manuals, and name many more;
especially those of the GNU core utilities, which are a great aid to computing.
There's also a software repository to assist you with various computing tasks:

To acquire additional software: gnome-software (the orange shopping bag to your
left, above the Amazon.com icon), the friendly storefront, will assist you. If
you prefer a compact heads-up-display, try the Synaptic Package Manager instead.
`apt-get install package-name` works well if you know what you're looking for,
as does apt-get source package-name for the ponderously masculine.

And, speaking of ponderous masculinity, if you retrieve source code for any of
Ubuntu's mainline packages, typically all you need to do is 'cd' into the folder
containing the top level of the source tree and then invoke the following:
 1. ./configure.sh
 (You shouldn't need to chmod u+x ./configure.sh to accomplish this.)
 2. make
 (You may need to install additional packages or correct minor errors.)
 3. sudo make install
This can be abbreviated: ./configure.sh && make && sudo make install
Beware that sudo is a potentially dangerous operation. Avoid it if unsure.
The && operator, in bash, will only execute the next command if the past command
exited with a successful status code (i.e., zero).

But I digress.

You'll occasionally want to mount your other partitions on Linux's file system,
so that you can browse the files you've stored there. With external drives this
is as simple as connecting them (watch the output of `tail -f /var/log/*` in a
console window to observe the log messages about the procedure), but partitions
on fixed disks (or others, 'cause reasons) may not be mounted automagically. So:
 mount -t fs_type -o option,option,... /dev/sd?? path/to/mount/point/
where the mount point is a directory somewhere in your file system. BTW, mounts
that occurred automatically will be on points beneath /media/your_username/.

On a dual boot Windows system, I mount -t ntfs -o ro /dev/sda3 ~/Desktop/wintmp
often because the NTFS partition is in an unsafe state and won't mount writable.
In that case, rebooting to Windows and running chkdsk /f C: from Command Prompt
with Administrative privileges will sometimes clear the dirty flag if performed
multiple times. (How many times before ntfs-3g mounts writable, seems to vary.)

When you've attached external media, via USB etc, safely remove them after use:
use the "Safely Remove" menu option in the right-click context menu in Nautilus'
sidebar (be careful not to accidentally format the disk). You can also, from a
shell (gnome-terminal), `sync && umount /dev/sdb*` (if sdb is the medium).

Now that you've got a firm foothold in Ubuntu territory, I hope you can see your
house from here 'cause Windows seems to be dying a miserable death of attrition.
Don't count it out, though: all the Linuxes are terrible at Flight Simulator.

Status? Or Update?

 

Since my last edition in March, I've been refining the design of Videlicet: a
script I hope will aid in maintenance of digital art collections.

Although I haven't yet finished work, it is near completion, as you can see in
this abridged snapshot:
 http://www.mediafire.com/file/l0mh2dac75t63wl/TK-GreatestHits-2017-06-15.zip

Presently, the only available functionality is a label-maker. Soon, it will be a
label maker with tentacles. (Full disclosure: tentacles are metaphorical in
nature, and the program is so described for the sole purpose of setting up this
joke about octo-pythons.) Hopefully the finished work will be available to you
by this July, at which time I will issue the complete edition.

In the meantime, here are some computer-related trivia.




Factual computer tidbits, each in 80 columns -- the canonical console width.
(These are with considerable reference to FOLDOC and the Jargon File.)




We say "computer" about machines these days, but it once meant one who computes.

Computer machines are a kind of difference engine. They calculate math rapidly.

The first such difference engine is attributed to Charles Babbage.

The first reprogrammable machine, however, is reputed to be the Jacquard loom.

Source code is a series of instructions telling a computer what to compute.

Source code is interpreted by a compiler that translates it to assembler code.

An electronic calculator is, in abstract, an infix notation algebra compiler.

Assemblers translate human-legible mnemonics into computers' "machine language."

Machine language, an abstraction of electrical potential (EMF), is binary code.

The Volt, defined by the IEC in 1983, is the unit of electro-motive force (EMF).

Metal oxide semiconductor field-effect transistors (MOSFETs) are logic circuits.

Logic circuits encode inverse Boolean algebra: NAND, NOR, and NOT.

Computer programming languages evolved to assembler mnemonics from machine code.

From assembler, programs further evolved to high-level language (such as C).

Very high level language (whatever that means - perhaps interpreters?) was next.

Modern computer programming reads much like calculus. (C.f. ASM = arithmetic.)

Object-oriented programming arranges data in nested structures, then computes.

Functional programming computes with nested functions, then arranges the data.

File systems are tree-like data structures encoding allocation of disk memory.

Compressed archives use something like LZMA to squeeze redundant bytes in files.

Non-volatile memory (disk space) lasts longer than volatile (RAM).

Harddisk capacity is measured in Gigabytes. They're magnetic platters or EAPROM.

Magnetic storage functions by "reading" and "writing" magnetic fields.

Electrically alterable programmable read only memory blows fuses & antifuses.

Operating systems handle tasks, as process scheduling, incidental to human use.

Mainframes ("clouds") have one central OS; the clients are dumb terminals.

Dumb terminals have no independent processing or storage capability.

Personal computers, by contrast, have processing, storage, and an OS.

Graphical user interfaces (GUIs) are the modern point-and-click metaphor.

Command line interfaces (CLIs) are the "antiquated" terminal console metaphor.

Computer networks are any set of computermachines "speaking" to one another.

Sessions are by way of protocol. The Worldwide Web uses HTTP over TCP/IP.

The Internet & WWW evolved via cookoffs: see the Requests for Comment.

Bandwidth on the Internet has increased from baud to megabytes per second.

All computing resources can be served on a network, bandwidth permitting.

^- Senator Ted Stevens' famous "series of tubes" quote was accurate, BTW.

Human interface devices are a material tool humans use to interact w/ computers.

Graphical computer displays evolved from oscilloscopes etc, to CRTs, to LCDs.

Cathode ray tubes work by shooting electrons at a phosphorescent matrix.

Modern television-size liquid crystal displays contain millions of circuits.

CPUs handle arithmetic and logic. These days, there are 4 of them on one chip.

Frequency of a CPU's oscillation is measured in Gigahertz. For example, 2.5 GHz.

The chip's clock speed (oscillation) determines how fast it computes.

All arithmetic can be computed by adding: by 1 only, too, I think.

Ones Complement and Twos Complement are binary encodings for negative numbers.

Microchips are printed circuit boards (PCBs) that execute various functions.

The chips on a mainboard are connected to one another by a bus ("omnibus bar").

Computer hardware is the aforementioned assemblage of circuit boards.

"Firmware" (between hardware & software) is on-board (on-chip?) control logic.

Computer software is some instructions compiled & ready to run: a core image.

"Bootstrapping" a computer refers to a story about a man who flew in the air.

The Basic I/O System of yore was supplanted by the Extended Firmware Interface.

Personal computer workstations are sometimes called "boxes," due to their shape.

Alan Turing's model of a finite state automaton is a supposed computer.

Emulators, or virtual machines, are also logical computers.

 

Pan Fried Programming

(Here's the update -- nothing much is new:
MLPTK: http://www.mediafire.com/file/m3u25i445lqkztb/mlptk-2016-12-16.zip
Source Highlight: http://www.mediafire.com/file/ygxb14ie94cwcuy/mlptk-src-hilite-2016-12-16.zip
Book: http://www.mediafire.com/file/vg439qruq3do90q/mlptk-book-2016-12-16.zip
)

Remedial (adj.): intended to rectify, amend, heal.
Panacea (n., myth): goddess of healing, daughter of Aesculapius.
Pansear (n.): Chili's Pokémon.

This remedial lecture will tersely cover a semester's curriculum,
similar to what you have learnt in your high school algebra class,
comprising the fundamentals of programming with synthetic languages
(those that are above machine code).

If you don't know what computer programming is, I would recommend that you study
some tutorials & encyclopedia articles. Much is available on the WWW (Worldwide
Web). The Web is a part of the Internet, and it is the Web you access from your
Web browser when you navigate to a Web page. You could also try one'a them there
"<name of programming language> For Dummies" textbooks: the "For Dummies" books
are excellent "Cliff's Notes"-style crash courses, and each aims to be similar
to a "101" course in the topic advertised.

To make a beginning with any programming language, all you must know is that a
computer computes: your instructions, issued in the program you write, tell the
machine how to progress from its input or initial state to a resultant output or
final state. These instructions look different in different languages -- some
languages require more or fewer -- but every computer program is an algorithm,
or "recipe for computation."

Computers and computer programs can be characterized as finite state automata.
They're like assembly-line robots who know where to weld each sheet of metal.
Also like assembly-line robots, they are "blind" in the sense that they'll kill
you with the soldering iron should you step between it and the sheet.
Computing machines do what they're told, even when it is particularly stupid:
that's why computer viruses, worms, and computer espionage exist.

In simplest terms, the computer's processing units receive some numbers and an
instruction that says what mathematical operation to execute, then operates:
like a calculator. High-level programming languages are more synthetic, like a
human language is, and comprise such ideas as objects (amalgamations of data) &
functions (modular sub-routines). Compilers or interpreters read these languages
and translate them into machine instructions, simplifying the lengthy series of
instructions necessary to make the calculator execute these difficult tasks.

In a high-level language, there are few technical concerns.
You can begin immediately with the abstract concepts.
Here are some:

VARIABLES
As in algebra, a variable is a name that represents a value.
As in solving a system of equations, values are typically assigned to some vars
and the value of the other variables is computed using the values given.
For example, in Javascript:
    var a = 2;
    var b = a + 2;
The variable <b> is now equal to 2 + 2. Similar operations function similarly.
In Javascript and other very-high-level languages, variables aren't only scalars
and can point at any object. They're like placeholders for procedure.
Although "variable" implies a value stored in memory, and "identifier" only its
mnemonic, the words "variable" & "identifier" used loosely mean about the same.
    "Just don't try that with the Captain."
        -- Geordi LaForge, to Data, _Star Trek: the Next Generation._

POINTERS, REFERENCES
These are important ideas that are abstracted away in VHLLs. A pointer stores an
address in memory, for a later indirect read/write or similar operation. In HLLs
a pointer/reference accesses an object directly instead of copying its value.
You'll rarely have to make the distinction in Javascript; but, for example:
    var a = new Array(1, 2, 3); // a[0] == 1, a[1] == 2, a[2] == 3
    var b = a; // Incidentally, b === a, and that is why in the next line...
    b[0] = 555; // ... b[0] == 555, and now a[0] also == 555!
As opposed to:
    var c = new Array(3); // c is a new array of length 3
    c[0] = b[0]; c[1] = b[1]; c[2] = b[2]; // copy scalar values one-by-one
    c[0] = 0; // c[0] == 0, but b[0] remains == a[0], which remains == 555.
    var d = 2;
    var e = d;
    e = 4; // e == 4, but d is still == 2.
As you can see, operating on an object (such as via array subscript operation)
changes the object, even if the object is pointed by multiple variables.
Likewise, objects passed as the argument of a function are passed by reference:
they aren't simply copied, and operating on the argument within the function is
equivalent to changing the object, whose scope is above that of the function.
Some high-level languages, like C, permit you to explicitly specify what is a
pointer or reference, which eliminates some of this confusion but requires more
exacting attention to detail in your design specification.

STATE
The state of a program is the value of all its variables, the current location
within the instruction set, and the environment of the operating system (or the
interpreter). In Javascript, within Web browsers, the browser typically provides
access to some of its state via the Document Object Model.

CONDITIONAL EXECUTION
Heuristics, or "guesswork," could not exist if there were no way to execute some
different code depending on the state of the program. Furthermore there are some
mathematics you can't write as exactly one set of instructions that produces one
semantic value: for instance, a function defined only on an interval, or an even
root of a positive number. In this circumstance, you are writing branches:
    if (5 > 10) { /* of course, the code in this block never happens. */ }
    else if (2 < 0) { /* neither does this, b/c cond'n is also false. */ }
    else { /* but all of this code happens, because the others didn't. */ }
... One of the branches executes, and the others don't.
The part in parentheses is the "conditional statement:" it's evaluated as either
"true" or "false," like in Boolean logic. 

SCOPE
Identifiers are only valid within the block (curly brackets, or { ... }) where
they were declared. Well, they're supposed to, anyway. Therefore, if you declare
a variable inside a function, you can't use it outside of the function or within
another function. Why would you want to, anyway? The next time you invoked the
function, the value of the variables you were using in there would change again.

LOOPS
Computers are great at repetition. Loops repeat a set of instructions: they are
typically written as a prefix, conditional, postfix, and body. For example:
    for (var T = 10; T > 0; T--) { alert("T minus " + T); }
... which counts down from ten to one with annoying alert popups.
While or do-while loops have only conditions & bodies.
A loop is an example of an "iterative algorithm." Each time the loop's body is
executed, it's called an "iteration." In computing fractal geometric patterns,
"iteration" means more like "recursion:" which, see below.

FUNCTIONS
A function is a modular segment of your program: a sequence of computation that
is repeated a few times, or can be reused as part of another computation.
Functions are "invoked," or called by name, with values supplied as arguments,
and return a value, similarly to how functions behave in algebra. When declaring
a function, you'd typically write the name of the function followed by its args
in parentheses and then the function body. For example, again in Javascript:
    function intp (N) { return (N % 1) == 0; } // integer predicate
... which returns true if N is probably an integer, or whole number:
    if (intp(5)) { alert("Yes. 5 is probably an integer."); }
    if (intp(5.55)) { alert("This box never appears..."); }
    else { alert("... but this one does, because 5.55 is a floater."); }
(Floating-point numbers are inaccurate, in Javascript as likewise elsewhere.)

RECURSION
A function that invokes itself is a recursive function. Any function invoking an
other function, which subsequently causes the original function to be invoked
again, causes a recursion-like situation that I think is called "re-entrancy."
It is essential to note that _any_ and _every_ recursive function you can write
for a computer to execute can be rewritten as an iterative algorithm. The proof
of this is complex: it follows from Alan Turing's model of finite state automata
and the read-execute model of arithmetic and logic units (CPUs), and basically
asserts that you'd never be able to execute recursion if you couldn't do it by
reading one instruction at a time. In other words, each time your function calls
itself again, it's simply storing its state in memory temporarily while the
machine executes a fresh copy: after the copy is done, the former state is re-
loaded, and execution proceeds from there. This is achieved with stacks: data
structures that grow in size as more is "pushed" onto them, and shrink when some
is "popped" off of the top.

OBJECTS
An object is a collection of data that comprises a several datum. That is, when
data are related to one another, they can be envisioned as a "shape" or "motion"
that is the sum of its parts. For example, a vector has direction and magnitude;
an individual has a first and last name; a parser has an input stream, a stack,
and a procedure. In Javascript, you'd write something like this:
    function Blah (newz) { if (newz) { this.z = newz; } return this; }
    Blah.prototype = new Object();
    Blah.prototype.z = 555;
    Blah.prototype.tell_me_z = function () { return this.z; }
    var a = new Blah(222), b = new Blah(); // a.z == 222; b.z = 555.
... syntax varies among languages. Essentially an object is a data structure
containing some members ("variables" attached to the object, like Blah::z above)
and, if the object is a class, some methods (functions, like ::tell_me_z).

Overview of LR Parsers.

Hi. I'm Troy McClure.

... Oh, wait. He was a character on The Simpsons. Who was I, again?

Ah. I remember now. I'm Thor King: the author of MLPTK.
If you'd like to acquaint yourself with my work, you can find it @ the following Mediafire URL for as long as Mediafire will host me and my download cap holds:

(elder archive removed to make room for the new one. See top of next post at https://ipduck.wordpress.com/2016/02/16/of-stack-state/)

If you can't access it, then write to me at 1433 Flannigan Creek Road, Viola,
ID 83872, and I'll endeavor to send you a CD or hard copy. Please do not send
money; parcels sometimes "mysteriously" do not arrive at my mailbox. Or simply
wait for the next time I refresh the archive at Mediafire. That's likely to be
sooner than I could send a copy by postal mail, but I'll try if you want.

Unlike my prior development snapshots of my software, some parental discretion
is advised for this one because of the pop-up graphic when the user moves his
or her mouse pointer over the Hiragana "Fu" near the top of the page.
If your parents aren't discrete, then how in blazes are there two of them?



My lecture today shall advise you in regard to the theory & practice of writing
LALR (lookahead, left-to-right) parsers. This problem set is essentially
solved by the excellent Flex and Bison (or Lex and Yacc), which are part of the
Free Software Foundation's GNU toolset & available on POSIX-compliant operating
systems such as Linux, Unix, and MacOS 10 and greater; these are written in the
C programming language, but you can write your own easily in any language once
you understand the mathematical principles that underpin the technology.

Please be aware that I might not accurately understand some of the theory.
Seek other sources if you're really interested.

A parser is a computer program that executes instructions corresponding to its
input. That is, it is a reprogrammable program, or a program that writes other
programs. Parsers are ubiquitous throughout the field of computer science, and
necessary in the computation of any algorithm that must alter its behavior
significantly over a large input domain: for example, programming languages,
network protocols, and interprocess communication. A reliable parser, such as
the GNU utilities I mentioned above, is mathematically verified and saves a lot
of debugging, especially when an existing schematic must be altered.

Parsers are finite state automata: the fundamental theorem of computer science.
For more information, see "Turing machine" at Wikipedia. Also of interest are
CPU chip set architecture, circuitry, logical and memory gates, MOSFETs (metal
oxide semiconductor ferroelectric transistors), Boolean logic, assembly code &
instruction sets (especially Intel 80x86 and extensions), lexers / scanners,
GLR parsers, Regular Expressions, POSIX & the Single Unix Specification, and any
patents in regard to computer technology that you can dig up at a patent office.

The phrase "computer programming" implies that the programmer literally issues
instructions directly to the machine. Indeed, parsers can do this for you, too;
but compiler design is beyond the scope of my comprehension as yet. Instead, I
shall treat of how to write an interpreter generator. Yet again and again: the
necessary work _has_ already been done for you, via Flex and Bison. I'll write
as though you're designing a similar kind of parser, so that you know exactly
how much work you can save yourself by using the industry standard technology.

An interpreter executes high-level instructions as the input is being consumed,
unlike a compiler which assembles machine instructions to be executed later. A
machine instruction is a sequence of electrical impulses, usually represented as
binary code, that specifies the operation of a logic circuit such as a CPU. The
x86 instruction set; which operated the Intel x86, Pentium, and Pentium II; was
widely in use for decades. Windows included a tool named 'debug', for use within
the MS-DOS prompt, that permitted the owner of the operating system to write in
this language and execute the results without installing anything extra.
In 2016, x86 remains a common instruction set.

The reason to write an interpreter is basically: to build a data structure.
A Bison-like parser is not necessary to achieve this end, but can significantly
reduce the time necessary to specify the protocol or structure format. If you'd
imagine the task of programming to be similar to the art of illustration, then
your program iterates through several design phases: alpha (storyboard sketch),
beta (concept sketch), maintenance (outline inking), more maintenance (shading),
even more maintenance (coloring), and finished work (touch-ups etc), throughout
a duration spanning some years. Before you commit to any such tedious procedure,
you might like to gather some idea of how the finished work will look; that is
what sketching is all about, and similarly shading the inked illustration. The
right parser can get your "sketch" on "canvas" with much greater efficiency.

The standard parser technology is the LR parser; a finite state automaton that
describes how to read data from the beginning, combine tokens (pieces of data)
into sequences as they are encountered, combine the sequences to progressively
more complex sequences by computing the semantic value of each sequence and
representing that value as a token, then finally arrive at a solitary token that
signifies a complete program or data structure. The canonical example is Bison.
The full specification of the Bison Parser Algorithm (©) is available in texinfo
format from the Ubuntu repository, from the Free Software Foundation, and from
any of the many fine establishments where GNU is served daily.

LR parsers read tokens one at a time, either shifting them onto a parse stack or
reducing a sequence on the stack from multiple tokens to one. When a sequence is
reduced, a new semantic value is computed and stored in the token it reduced to.
	1. Read one token, which is the lookahead token; the former lookahead token
	   becomes the working token.
	2. If the lookahead token is an operator with higher precedence than the
	   last operator encountered, start a new sequence.
	3. If the working token proceeds from the foregoing sequence, shift it onto
	   the sequence in progress.
	4. Otherwise, if the sequence reduces, then pop the sequence and unshift the
	   reduced token back onto the input stream.
	5. Otherwise, block the sequence in progress and wait for a new sequence at
	   the working token to reduce to the token the blocked sequence expects.
Simple.

Sort of. In order to know how the sequences progress, it's necessary to encode
a data structure that maps the steps between beginning and end. To do this, you
must write a parser that parses the rules that tell the LR parser what to do.
Technically Bison does this too, although the data structure that represents the
parsed rules is later discarded, because the "structure" is flattened-out into a
block of static code. You aren't writing your parser anew each time you make an
alteration to its grammar; the parser generator is writing the parser, given the
rules you specified in the grammar; so you have to write something that converts
the rules (which, for your sanity's sake, were written in something approaching
a user-friendly language) to a data structure that encodes the parser state at
each possible step through its input sequence.

This can be accomplished by writing a tree / treelike structure, where each node
contains forward links to the next parser state(s) and these links are keyed on
the identifier of the token that was read-in next from that state. Then the data
structure is flattened into static code; or, in my case, a flatter structure.
The parser's state map describes what happens when the next token is consumed;
mapping each possible configuration of the automaton's state data hasn't to do
with instructions executed while it operates; it is motive, not motion.

Then write a tokenizer, which converts the input data to a set of named tokens.
Really this can be made part of the parsing step; but it costs practically no
time to specify the tokenizer separately, which is modular and aids maintenance.
A tokenizer can be a scanner, like Flex, which recognizes patterns in data. Or
it could be any algorithm whose output conforms to the parser's input format. If
the data is already tokenized, or formed in such manner as the parser mustn't
need any assistance to understand it, tokenization is unnecessary; although you
might reformat the data slightly or alter some tokens before parsing them.

Tokenize the input and feed it to the parser which executes the above algorithm.
During the parse phase, additional computations are performed by the subroutines
you specified to compute the semantic values of token reductions. Afterward, you
have either executed your program or built a data structure to execute it later.



Now that you have sunk the foundation of the idea, let's cover it in concrete.



Using MLPTK as a debugging console, I have written a manuscript that I named
"Quadrare Lexema," which reads "to square the words." In fact, because the QL
library shall eventually form the backbone of a major overhaul of MLPTK's CLI,
and because the sacral pelvic articulation does conjoin the dorsal vertebrae,
my new experiment is the demonstrative proof that it is hip to be square.

If you would kindly accept my profuse contrition for spending an entire lecture
to set up that joke; I shall, throughout the next few posts, walk you through QL
and explain more-or-less exactly what it is doing. I plan to write them by June.