Wednesday, February 22, 2012

An Experiment In HTML Typesetting, Part II

Awhile ago I wrote about my dissatisfaction with HTML typesetting and an experiment I was undertaking to see if the process could be made less painful. Fast-forward several months and I'm halfway there, having developed a machine-friendly grammar for MA notation and an encapsulating file format to go with it.

Recall that the overriding concern was easy-of-production; input files in this hypothetical system are always going to be written by hand. As such the goal was to add just enough structure so that a computer could do the basic job of translating the file into an abstract syntax tree. I believe that I've accomplished this goal, but the resulting file format is something of a Frankenstein's monster. I chose XML to provide the overall structure of the document since it's easy for both computers and humans to read and is relatively lightweight. This framework encapsulates a bunch of plain-text strings plus two types of specialized blocks, one of which uses a simple key-value scheme and the other which uses a full-blow LR grammar. Processing this file results in an AST which can then be used as input for arbitrary typesetting scripts.

The processing bits are implemented as a few Perl modules, plus I've thrown in a sample input file and a wrapper script to dump the resulting AST. Here are the goods:

The script can be invoked as example.xml, which will dump the AST to STDOUT.

Stay tuned for Part III where I'll turn the AST into actual HTML.

Monday, February 13, 2012

C'Mon Mike, You Can Do Better Than That

(Via Hullabaloo) Mike Konczal has dredged up Ludwig von Mises' Socialism as evidence that libertarians are against contraception and sexual autonomy for women. For the love of god the book is nearly 90 years old; surely he can come up with something more recent to support his case? In rejoinder I offer the following, slightly-more-contemporary tidbits from Reason Online:

Libertarians really don't seem to be jumping into bed with the Catholic church on this one. I thought it was pretty much accepted dogma that libertarian permissiveness w.r.t. sexual activity pisses off conservatives to no end.

On a more general note it's hard to square Konczal's contentions that libertarians are against female autonomy with their overwhelming support of LGBT rights in general and gay marriage in particular. If libertarians really wanted women to be subservient to men why would they so vigorously support institutions that can remove men from the picture entirely?

Lastly, I'll add my own (admittedly idiosyncratic) view that Von Mises isn't a libertarian no matter how many times people call him one. He's a consequentialist who beileves that libertarian policies produce the best social outcome and, as such, shouldn't be used as an examplar of libertarian thought.

Blog Information Profile for gg00