« June 2014 | Main | August 2014 »

Thursday, July 31, 2014

Reading List: Conversations with My Agent (and Set Up, Joke, Set Up, Joke)

Long, Rob. Conversations with My Agent (and Set Up, Joke, Set Up, Joke). London: Bloomsbury Publishing, [1996, 2005] 2014. ISBN 978-1-4088-5583-6.
Hollywood is a strange place, where the normal rules of business, economics, and personal and professional relationships seem to have been suspended. When he arrived in Hollywood in 1930, P. G. Wodehouse found the customs and antics of its denizens so bizarre that he parodied them in a series of hilarious stories. After a year in Hollywood, he'd had enough and never returned. When Rob Long arrived in Hollywood to attend UCLA film school, the television industry was on the threshold of a technology-driven change which would remake it and forever put an end to the domination by three large networks which had existed since its inception. The advent of cable and, later, direct to home satellite broadcasting eliminated the terrestrial bandwidth constraints which had made establishing a television outlet forbiddingly expensive and, at the same time, side-stepped many of the regulatory constraints which forbade “edgy” content on broadcast channels. Long began his television career as a screenwriter for Cheers in 1990, and became an executive producer of the show in 1992. After the end of Cheers, he created and produced other television projects, including Sullivan & Son, which is currently on the air.

Television ratings measure both “rating points”: the absolute number of television sets tuned into the program, and “share points”: the fraction of television sets turned on at the time viewing the program. In the era of Cheers, a typical episode might have a rating equivalent to more than 22 million viewers and a share of 32%, meaning it pulled in around one third of all television viewers in its time slot. The proliferation of channels makes it unlikely any show will achieve numbers like this again. The extremely popular 24 attracted between 9 and 14 million viewers in its eight seasons, and the highly critically regarded Mad Men never topped a mean viewership of 2.7 million in its best season.

It was into this new world of diminishing viewership expectations but voracious thirst for content to fill all the new channels that the author launched his post-Cheers career. The present volume collects two books originally published independently, Conversations with My Agent from 1998, and 2005's Set Up, Joke, Set Up, Joke, written as Hollywood's перестро́йка was well-advanced. The volumes fit together almost seamlessly, and many readers will barely notice the transition.

This is a very funny book, but there is also a great deal of wisdom about the ways of Hollywood, how television projects are created, pitched to a studio, marketed to a network, and the tortuous process leading from concept to script to pilot to series and, all too often, to cancellation. The book is written as a screenplay, complete with scene descriptions, directions, dialogue, transitions, and sound effect call-outs. Most of the scenes are indeed conversations between the author and his agent in various circumstances, but we also get to be a fly on the wall at story pitches, meetings with the network, casting, shooting an episode, focus group testing, and many other milestones in the life cycle of a situation comedy. The circumstances are fictional, but are clearly informed by real-life experience. Anybody contemplating a career in Hollywood, especially as a television screenwriter, would be insane not to read this book. You'll laugh a lot, but also learn something on almost every page.

The reader will also begin to appreciate the curious ways of Hollywood business, what the author calls “HIPE”: the Hollywood Inversion Principle of Economics. “The HIPE, as it will come to be known, postulates that every commonly understood, standard business practice of the outside world has its counterpart in the entertainment industry. Only it's backwards.” And anybody who thinks accounting is not a creative profession has never had experience with a Hollywood project. The culture of the entertainment business is also on display—an intricate pecking order involving writers, producers, actors, agents, studio and network executives, and “below the line” specialists such as camera operators and editors, all of whom have to read the trade papers to know who's up and who's not.

This book provides an insider's perspective on the strange way television programs come to be. In a way, it resembles some aspects of venture capital: most projects come to nothing, and most of those which are funded fail, losing the entire investment. But the few which succeed can generate sufficient money to cover all the losses and still yield a large return. One television show that runs for five years, producing solid ratings and 100+ episodes to go into syndication, can set up its writers and producers for life and cover the studio's losses on all of the dogs and cats.

Posted at 22:15 Permalink

Wednesday, July 30, 2014

Reading List: Robert A. Heinlein: In Dialogue with His Century. Vol 1

Patterson, William H., Jr. Robert A. Heinlein: In Dialogue with His Century. Vol. 1 New York: Tor Books, 2010. ISBN 978-0-7653-1960-9.
Robert Heinlein came from a family who had been present in America before there were the United States, and whose members had served in all of the wars of the Republic. Despite being thin, frail, and with dodgy eyesight, he managed to be appointed to the U.S. Naval Academy where, despite demerits for being a hellion, he graduated and was commissioned as a naval officer. He was on the track to a naval career when felled by tuberculosis (which was, in the 1930s, a potential death sentence, with the possibility of recurrence any time in later life).

Heinlein had written while in the Navy, but after his forced medical retirement, turned his attention to writing science fiction for pulp magazines, and after receiving a cheque for US$ 70 for his first short story, “Life-Line”, he exclaimed, “How long has this racket been going on? And why didn't anybody tell me about it sooner?” Heinlein always viewed writing as a business, and kept a thermometer on which he charted his revenue toward paying off the mortgage on his house.

While Heinlein fit in very well with the Navy, and might have been, absent medical problems, a significant commander in the fleet in World War II, he was also, at heart, a bohemian, with a soul almost orthogonal to military tradition and discipline. His first marriage was a fling with a woman who introduced him to physical delights of which he was unaware. That ended quickly, and then he married Leslyn, who was his muse, copy-editor, and business manager in a marriage which persisted throughout World War II, when both were involved in war work. Leslyn worked herself in this effort into insanity and alcoholism, and they divorced in 1947.

It was Robert Heinlein who vaulted science fiction from the ghetto of the pulp magazines to the “slicks” such as Collier's and the Saturday Evening Post. This was due to a technological transition in the publishing industry which is comparable to that presently underway in the migration from print to electronic publishing. Rationing of paper during World War II helped to create the “pocket book” or paperback publishing industry. After the end of the war, these new entrants in the publishing market saw a major opportunity in publishing anthologies of stories previously published in the pulps. The pulp publishers viewed this as an existential threat—who would buy a pulp magazine if, for almost the same price, one could buy a collection of the best stories from the last decade in all of those magazines?

Heinlein found his fiction entrapped in this struggle. While today, when you sell a story to a magazine in the U.S., you usually only sell “First North American serial rights”, in the 1930s and 1940s, authors sold all rights, and it was up to the publisher to release their rights for republication of a work in an anthology or adaptation into a screenplay. This is parallel to the contemporary battle between traditional publishers and independent publishing platforms, which have become the heart of science fiction.

Heinlein was complex. While an exemplary naval officer, he was a nudist, married three times, interested in the esoteric (and a close associate of Jack Parsons and L. Ron Hubbard). He was an enthusiastic supporter of Upton Sinclair's EPIC movement and his “Social Credit” agenda.

This authorised biography, with major contributions from Heinlein's widow, Virginia, chronicles the master storyteller's life in his first forty years—until he found, or created, an audience receptive to the tales of wonder he spun. If you've read all of Heinlein's fiction, it may be difficult to imagine how much of it was based in Heinlein's own life. If you thought Heinlein's later novels were weird, appreciate how the master was weird before you were born.

I had the privilege of meeting Robert and Virginia Heinlein in 1984. I shall always cherish that moment.

Posted at 02:27 Permalink

Sunday, July 27, 2014

Reading List: The Guns of August

Tuchman, Barbara W. The Guns of August. New York: Presidio Press, [1962, 1988, 1994] 2004. ISBN 978-0-345-47609-8.
One hundred years ago the world was on the brink of a cataclysmic confrontation which would cause casualties numbered in the tens of millions, destroy the pre-existing international order, depose royalty and dissolve empires, and plant the seeds for tyrannical regimes and future conflicts with an even more horrific toll in human suffering. It is not exaggeration to speak of World War I as the pivotal event of the 20th century, since so much that followed can be viewed as sequelæ which can be traced directly to that conflict.

It is thus important to understand how that war came to be, and how in the first month after its outbreak the expectations of all parties to the conflict, arrived at through the most exhaustive study by military and political élites, were proven completely wrong and what was expected to be a short, conclusive war turned instead into a protracted blood-letting which would continue for more than four years of largely static warfare. This magnificent book, which covers the events leading to the war and the first month after its outbreak, provides a highly readable narrative history of the period with insight into both the grand folly of war plans drawn up in isolation and mechanically followed even after abundant evidence of their faults have caused tragedy, but also how contingency—chance, and the decisions of fallible human beings in positions of authority can tilt the balance of history.

The author is not an academic historian, and she writes for a popular audience. This has caused some to sniff at her work, but as she noted, Herodotus, Thucydides, Gibbon, and MacCauley did not have Ph.D.s. She immerses the reader in the world before the war, beginning with the 1910 funeral in London of Edward VII where nine monarchs rode in the cortège, most of whose nations would be at war four years hence. The system of alliances is described in detail, as is the mobilisation plans of the future combatants, all of which would contribute to fatal instability of the system to a small perturbation.

Germany, France, Russia, and Austria-Hungary had all drawn up detailed mobilisation plans for assembling, deploying, and operating their conscript armies in the event of war. (Britain, with an all-volunteer regular army which was tiny by continental standards, had no pre-defined mobilisation plan.) As you might expect, Germany's plan was the most detailed, specifying railroad schedules and the composition of individual trains. Now, the important thing to keep in mind about these plans is that, together, they created a powerful first-mover advantage. If Russia began to mobilise, and Germany hesitated in its own mobilisation in the hope of defusing the conflict, it might be at a great disadvantage if Russia had only a few days of advance in assembling its forces. This means that there was a powerful incentive in issuing the mobilisation order first, and a compelling reason for an adversary to begin his own mobilisation order once news of it became known.

Compounding this instability were alliances which compelled parties to them to come to the assistance of others. France had no direct interest in the conflict between Germany and Austria-Hungary and Russia in the Balkans, but it had an alliance with Russia, and was pulled into the conflict. When France began to mobilise, Germany activated its own mobilisation and the Schlieffen plan to invade France through Belgium. Once the Germans violated the neutrality of Belgium, Britain's guarantee of that neutrality required (after the customary ambiguity and dithering) a declaration of war against Germany, and the stage was set for a general war in Europe.

The focus here is on the initial phase of the war: where Germany, France, and Russia were all following their pre-war plans, all initially expecting a swift conquest of their opponents—the Battle of the Frontiers, which occupied most of the month of August 1914. An afterword covers the First Battle of the Marne where the German offensive on the Western front was halted and the stage set for the static trench warfare which was to ensue. At the conclusion of that battle, all of the shining pre-war plans were in tatters, many commanders were disgraced or cashiered, and lessons learned through the tragedy “by which God teaches the law to kings” (p. 275).

A century later, the lessons of the outbreak of World War I could not be more relevant. On the eve of the war, many believed that the interconnection of the soon-to-be belligerents through trade was such that war was unthinkable, as it would quickly impoverish them. Today, the world is even more connected and yet there are conflicts all around the margins, with alliances spanning the globe. Unlike 1914, when the world was largely dominated by great powers, now there are rogue states, non-state actors, movements dominated by religion, and neo-barbarism and piracy loose upon the stage, and some of these may lay their hands on weapons whose destructive power dwarf those of 1914–1918. This book, published more than fifty years ago, about a conflict a century old, could not be more timely.

Posted at 22:49 Permalink

Thursday, July 24, 2014

Floating Point Benchmark: Lua Language Added

I have posted an update to my trigonometry-intense floating point benchmark which adds Lua to the list of languages in which the benchmark is implemented. A new release of the benchmark collection including Lua is now available for downloading.

Lua was developed with the intention of being a small-footprint scripting language which could be easily embedded in applications. Despite this design goal, which it has achieved superbly, being widely adopted as the means of extensibility for numerous games and applications, it is a remarkably sophisticated language, with support for floating point, complex data structures, object oriented programming, and functional programming. It is a modern realisation of what I attempted to achieve with Atlast in 1990, but with a syntax which most programmers will find familiar and a completely memory-safe architecture (unless compromised by user extensions). If I were developing an application for which I needed scripting or user extensibility, Lua would be my tool of choice, and in porting the benchmark to the language I encountered no problems whatsoever—indeed, it worked the first time.

The relative performance of the various language implementations (with C taken as 1) is as follows. All language implementations of the benchmark listed below produced identical results to the last (11th) decimal place.

Language Relative
Time
Details
C 1 GCC 3.2.3 -O3, Linux
Visual Basic .NET 0.866 All optimisations, Windows XP
FORTRAN 1.008 GNU Fortran (g77) 3.2.3 -O3, Linux
Pascal 1.027
1.077
Free Pascal 2.2.0 -O3, Linux
GNU Pascal 2.1 (GCC 2.95.2) -O3, Linux
Java 1.121 Sun JDK 1.5.0_04-b05, Linux
Visual Basic 6 1.132 All optimisations, Windows XP
Haskell 1.223 GHC 7.4.1-O2 -funbox-strict-fields, Linux
Ada 1.401 GNAT/GCC 3.4.4 -O3, Linux
Go 1.481 Go version go1.1.1 linux/amd64, Linux
Simula 2.099 GNU Cim 5.1, GCC 4.8.1 -O2, Linux
Lua 2.515
22.7
LuaJIT 2.0.3, Linux
Lua 5.2.3, Linux
Python 2.633
30.0
PyPy 2.2.1 (Python 2.7.3), Linux
Python 2.7.6, Linux
Erlang 3.663
9.335
Erlang/OTP 17, emulator 6.0, HiPE [native, {hipe, [o3]}]
Byte code (BEAM), Linux
ALGOL 60 3.951 MARST 2.7, GCC 4.8.1 -O3, Linux
Lisp 7.41
19.8
GNU Common Lisp 2.6.7, Compiled, Linux
GNU Common Lisp 2.6.7, Interpreted
Smalltalk 7.59 GNU Smalltalk 2.3.5, Linux
Forth 9.92 Gforth 0.7.0, Linux
COBOL 12.5
46.3
Micro Focus Visual COBOL 2010, Windows 7
Fixed decimal instead of computational-2
Algol 68 15.2 Algol 68 Genie 2.4.1 -O3, Linux
Perl 23.6 Perl v5.8.0, Linux
Ruby 26.1 Ruby 1.8.3, Linux
JavaScript 27.6
39.1
46.9
Opera 8.0, Linux
Internet Explorer 6.0.2900, Windows XP
Mozilla Firefox 1.0.6, Linux
QBasic 148.3 MS-DOS QBasic 1.1, Windows XP Console

The performance of the reference implementation of Lua is comparable to other scripting languages which compile to and execute byte-codes, such as Perl, Python, and Ruby. Raw CPU performance is rarely important in a scripting language, as it is mostly used as “glue” to invoke facilities of the host application which run at native code speed.

Update: I have added results in the above table for the benchmark run under the LuaJIT just-in-time compiler for Lua, generating code for the x86_64 architecture. This runs almost ten times faster than the standard implementation of Lua and is comparable with other compiled languages. The benchmark ran without any modifications on LuaJIT.

I have also added results from running the Python benchmark under the PyPy just-in-time compiler for Python. Again, there was a dramatic speed increase, vaulting Python into the ranks of compiled languages. Since the Python benchmark was last run with the standard implementation of Python in 2006, I re-ran it on Python 2.7.6 and found, compared to C on an x86_64 architecture, to be substantially slower. I do not know whether this is due to better performance in C code, worse performance in Python, or due to changes in machine architecture compared to the 32-bit system on which the benchmark was run in 2006. (2014-07-26 22:25 UTC)

Posted at 22:32 Permalink

Wednesday, July 16, 2014

Atlast 2.0 (64-bit) Released

I have just posted the first update to Atlast since 2007. Atlast is a FORTH-like language toolkit intended to make it easy to open the internal facilities of applications to users, especially on embedded platforms with limited computing and memory resources.

Like FORTH, Atlast provides low-level access to the memory architecture of the machine on which it runs, and is sensitive to the length of data objects. The 1.x releases of Atlast assume integers and pointers are 32 bit quantities and floating point numbers are 64 bit, occupying two stack items. This assumption is no longer the case when building programs in native mode on 64-bit systems: integers, pointers, and floating point values are all 64 bits.

Release 2.0 of Atlast is a dedicated 64-bit implementation of the language. If you are developing on a 64-bit platform and are confident you will only target such platforms, it provides a simpler architecture (no need for double word operations for floating point) and a larger address space and integers. This comes at the cost of loss of source code compatibility with the 32-bit 1.x releases, particularly for floating point code. If your target platform is a 32-bit system and your development machine is 64-bit, it's best to use version 1.2 (which is functionally identical to 2.0), cross-compiled as 32-bit code. If you don't use floating point or do low-level memory twiddling, it's likely your programs will work on both 32- and 64-bit versions.

Although Atlast includes comprehensive pointer and stack limit checking, it is not memory-safe, and consequently I do not encourage its use in modern applications. When it was originally developed in the late 1980s, its ability to fit in a small memory footprint was of surpassing importance. With the extravagant memory and compute power of contemporary machines, this is less important and other scripting languages which are both entirely safe and less obscure in syntax will usually be preferable. Still, some people working with embedded systems very close to the hardware continue to find Atlast useful, and this release updates it for 64-bit architectures.

The distribution archive has been re-organised in 2.0, collecting the regression test, examples from the user manual, and benchmarks in subdirectories. An implementation of my floating point benchmark is included among the examples.

Posted at 23:56 Permalink