Robert Sawyer's novel Red Planet Blues is a mashup of the Hardboiled Detective and Science Fiction genres. With regard to the latter, the book draws inspiration from Mars Fiction(Burrough, Heinlein, and probably others), as well as post-humanist Cyberpunk. That said, despite the broad base of inspiration, Sawyer has crafted a story with a character all it's own.
But back to the darkness. Hardboiled Fiction is all about the Hardboiled Hero and Alex Lomax is just such a hero. But there is no Hardboiled Hero without a Hardboiled World, and it is a dark dark world indeed.
Raymond Chandler defines the Hardboiled Hero as a man of honor in a honorless world. Indeed the Hardboiled Hero's heroism is one that springs from the very corrupt world it stands distinct from. It is this very paradox, that Vice can breed Honor, and Corruption Truth, that gives the Hardboiled tale it's redemptive quality.
In everything that can be called art there is a quality of redemption...But down these mean streets a man must go who is not himself mean, who is neither tarnished nor afraid. The detective in this kind of story must be such a man...He must be a complete man and a common man and yet an unusual man...He must be the best man in his world and a good enough man for any world. I do not care much about his private life; he is neither a eunuch nor a satyr; I think he might seduce a duchess and I am quite sure he would not spoil a virgin; if he is a man of honor in one thing, he is that in all things. ...He is a common man or he could not go among common people...He is a lonely man and his pride is that you will treat him as a proud man or be very sorry you ever saw him. He talks as the man of his age talks, that is, with rude wit, a lively sense of the grotesque, a disgust for sham, and a contempt for pettiness...He has a range of awareness that startles you, but it belongs to him by right, because it belongs to the world he lives in. ("The Simple Art of Murder", Raymond Chandler)
The world that Alex Lomax lives in is a bleak one indeed, though Sawyer has a way of understating it's bleakness. It is the small world of the Martian Frontier, which draws desperate people, hungry for a new start, certain that they won't get one on Earth. The narrator doesn't shove this point down your throat. Yet everyone we meet seems to be in a state of quiet desperation.
Not only that, but many of Mars' inhabitants Transfer. The post-Humanist angle of the book is that the technology exists to "Transfer", to copy your mind into a cybernetic brain and install it in a robotic body of more than Human ability. This sounds nice, but the law forbids two copies of the same mind to exist, so the final step in the "Transfer" process is to euthanize the original biological copy(though the Marketing types breeze over this point, as the book points out). And many people on Mars do transfer to overcome the harsh environment, so the ultimate implication is that Lomax is living in a society of mass-suicide, with the only caveat being that those suicides are replaced with robotic copies. That said, the narrator doesn't shove this idea in the reader's face. Rather, Lomax finds himself in one situation after another that accentuate this perverse reality. Each time, the the reader's cognitive dissidence is heightened, leaving him, like Lomax himself, wondering why only he seems to be bothered by this state of things.
Anyway, bottom line, really bleak novel, though Sawyer manages to lighten the mood somewhat in the story's denouement. Sawyer is a master craftsman of mood and it's really a wonder to watch him ply his trade...on you, the reader.