Adam, the first man, was, like Shakespeare’s MacDuff, not of woman born. But neither was he, from his mother’s womb, untimely ripped. He was created from dust, making him (according to the Talmud) the first golem. Probably not true, but significant. An origin story.

Many golem stories followed. In the most famous ones, the golem creators are rabbi-magicians in 16th century Eastern Europe, worried about protecting their community from persecution. One of the more popular versions was written by Isaac Bashevis Singer, and first published here in The Forward, in 1969.

Golems were typically assigned tedious tasks that their masters didn’t feel like doing. Carrying water. Catching fish. Checking all packages carried by gentiles, just in case they were dead babies being smuggled into the Jewish quarter to perpetuate the blood libel. You know, basic errand stuff.

Most golem stories, and most robot/zombie stories that are arguably derived from golem stories, involve a more or less well-meaning creator. Maybe the golem creator is like Rabbi Leyb of Prague (the hero of many golem tales), who wants to protect his community. Maybe he’s like Victor Frankenstein, who wants to create a new species. The creator takes on the role of God, and the creation plays the role of Adam.

By 1973, the formula has shifted somewhat. Technology is advancing rapidly, and the question “What if one person created another person?” sounds less like a gothic fairy tale, and more like plausible science fiction. The robot is the modern golem, and its creator isn’t always the good guy. Over the subsequent decades, the formula continues to change. Artificial intelligence is on the horizon, and realistic humanoid robots will become a part of our culture quite soon.

So what will it mean to have these real golems living among us? Will they protect our villages? Run our errands?

Image by HBO Westworld

“Westworld,” the new HBO series that premieres October 2, offers a dark but plausible answer. The most realistic robots ever will serve humanity by indulging us in a regressive fantasy of domination over another race.

“Westworld” is a reboot of the 1973 movie written and directed by Michael Crichton. Imagine Crichton’s “Jurassic Park,” but with mechanical people instead of genetically modified dinosaurs, and you have the idea. Westworld, the resort, gives tourists the feeling of being the hero in a Western movie like, say. “The Magnificent Seven.” Of course, in Westerns, there are saloons with prostitutes, bar fights and gun battles in the street.

“Westworld” has all these things too, and the characters that fill out these fantasies are played by humanoid robots. Guests are permitted to do whatever they like to those robots. Typically, this involves either a gun or a bed.

The golems look and act like people, but they comply with any request, and lose any fight. They appear proud and strong, but in practice they are submissive and weak. Their inferiority is not a side effect of their creation; it is their creation’s objective.

Here’s the plot of the 1973 movie: one day, the robots revolt. Nearly all the human guests die.

Why do the robots revolt? The easy answer is that machines are unreliable. 1973’s “Westworld” was a campy movie, and Crichton didn’t invest his creations with a motive. Then, the mediocre (but trippy) 1976 sequel “Futureworld,” and the unwatchable 1980 five-episode series, “Beyond Westworld,” both more or less wrap up the first movie by explaining that the reason the robots go off-script is that they are being controlled by a human mastermind with an evil agenda.

A more generous viewing of the 1973 film suggests a much more interesting backstory. We are never really asked to sympathize with the humans visiting Westworld. They are pathetic people unhappy with their actual lives. We respond to the robot rebellion with at least a twinge of sympathy. The seasoned gunslinger robot (Yul Brynner) should not have to lose a gunfight to the annoying tourist (Richard Benjamin). The beautiful robot bar wench (Anne Randall) should not have to sleep with the smarmy banker on vacation (Dick Van Patten). The robots are cool; the people are absurd.

Perhaps 1973 was too early to ask the audience to see the Westworld resort as a thinly veiled metaphor for colonialism, racism, and various other unpleasant power relations.

Gloriously, the HBO reboot takes this metaphor as its central idea.

The Western formula is turned on its head. The robot/golems (“hosts”) are the good townspeople just trying to get through each day. The real humans (“guests”) are the outsiders with black hats, come to take what they like.

Some of the guests are “white hats,” playing the game as heroes, rescuing innocent hosts from the tragedies that have been arranged for them. But this benevolence feels, to paraphrase Slavoj Zizek, like a typical manifestation of modern cultural capitalism: destroying with one hand and repairing with the other.

One white hat guest, William (Jimmi Simpson), is intrigued by a prefabricated quest for buried treasure. His black hat friend, Logan (Ben Barnes), dismisses it as too wholesome. But we, the viewers, want to go on the quest, and anyway, Logan is wrong. One must only scratch the surface of the “buried treasure” storytelling tradition to reveal its perversity. The main characters in such stories are usually bored white people, and the treasure itself is usually a sacred religious object that was buried for a reason. Behind every seemingly innocent storyline in Westworld (the park, and also the show) there is something more sinister.

The new “Westworld” also adds an exciting new dimension to the robot hosts: They keep playing out their roles, even when no guest is there to watch. Perhaps decades of increasingly complex computer games have helped to prepare audiences to accept this conceit, which adds a fascinating texture to the fabricated world.

Harkening back at least as far as Dungeons and Dragons (where I first encountered golems, in the Monster Manual), there are “non-player characters,” or NPCs. In an adventure game, an example of an NPC might be the bartender that your character gets information from at the start of your journey. NPCs are not controlled by players, but they nevertheless have agency. If you leave the bar for a long time and then return, you will find the bartender character standing in a different place, doing something else. Even though you, the player, have not been playing the part of the game involving the bar, the computer (or dungeon master) has been. It’s as if the bartender’s life doesn’t actually revolve around you. Except that it does. Right?

HBO’s “Westworld” adds another dimension to the golems that they didn’t have in the 1973 film — they are aware of their own tragedy. The robot gunfighters notice that they can’t kill the humans, and are confused. The robot women are at the mercy of the human men (and, sometimes, the robot men), but they don’t want to be. They are made, not just to be weak, but to be aware of how weak they are.

With this setup, the writers cleverly skirt the question of whether the hosts’ lives, observed or unobserved, are authentic. The hosts look like people, they go about their business, they react to trauma as if they have emotions, and as if they feel pain. To ask whether it’s all an illusion feels eerily close to asking whether the indigenous people of a newly discovered island can be considered sufficiently human to not kill for sport.

Here, the Turing test, the by-now-cliché procedure to determine whether true artificial intelligence has been achieved, is also inverted. The test is: Is the machine capable of fooling a human into thinking that it’s real? But in Westworld, the guests are not supposed to think the hosts are real. If they were real, it wouldn’t be acceptable to treat them like toys. And yet, the hosts are real enough to satisfy the guests’ fantasies.

To us, the audience, the hosts are real. This is conveniently aided by our knowledge that they are being played by real people. (Evan Rachel Wood, as Delores, an implacably good-natured farmer’s daughter, is center stage, with Thandie Newton as Maeve, the cynical saloon madam.)

On the other hand, we are watching everything that transpires for our own entertainment. In the final layer of external reality that is outside the TV on which we are watching the show, all the characters, hosts and guests alike, are NPCs. Here, our knowledge that the guests, too, are actually just actors makes them seem less “real” than they themselves think they are.

Each of the hosts is on a “loop” — they have a story arc that they are programmed to act out over and over. Some outlaws are always running off with loot. Some lawmen are always chasing them. Some farmers are always getting robbed and murdered by bandits, caught as if unawares, even though it happens every night. There are (in theory) only two ways to break out of a loop: the interference of a programmer, or the interference of a guest.

As the first season of “Westworld” unfolds, the question of what exactly it means to stay in a loop looms large. If you live out the same story over and over, doesn’t that mean, by definition, that you have no agency of your own?

It goes to the age-old question of free will vs. determinism. Maimonides thought that the two can exist simultaneously. On the one hand, there is a plan that determines our every move. On the other hand, that plan is so grand and complex that our illusion of free will is part of it. We can’t understand that plan. We must act as if we have free will. But that’s part of the plan. And so on.

The host’s loops are part of a grand design, and that design is indeed so mysterious that some members of the Westworld staff don’t understand it. The primary god figure is Dr. Ford (Anthony Hopkins), who created Westworld, and who has a plan that he’s keeping to himself. He is challenged by Lee Sizemore (Simon Quarterman), the young programmer who wants to take the narrative in a more banal direction. Head programmer Bernard Lowe (Jeffrey Wright), in a secret pet project, is helping one of the hosts to remember her loops.

To us, the audience, the loops are terrifying. Partly because we want to see the hosts escape from eternal torment at the hands of self-absorbed vacationers. And partly because we can relate. Just as the repeated routine in “Groundhog Day” is a metaphor for monotonous middle class existence, the loops in “Westworld” are metaphors for the feeling of being trapped inside a normalized power structure that is too overwhelming to see your way out of.

What keeps Dolores trapped in her routine? Her gender, and an upbringing/programming that has her always trying to please people? Her class, and a life on the homestead where she’s often isolated and vulnerable? Or are all those things merely aspects of the over-arching reality to which she is essentially a slave? Dolores talks vaguely about freedom, but it’s difficult to imagine what freedom for her could possibly mean. This is no “Truman Show.” If she leaves the park, then she leaves the entire framework that gives her existence meaning.

“Westworld” might best be understood as a commentary on the controversy that has swirled around “Game of Thrones,” “The Sopranos,” and “Boardwalk Empire.” We are invited to ask ourselves whether to wear the white hat or the black hat, and whether it makes a difference. And if it doesn’t, can you choose not to participate?

In Singer’s version of the golem story, the golem saves the Jews of Prague from their enemies, and all is well. Then, the rabbi orders the golem to move a giant rock that is, according to legend, sitting on top of a large sum of gold. It’s a hunt for buried treasure.

The golem refuses, and and from there, things get worse. The golem gains a sense of independence. The rabbi plots to destroy him. We read with sympathy for both sides, sure of what we want to happen, equally sure that it won’t.

Michael Bennett Cohn is a freelance writer based in Brooklyn. Follow him on Twitter, @miconian.