July 2006

Concurrent Programming in Erlang, by J. Armstrong, R. Virding, C. Wikström, and M. Williams

I’ve been mostly ignoring gaming and technical books for these reviews
before now, but I think the new format may let me range more broadly.

Concurrent Programming in Erlang is one of few books available
documenting the functional language Erlang. Erlang is a development
of Ericsson, used for programming some of their highly reliable
telephone switches. It’s unusual in that it approaches concurrency
not by Posix or Java-style threads sharing state, but by passing of
messages between threads. Issues of locking and mutexes evaporate.
As a side effect, Erlang’s threads are very lightweight: a typical
workstation can spawn tens of thousands of simultaneous threads
without performance degradation. Try having 25000 Linux pthreads all
reading and writing to the network some time and see what happens!

Erlang isn’t my preferred language, though, and this book couldn’t
make it so. The syntax is odd, even for me. And the libraries are
oriented very strongly towards networks and concurrency. There’s not
much support for GUIs or interesting data structures (but see
Mnesia). This is a great language for systems programming for
comms companies, but not so great for hobbyist researchers.

You can read the first half of this book for free at
http://www.erlang.org/download/erlang-book-part1.pdf. Since the
second half is only a set of case studies of interesting applications,
casual readers are likely to miss it very little.

Books read this year: 24

books

Comments (0)

Permalink

Rainbows End, by Vernor Vinge

In A Fire Upon the Deep, Vinge perfectly pegged the conversational
trends of the Usenet. Fifteen years later, he’s hit instant messaging
culture right on the head. Along the way, he presents a tour of a
world in the elbow of the singularity, and a coming-of-age story for a
man who almost ran out of time.

I’d like to avoid spoilers, which prevents my discussing more than a
cursory outline of the plot: too much is involved with who’s
pretending to be whom. It does become clear that Vinge is a major
Pratchett fan, and has read at least a little of Dewey.

Far less is resolved than in Fire: the end is very ambiguous.
There, and at more than a few points along the way, this reminds me of
Charles Stross in Accelerando: similar presentation of a world where
generation gaps emphasize the repeated occurrence of the singularity.
I suspect that’s an artifact of my ordering, and that Stross should
have been reminding me of Vinge for some time.

Books read this year: 23

books

Comments (0)

Permalink

Storm Front, by Jim Butcher

Some MITSFS residents reacted to my not having read Storm Front the
way I reacted to someone who’d never read anything by Asimov.
Apparently the Dresden Files series has become quite popular. I
think Glen Cook’s cover blurb sums it up well: "I wish I’d thought of
this."

I’m not sure Dresden Files does bear comparison to Cook’s own Garrett
Files. There’s more character development than in any one of Cook’s
stories, but I haven’t seen enough of Harry Blackstone Copperfeld
Dresden to compare him to the Garrett of nine books. The clearest
comparison in my mind is to Laurel K. Hamilton’s Anita Blake
books—there’s even structural similarity to her first book, Guilty
Pleasures
. The universe is intriguing, and if Butcher explores the
Nevernever more deeply in later books, it’ll be worth following.

Books read this year: 22

books

Comments (0)

Permalink

The Tyrant, by Eric Flint and David Drake

I read this book through the Baen Free Library. I had no idea
that it was a distant sequel to a seven-book series; as far as I could
tell, it stood alone with ideas similar to that of the same authors
Belisarius books. It’s a fun read, and works well on the tiny
screen of my preferred reader.

As to the plot? It’s Baen. We can tell these soldiers are good,
moral men because they built fortifications every night. We can tell
this is a Virtuous Roman because he liberates the women in his life,
who become strong warrior maids. This is brain candy—as sweet to a
fan of old Rome as Mercedes Lackey is to a 14-year-old. I do like
this brain candy, though. It’s nice to imagine how Rome might have
fared if Caesar had the benefit of an omniscient battle computer.

My biggest disappointment with this book is that they never answer the
larger question: did the Republic have to fall? In an age of
corruption and tyrants, must good men abandon even representative
democracy and appoint a Tyrant? Or, if you have an omniscient battle
computer and Raj Whitehall, can you do any better?

Books read this year: 21

books

Comments (0)

Permalink

500 Years After, by Steven Brust

This is a much more enjoyable book for me than Phoenix Guards.
Perhaps it’s the more somber tone—I was warned that this one was
"less fun." But I suspect it’s the prequel aspect. I’ve read and
internalized a bunch of the rest of the Dragaeran universe, and this
was where it all began. Sure, Jenoine and 17 cycles of Empire… but
Adron’s Disaster is what began the real Imperium, Vlad Taltos’s
Imperium.

It’s not real Dumas. It’s a closer fit than Joel Rosenberg’s "Not…"
offshoot from the Guardians of the Flame series, but it’s not that
close a fit. So I can’t recommend this to those looking for a Dumas
fix. You’ll have to make do with the real thing. But for a fan—a
dedicated geek with an eye on the series’ continuity—it’s a
wonderful addendum to the Jhereg books. It’s nice to have met Adron,
and it puts Aliera’s line in Issola in context.

Books read this year: 20

books

Comments (0)

Permalink

California Free State, anyone?

Tony Blair and Arnold Schwarzenegger met today to discuss California
linking into the international CO_2 emissions-trading scheme.
Sounds like someone was missing.

NPR said that a "schedule issue" kept a White House representative
away from the talks… right.
So how long is it before California breaks away? Will Texas really let
someone else leave, and lose their break-away reputation?
Only time (and Shadowrun or Heinlein chronologies) will tell.

katallen

Comments (0)

Permalink

Copying and updating a tree

What’s the fastest way to copy a tree-like data structure, while
updating the copy using an unsorted alist mapping from pointers to old
values to new values? A colleague showed up with the naïve
answer, copying the tree and, at each cell looking it up in the old
list. If found, copy the new value instead of the old value. This
has running time O(m n log n): n log n to crawl the tree,
and m to read the whole list at each element.

Coaxing her through what was making this suck, we came up with
pre-sorting the list. Now it’s faster to do each lookup, but you pay
to sort it in advance: O(n log m log n + m log m)

But if you don’t care about using some extra space, you can build up a
map from old pointer to new pointer as you go—with the same shape of
layout as the original tree. Now you just naïvely copy the tree,
making your dictionary, then scan the list. At each list element, you
take a fixed amount of time to look up that cell in your dictionary,
follow the pointer to the new data cell, and write in the new data.
O(n log n + m)

I’m pretty sure that’s as fast as this can be done, but I’m wildly
flapping my hands about the constant-lookup-time map—can this be
done in the same asymptotic time without such terrible space
performance?

tech

Comments (0)

Permalink

Excellent Product

Snake Oil

bts

Comments (0)

Permalink

Mercury-Tested Fish: Coming Soon to a Market Near You

… or so we can hope. On NPR’s Marketplace yesterday, they aired a
story about a company called Safe Harbor which tests fish to
ensure that mercury levels are "far below the maximum mercury
level allowed by the government."

Hooray for Science! I like fish, even though I had almost never had it until college,
and right now fish and other seafood account for a rather large share
of my pescalactoovovegetarian protein, so I’d really like to not have
to worry quite as much about mercury poisoning from my food. (Then
I can go back to worrying about the mercury in my dental amalgam.)

Metallic mercury vapors or organic mercury may affect many different
areas of the brain and their associated functions, resulting in a
variety of symptoms. These include personality changes (irritability,
shyness, nervousness), tremors, changes in vision (constriction (or
narrowing) of the visual field), deafness, muscle incoordination, loss
of sensation, and difficulties with memory.

That’s just about the scariest thing I can think of. Although the
cure for Alzheimer’s disease reports are really promising, I’d much
rather not have anything to cure. If I can buy more expensive fish and
save my memory, I’m all for it. If the fish marketeers (like the one
on NPR yesterday) aren’t even passing along the extra cost, what could be better?
But I really hope Whole Foods picks this up soon—going to California for fish is a bit of a hike.

katallen

Comments (0)

Permalink

Proposed waylay mechanic

Background

The typical Assassin’s Guild waylay mechanic involved making a
hand-sign at somebody for 5 seconds or so. If they haven’t noticed
by the time you’re done, you’ve knocked them out. As Charles Hope
says,

I feel like it doesn’t actually mechanic the "lurk behind the
door and beat someone over the head when they open" it thing, it
mechanics something closer to a "leet ninja sets up target and
takes him down" thing, which is less what I want, as I don’t
think all my combatants should be leet ninjas, but I think they
should all be able to knock someone out from surprise when
lurking behind a door.

So how do you deal with this? You could have the surpriser just jump
out and say, "Waylay," and if the target’s really surprised, he falls
down. But this raises multiple-stance issues that the Guild
traditionally dislikes.

Solution

Have the surpriser jump out and say "Waylay N times M" for N, M in [1,20].
If the surprisee can respond with the result quickly enough, he’s not
surprised. If he can’t, he’s out.

Update: Make "times" explicit. That’s what I get for blogging
when hours of sleep + ounces of caffeine < 8.

games

Comments (0)

Permalink