Naming languages

A naming language is the second-simplest kind of constructed language. (The simplest conlang is what’s sometimes called a “relex”, basically a form of English with all the words changed, but with the same grammar.) If all you need is a way to productively create alien-sounding names for people and places in a setting, with little regard to grammatical, syntactic, or naturalistic concerns, then a naming language is a good compromise between throwing some sounds together and creating a whole conlang.

Elements of a naming language

First and foremost, a naming language isn’t a full language. You can get away with cutting so many corners that you’re left with a circle. Throw out stuff like subordinate clauses and subjunctive moods. You won’t need them. True, some cultures have names that are complete sentences, but those are rarely the kind of complex structures requiring a whole conlanging effort. No, for naming languages, we can strip things down to the bare necessities.

One thing we’ll need is a phonology, a sound inventory. This can be whatever you like, whatever you think sounds best. Since we won’t have a lot of the grammatical cues of a full conlang, the phonology is going to determine the basic feel of our naming language. If you’re working with aliens, try to think of the sounds they would make, and then think of how a human would interpret them. For human cultures, look for inspiration in the languages of those cultures you want to emulate.

Next, you can work out a way to turn those sounds into syllables, then into words. Once again, use appropriate human languages as a guide, but not a straitjacket. At this stage, you can go ahead and make some simple words that you think might come in handy. Names for people and places follow different rules, and I’ll do a post for each in the coming weeks, but think of common objects, terrain features, activities, and occupations. Those are a good start.

Third, naming languages do need a little bit of grammar. It’s nothing close to what a “real” language would have, though. Your primary concern is making names, so you really only need the grammar necessary to make them. Simple combinations of nouns and adjectives work just fine for many cases; all you have to decide is what order they go in. You can throw in verbs, too, but don’t worry too much about case or mood or things like that. Those are only distractions.

Lastly, remember that languages change. Names change, too, but under different conditions. Place names tend to follow the phonological changes of their “host” cultures more closely than personal names, but the latter certainly aren’t immune to evolution. And some names pick up (or lose) connotations as their languages and cultures change. This is especially common for personal names. Boys’ names become girls’ names, and vice versa. Names fall out of fashion (Puritan names like “Increase” don’t find much traction today) while new ones arise from cultural shifts (witness the current popularity of fantasy names like Daenerys).

Place names can change, too, but this usually requires a massive shift in the cultural or political situation. For real-world examples, look at Burma/Myanmar, or the mass renaming of cities in India, or the changing of American place names in the pursuit of political correctness.

To be continued

In the next two weeks, I’ll go into more detail about each of the two main types of names. Next week, we’ll look at place names, because I think they’re easier and more transparent. After that will be personal names, with some closing thoughts on making “alien” names.

Software internals: Arrays

I’m a programmer. I think that should be obvious. Even though most of my coding these days is done at a pretty high level, I still enjoy the intricacies of low-level programs. It’s great that we have ways to hide the complexities inherent in software, but sometimes it’s fun to peel back the layers and look at just how it works. That’s the idea behind this little series of posts. I want to go into that deeper level, closer to the metal. First up, we’ll take a peek at that simplest and dumbest of data structures: the array.

Array, array

At the basic level, an array is nothing more than a sequence of values. Different languages have different rules, especially regarding types, but the idea is always the same. The values in an array are its elements, and they can be identified by an index. In C, for example, a[0] has the index 0, and it refers to the first element of the array named a. (C-style languages start counting from 0. We’ll see why shortly.)

For the purposes of this post, we’ll start with the simplest kind of array, a one-dimensional array whose values are all of the same type—integers, specifically. Later, we can expand on this, but it’s best to start small. Namely, we’ll have an array a with four values: {1, 2, 3, 4}. Also, we’ll mainly be using lower-level languages like C and C++, since they give the best look at how the code really runs.

In memory

One of the main reasons to use something like C++ is because of memory concerns, so let’s look at how such an array is set up in memory. On my PC, using 64-bit Debian Linux and GCC 5.3, it’s about as simple as can be. The compiler knows all the values beforehand, so all it does is put them in a “read-only data” section of the final executable. (In the assembly output, this shows up as .long statements in the .rodata section.) The elements of the array are in contiguous locations; that’s not just required by the C standard, but by the very definition of an array. It also makes them fast, especially when cache comes into play.

In C++, 4 integers in an array take up the space of, well, 4 integers. On a 64-bit system, that’s 32 bytes, half that if you’re still on 32-bit. There’s no overhead, because an array at this level is literally nothing more than a sequence of memory locations.

That contiguous layout makes working with the array trivial. Given an array a or n-byte elements, the first element—index 0—is at the same address as the array itself (&(a[0]) == &a in C parlance). To find any other one, all you have to do is multiply the index by the size of each element: &(a[i]) == &a + i * sizeof(int). Addition is just about the fastest thing a processor does, and word sizes as powers of 2 mean that the multiplication is nothing more than a bit shift, so array indexing is hard to beat.

Copying these arrays is easy, too: copy each element, and you’re done. Want to compare them? Nothing more than going down the line, looking for differences. Sure, that takes linear—O(n)—time, but it’s a great start. Of course, there are downsides, too. Arrays like this are fixed in size, and they all have to be the same type.

Complicating matters

There’s not much more to be said for the humble array, so let’s add some kinks. To start, what do you do if you don’t know all the values to begin with? Then, you need an uninitialized array, or a buffer. Compilers typically use a trick called a BSS segment to make these, while higher-level languages tend to initialize everything to a null value. Either way, all you really get is a block of memory that you’re expected to fill in later.

Changing the other assumptions of the array (fixed size and type) means changing the whole structure. Dynamically-sized arrays, like C++’s vector, need a different way of doing things. Usually, this means something like having an internal array—with a bit of room to grow—and some bookkeeping data. That gets into dynamic memory allocation, another topic for later, but from the programmer’s point of view, they work the same way. In fact, vector is required to be a drop-in replacement for arrays. (If you want arrays where elements can be of different types, like in JavaScript, then you have to abandon the simple mathematical formula and its blazing speed. At that point, you’re better off ditching the “array” concept completely.)

Moving up to higher levels doesn’t really change how an array functions. At its core, it’s still a sequence of values. One of JavaScript’s newer features is the typed array, which is exactly that. It’s intended to be used where speed is of the essence, and it’s little more than a friendlier layer on top of C-style arrays.

Implementation details

Just about every usable language already has something like an array, so there’s almost never a need to make one yourself. Indeed, it’s nearly impossible to do so. But maybe you’re working in assembly language. There, you don’t have the luxury.

Fixed-size arrays are nothing more than blocks of memory. If your array has n elements, and each one is size s, then you need to reserve n * s bytes of memory. That’s it. There’s your array. If you need it initialized, then fill it in as necessary.

Element access uses the formula from above. You need to know the address a of the array, the element size s, and the index i. Then, accessing an element is nothing more than loading the value at a + i * s. Note, though, that this means elements are numbered starting at 0. (And it’s exactly why, for that matter.)

Since arrays are dumb, you can pass them around as blocks of memory, but you always need to know their size. If you’re not careful, you can easily get buffer overflows and other out-of-bounds conditions. That’s the reason why so many “safe” C functions like snprintf take an extra “maximum size” argument. The array-as-memory-block notion, incidentally, is why C lets you treat pointers and arrays as the same thing.

The end

The array, in whatever form, is the most basic of data structures, so it made for a good starting point. I hope it set the tone for this series. Later on, I’ll get into more complicated structures and algorithms, like linked lists, sorting, and so on. It’s all stuff that programmers in something like JavaScript never need to worry about, but it’s fun to peek under the hood, isn’t it?

Life below zero: building the Ice Age

As I write this post, parts of the US are digging themselves out of a massive snowstorm. (Locally, of course, the anti-snow bubble was in full effect, and the Tennessee Valley area got only a dusting.) Lots of snow, cold temperatures, and high winds create a blizzard, a major weather event that comes around once every few years.

But our world has gone through extended periods of much colder weather. In fact, we were basically born in one. I’m talking about ice ages. In particular, I’m referring to the Ice Age, the one that ended about 10,000 years ago, as it’s far better known and understood than any of the others throughout the history of the planet.

The very phrase “Ice Age” conjures up images of woolly mammoths lumbering across a frozen tundra, of small bands of humanity struggling to survive, of snow-covered evergreen forests and blue walls of ice. Really, if you think about it, it paints a picturesque landscape as fascinating as it seems inhospitable. In that, it’s no different from Antarctica or the Himalayas or Siberia today…or Mars tomorrow. The Earth of the Ice Age, as a place, is one that fuels the imagination simply because it is so different. But the question I’d like to ask is: is there a story in the Ice Age?

Lands of always winter

To answer that question, we first need to think about what the Ice Age is. A “glaciation event”, to use the technical term, is pretty self-explanatory. Colder global temperatures mean more of the planet’s surface is below freezing (0° Celsius, hence the name of this post), which means water turns to ice. The longer the subzero temps, the longer the ice can stick around. Although the seasons don’t actually change, the effect is a longer and longer winter, complete with all the wintry trappings: snow, frozen ponds and lakes, plant-killing frosts, and so on.

We don’t actually know what causes these glaciation events to start and stop. Some of them last for tens or even hundreds of thousands of years. The worst can cover the whole world in ice, creating a so-called “Snowball Earth” scenario. (While interesting in its own right, that particular outcome doesn’t concern us here. On a snowball world, there’s little potential for surface activity. Life can survive in the deep, unfrozen oceans, but that doesn’t sound too exciting, in my opinion.)

If that weren’t bad enough, an Ice Age can be partially self-sustaining. As the icecaps grow—not just the ones at the poles, but anywhere—the Earth can become more reflective. Higher surface reflectivity means that less heat is absorbed, dropping temperatures further. And that allows the ice to spread, in a feedback loop best served cold.

Living on the edge

But we know life survived the Ice Age. We’re here, after all. The planet-wide extinction event that ended the Pleistocene period came at the end of the glaciation event. So not only can life survive in the time of ice, it can thrive. How?

Well, that’s where the difference between “ice age” and “snowball” comes in. First off, the whole world wasn’t completely frozen over 20,000 years ago. Yes, there were glaciers, and they extended quite far from the poles. (Incidentally, the glaciers that covered the eastern half of America stopped not that far from where I live.) But plenty of ice-free land existed, especially in the tropics. Oh, and guess where humanity came from?

Even in the colder regions, life was possible. We see that today in Alaska, for instance. And the vagaries of climate mean that, strangely enough, that part of the world wasn’t much colder than it is today. So one lead on Ice Age life can be found by studying the polar regions of the present, from polar bears to penguins and Eskimos to explorers.

The changing face

But the world was a different place in the Ice Age, and that was entirely because of the ice. The climate played by different rules. Hundreds of feet of ice covering millions of square miles will do that.

The first thing to note is that the massive ice sheets that covered the higher latitudes function, climatically speaking, just like those at the poles. Cold air is denser than warm air, so it sinks. That creates a high-pressure area that doesn’t really move that much. In temperate regions, high pressure causes clockwise winds along their boundaries, but they tend to have stable interiors.

Anyone who lives in the South knows about the summer ridge that builds every year, sending temperatures soaring to 100°F and causing air-quality and fire danger warnings. For weeks, we suffer in miserable heat and suffocating humidity, with no rain in sight. It’s awful, and it’s the main reason I hate summer. But think of that same situation, changing the temperatures from the nineties Fahrenheit to the twenties. Colder air holds less moisture, so you have a place with dry, stale air and little prospect for relief. In other words, a cold desert.

That’s the case on the ice sheets, and some thinkers extend that to the area around them. Having so much of the Earth’s water locked into near-permanent glaciers means that there will be less precipitation overall, even in the warm tropics. That has knock-on effects in those climates. Rainforests will be smaller, for example, and much of the land will be more like savannas or steppes, like the African lands that gave birth to modern humans.

But there are still prospects for precipitation. The jet stream will move, stray winds will blow. And the borders of the ice sheets will be active. This is for two reasons. First, the glaciers aren’t stationary. They expand and contract with the subtle seasonal and long-term changes in temperature. Second, that’s where the strongest winds will likely be. Receding glaciers can form lakes, and winds can spread the moisture from those lakes. The result? Lake-effect precipitation, whether rain or snow. The lands of ice will be cold and dry, the subtropics warm (or just warmer) and dry, but the boundary between them has the potential to be vibrant, if cool.

Making it work

So we have two general areas of an Ice Age world that can support the wide variety of life necessary for civilization: the warmer, wetter tropics and the cool convergence zones around the bases of the glaciers. If you know history, then you know that those are the places where the first major progress occurred in our early history: the savannas of Africa, the shores of the Mediterranean, the outskirts of Siberia and Beringia.

For people living in the Ice Age, life is tough. Growing seasons are shorter, more because of temperature than sunlight; the first crops weren’t domesticated until after the ice was mostly gone, when more of the world could support agriculture. Staying warm is a priority, and making fire a core part of survival. Clothing reflects the cold: furs, wool, insulation. Housing is a must, if only to have a safe place for a fire and a bed. Society, too, will be shaped by these needs.

But the Ice Age is dynamic. Fixed houses are susceptible to moving or melting glaciers. A small shift in temperature (in either direction) changes the whole landscape. Nomadic bands might be better suited to the periphery of the ice sheets, with the cities at a safe distance.

The long summer

And then the Ice Age comes to an end. Again, there’s no real consensus on why, but it has to happen. We’re proof of that. And when it does happen…

Rising temperatures at the end of a glaciation event are almost literally earth-shattering. The glaciers recede and melt (not completely; we’ve still got a few left over from our last Ice Age, and not just at the poles), leaving destruction in their wake. Sea levels rise, as you’d expect, but they could also sink, as the continents rebound when the weight of the ice is lifted.

The tundra shrinks, squeezing out those plants and animals adapted to it. Conversely, those used to warmer climes now have a vast expanse of fresh, new land. Precipitation begins to increase as ice turns to water and then evaporates. The world just after the Ice Age is probably going to be a swampy one. Eventually, though, things balance out. The world’s climate reaches an island of stability. Except when it doesn’t.

Our last Ice Age ended in fits and starts. Centuries of relative warmth could be wiped out in a geological instant. The last gasp was the Younger Dryas, a cold snap that started around 13,000 years ago and lasted around a tenth of that time. To put that into perspective, if it were ending right now (2016), it would have started around the time of the Merovingians and the Muslim conquest of Spain. But we don’t even know if the Younger Dryas was part of the Ice Age, or if it had another cause. (One hypothesis even claims it was caused by a meteor striking the earth!) Whether it was or wasn’t the dying ember of the Ice Age doesn’t matter much, though; it was close enough that we can treat it as if it were.

In the intervening millennia, our climate has changed demonstrably. This has nothing to do with global warming, whatever you think on that topic. No, I’m talking about the natural changes of a planet leaving a glacial period. We can see the evidence of ancient sea levels and rainfall patterns. The whole Bering Strait was once a land bridge, the Sahara a land of green. And Canada was a frozen wasteland. Okay, some things never change.

All this is to say that the Ice Age doesn’t have to mean mammoths and tundra and hunter-gatherers desperate for survival. It can be a time of creation and advancement, too.