"Give Me That NP-Time Religion."
"What was Good Enough For Granddad is Good Enough For Me."
"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:
for certain runtime code such as Firefox's ill fated tab gallery.
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.
Where: Dynamic HTML pages for the Worldwide Web. In-browser apps like my MLPTK.
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."
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.
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.
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.
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.
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!"
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.
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.)
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.)
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.
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
just about the end of the line for the casually-scraping archivist.
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.
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.)
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.
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.
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.