“SILICON VALLEY” actors Jill Alexander, Zach Woods, Matt Ross, Thomas Middleditch, T.J. Miller and Josh Brener. (Jaimie Trueblood/HBO)

HBO is in a productive phase with a specific comedy genre — sometimes still referred to as dramedy — that eschews slapstick for a much darker exploration of human striving and failure. Smartly conceived half-hour shows like “Girls” and “Looking” (and “Enlightened,” “Getting On,” “Hung,” “Entourage” and going as far back as the fizzier camp of “Sex and the City”) are in some ways received by avid viewers as documentary material, providing fresh evidence of how we live today. It’s all about character-driven satire that succeeds more on realism than the ha-ha factor. A comedy can’t be merely funny now; it must also deliver anthropologically.

Mike Judge’s “Silicon Valley” (premiering Sunday night on HBO) is a blunt, delicious example of how to have it both ways, being hilarious while offering a fair indictment of an entire culture. It’s a precise, sharply executed sendup of the high-tech, billionaire-making culture and economy of Facebook/Google/Apple/Amazon/Yahoo that has infiltrated (“disrupted,” as they say) contemporary life. Better still, “Silicon Valley” is also here to make you laugh.

Frankly, after so much arguing about Hannah Horvath’s naked form and the shifty narcissism of “Girls,” it’s a bit of a relief to enjoy a show that revels in the art of extreme caricature rather than ambiguous portraiture. It’s also nice to watch a comedy that really is a comedy. (On that note, “Silicon Valley” is the perfect companion piece to HBO’s other surest comedy, Armando Iannucci’s “Veep,” which returns for a third season on the same night.)

It’s not that “Silicon Valley” (co-created by John Altschuler and Dave Krinsky) is without theme or comment. In its first five nimble episodes, the show delivers a deserved gut-punch to the tech world’s tendency to wrap its capitalistic instincts for blood within the shallowest sort of idealism. “Silicon Valley” also makes fun of a glorified generation or two (or three) of code-writing geeks who flock to the Bay Area to mine their own fortunes by creating apps and software that serve little real purpose.

For more than two decades now, we’ve been held in thrall by the awkward man-child who makes a digital something out of a digital nothing. Now we live in a world where these geniuses tell us what we want before we’ve even decided we want it — a constant upgrading cycle of consumerism leading to a promised land of driverless cars, personally attuned appliances and routine invasions of privacy while we shop and search. It all richly deserves a good mocking.

SILICON VALLEY: Kumail Nanjiani, Martin Starr, Thomas Middleditch, Zach Woods, T.J. Miller. photo: Isabella Vosmikova. (Isabella Vosmikova/HBO)

“Silicon Valley” is where the boys are, crammed together in shared ranch-house incubators all around Palo Alto. They are pathetically obsessed with their work, bolstered by older male egomaniacs who provide the capital and preach a nonsense gospel of global betterment. Fortunes rise and fall with the speed of wired, caffeinated rumormongers.

Thomas Middleditch stars as Richard, a shy code writer who dropped out of college and is living with three other young men in an incubator lorded over by Erlich (T.J. Miller), whose brief taste of start-up success has inflated his ego, turning him into a bong-huffing loudmouth who will grab a piece of anyone’s success.

Richard spends his time building a Web site he calls Pied Piper, which allows songwriters to check their latest creations against the vast library of all recorded music, letting them know within seconds if their song has infringed on or otherwise ripped off another melody. In building Pied Piper, Richard has accidentally discovered a way to dramatically compress large media files without deteriorating their quality — an innovation potentially worth billions.

The overweening founder of a tech supergiant called Hooli, Gavin Belson (Matt Ross), learns of Richard’s “lossless” compression idea and offers him $600,000 for it outright, which quickly ramps to $10 million as Richard’s iPhone rings and he entertains a more enticing offer from Belson’s archenemy, the superweird but certainly visionary venture capitalist Peter Gregory (Christopher Evan Welch), who offers Richard a mere $200,000 for a 5 percent share in Pied Piper. In exchange, Gregory will offer his valuable guidance as a guru.

Richard must now endure a panic-ridden journey through the dark core of “Silicon Valley.” Middleditch plays the role with a nervous, every-nerd vulnerability. Choosing Gregory’s offer means Richard has the chance to start his own company, bringing some of his buddies (Kumail Nanjiani and Martin Starr) on board while hurtfully excluding another (Josh Brener) because he doesn’t measure up.

* * *

These jokes are, of course, not exactly new — the hoodie-clad geeks with social anxiety disorders; the bro-grammers transfixed more by the screen in front of them than the events around them; the functionally autistic guru who is cocooned in his own TED-talk cult of personality, driving his single passenger hybrid that is narrow enough to get around all other traffic. (One thing I adore about “Silicon Valley” is its moral underpinning, based on a principle that the hacking impulse — outsmarting a process or cutting the line; stealing rather than earning; putting one’s self ahead of others — comes with a karmic consequence. “Silicon Valley” understands this wild west enough to know which kind of hacker to celebrate and which to hold in contempt.)

Although Judge is known for his cartoons (starting with “Beavis and Butt-head” in a bygone era of MTV and the brilliant “King of the Hill” for Fox), “Silicon Valley” is a worthy evolution of his live-action work (including the now-classic 1999 comedy “Office Space,” which still holds up as an escape fantasy for cubicle serfs) and the less-revered 2006 film “Idiocracy,” a cautionary fable from a future in which a lifelong diet of 24-7 infotainment rendered the human race permanently stupid.

At its best, “Silicon Valley” is cynical about a techie culture run rampant. In future episodes, I would very much like the show to stick it to the real Silicon Valley’s deplorable disregard for gender diversity. So far, the show has only one female character in its ensemble: Amanda Crew as Gregory’s plain-spoken handler. All other women are seen as lackeys, tech-savvy groupies and strippers.

It would also be rewarding to see more scenes of technotopia’s tendency to discriminate against people older than 35. This is comedy, true, but sometimes comedy is a powerful change agent. (I still think ABC’s sitcom “Modern Family” made all the difference in the rapid uptick in popular support for gay marriage from one election cycle to the next.)

We’ve been offered countless iterations of the Silicon Valley saga in films, sitcoms and occasional novels, with often unsatisfying results. Some regarded the place with too much awe; some just went for the easy jokes. “Silicon Valley” may or may not be a lasting entry in this category (it might, in fact, be too rudimentary to seem relevant 20 years from now), but it certainly has the potential to be.

What’s evident is the care with which Judge and the show’s writers work with and against stereotypes. Much of the show looks comfortably familiar as obvious spoof — anyone can make fun of the Google bus. But there are some pleasant and even tender surprises, particularly in the show’s tone. For those of who never got in on the financial investments of the real Silicon Valley, “Silicon Valley” offers a chance to invest emotionally.

Silicon Valley

(30 minutes) premieres Sunday at 10 p.m. on HBO.