In her memoir, written as letters to her two young daughters, Ali Wong tells them she would be worried if they wanted to become standup comics like her. Wong, who slogged it out on the open-mic circuit, presents a grim account of life on the road: dying onstage, bad food, bad men. She did it for more than a decade before becoming a star seemingly overnight with her first Netflix special, performed while seven-and-a-half months pregnant. Did she ever consider giving up? “There were times when I thought to myself: ‘I really don’t know if I can do this for the rest of my life,’” she says on the phone from her home in LA. “You know, staying at those motels, getting paid that little amount of money. I’m certain I would not have endured. I couldn’t. Especially after having kids.”

Luckily for Wong, she didn’t have to; instead, her career blew up. In 2016, Netflix launched her special, Baby Cobra, and she has since had a second, Hard Knock Wife. She has also co-written and starred in a romantic comedy film, Always Be My Maybe; had her two children; and published Dear Girls, the memoir written for them. Her tours sell out and her peers rave about her (Amy Schumer calls her “revolutionary”, Chris Rock championed her). “It’s been an unbelievable three years,” she says with some understatement.

Offstage, she seems softer and more laid-back than her fierce and foul-mouthed standup persona. In the book, she recalls starting out: “I was very dirty back then. Even now, I’ll look back on those days and think: ‘God, you were disgusting.’” Which is very funny if you have seen any of Wong’s comedy, because you will know how filthy she is now. In Baby Cobra, there are gags about anal sex and vaginal secretions; in Hard Knock Wife, there are jokes about the things she would like to do to their nanny if he was 25, male and “not ugly”.

When Wong first performed comedy, she was repeatedly told it was all too much. “All of these people in the industry kept on telling me: ‘You’re likable and you’re cute, or whatever, but the jokes are really dirty and you’d get booked a lot more, and you’d be a lot more appealing if they were clean,’” she says. “Maybe people were half-laughing, half-cringing at my jokes. But if you’re successful, people should be too busy laughing to cringe.” Her jokes may not have got cleaner, but they did get better.

Even now, she says people (men) told her that her material on childbirth and breastfeeding, which made it into her second special, wasn’t interesting enough. “There was one guy who said: ‘It was so much better when you were talking about dating because people can’t relate to breastfeeding,’” she says. “But it’s all I wanted to talk about. That’s kind of the whole point for me with standup, that this is not a network TV sitcom where I have to appeal to everyone.” She pauses for a split second: “I ignored that advice.”

Wong is not the first female comic to tell dirty jokes, or talk about sex, but what does feel unusual is her insistence on busting the idea that at the raw, biological level, women aren’t every bit as revolting as men. Why is it still so taboo for women to talk about bodily functions and all the fluids and secretions that ooze out of us? “I was raised to be very open about my body,” she says. Her father was a doctor, and she says her parents were always very straight with her about everything, from sex to the nonexistence of Santa Claus. She thinks for a moment about the question of taboo. “Maybe it’s because women feel they want to maintain some mystery that they’re not gross, to be more attractive or something. For me it’s all part of intimacy. That’s how I define intimacy – living closer and being more honest, closer to what your real desires are – and it’s exciting.”

Still, people thank me for making them feel less embarrassed, less ashamed and less sad about having a miscarriage Ali Wong

Her parents have been to her shows. Worse, so have her in-laws. (She is married to Justin Hakuta, who worked for a tech company but gave it up to support her career.) “That was nerve-racking. I was much less polished then and I think I talked about Japanese porn and how they blur out the genitals, and I did an imitation of a Japanese porn star screaming. That was pretty wild. But they were really supportive.”

I wonder if she is unembarrassable (there are jokes about defecating at work and her promiscuity during her 20s). “No. For sure, no. I’ll give you an example.” She says that the other day, she and Randall Park, her friend and co-star in Always Be My Maybe, were guest judges on the TV show Top Chef. “I saw his face sort of scrunch up and I was like: ‘Oh my God, I’m so sorry, I think I accidentally farted.’ He moved his chair away from me and he was laughing hysterically, too. It smelled so bad and I was so embarrassed.” She laughs: “I’m definitely embarrassable.”

When she had a miscarriage, which she talked about in her first Netflix show, one of her emotions was embarrassment. “I felt a lot of things. I felt sad, but then when I had to tell everybody the news it was something …” She pauses. “Embarrassment is when you wish you didn’t have to tell somebody something, and it wasn’t something I really wanted to share with everybody but I had to because I had bragged that I was pregnant.” There was a huge reaction to Wong talking about her miscarriage at the time. “It was very taboo for women to talk about miscarriage and it still kind of is. Still to this day, people walk up to me on the street, thanking me for making them feel less embarrassed, less ashamed and less sad about having a miscarriage.”

Ali Wong onstage in Austin, Texas. Photograph: Rick Kern/WireImage

Wong writes that “comedy requires taking risks”, although she says this is less about subject matter – nothing is off-limits as long as the joke is well-written – than about being unafraid of failure. “I guess that’s what I meant about taking risks: for every polished joke you see onstage, there are maybe 100 I tried out that failed. And people in the audience thinking I was a terrible comedian. I was always kind of OK with that.”

As a child, Wong was funny but, the youngest of four, she was also a quiet observer. “I would say that I grew up listening, a lot. I have vivid memories of details, things people said and how exactly they said them.” She grew up in San Francisco, where her father, born to Chinese parents, was an anaesthetist, and her mother, born in Vietnam, was a social worker. What was it like to write about her family’s experience of being immigrants? “It was great because I think about it all the time,” she says. Her paternal grandfather came to the US from China as an eight-year-old, travelling alone by ship. “I see kids and how young they really are and I cannot imagine them coming on a boat by themselves, going to another country to work and be separated from their parents. It really humbles me and makes me grateful and it gave me a huge sense of …” She thinks for a second. “It’s part of my identity and gave me a very strong work ethic.”

A few hours after she got married in San Francisco, Wong performed in her wedding dress at a club in the city; some nights early on in her career, while living in New York, she would perform up to nine sets at different clubs. She has only had four breaks from standup – her honeymoon, after the births of her two daughters, and when she was shooting the film. These days, once the children are in bed, she turns up unannounced and unpaid at comedy clubs up to five nights a week to try out new material. She describes it as a “calling. I just really like telling jokes”.

I used to dress like a kid, to desexualise myself. I'd be terrified if my daughters wanted to be standups Ali Wong

She writes that she has an “unusual amount of Asian pride”. That came from her parents, she says. “A lot of people talk about how they never saw themselves on screen but my parents actively made sure I saw myself on screen all the time. And we had friends who were artists and we would go to their gallery shows.” Now, she says, she makes an effort to see what other Asian American creators are up to – whether in TV, literature, art or fashion – and will introduce her children to it. “I think [if you] consume mainstream pop culture and don’t activate a search for any other niche outlets then you can fall into this feeling that you are inferior.”

One male comic once told her that her career was only taking off because she was female and from an ethnic minority. “That they have that attitude towards me is an indicator of why they are lacking in success. If you think that is the winning combo for success then you’re in trouble.” Wasn’t it infuriating? “You know, it’s not. If it was someone that I respected it would really bum me out.”

When Wong first started performing, she would wear her hair in two cute buns, and dress in “huge cargo pants”. “I used to dress like a kid, to desexualise myself,” she says. “I think that’s the main reason why I would be so terrified if my daughters wanted to be standup comics – it’s not because of them being onstage, it’s because of the road. You kind of have to go through that.” The comics she respects are the ones who came up through the circuit, rather than those who got famous on a sitcom or YouTube videos. “But the road is very scary. It always felt unsafe. Even now, when I perform at shows around town, I always ask somebody to walk me back to my car.”

Ali Wong in a still from her feature film, Always Be My Maybe. Photograph: Ed Araquel/Netflix

With the #MeToo movement, comedy has come under scrutiny and there have been allegations of sexual harassment made against several male comics. Has Wong ever experienced sexual harassment at work? She is hesitant for a while, trying to find the words. “I think I’m just not ready to share all that stuff yet, but of course there has been not-great stuff that’s happened. So … yeah. In terms of how things have changed, I guess nowadays the culture has changed, so that when people do some joke that you’ve heard before about women being ‘naggy’ or something, it just feels dated. A lot of material that would make fun of women that used to be maybe kind of funny doesn’t feel funny any more.”

Wong runs jokes about her husband past him before they make it into her shows. “A hilarious joke that performs well in front of strangers but that my husband hates is not worth getting divorced over,” she says. “My marriage is much more valuable than a great joke.” Does he mind being talked about? “I get asked that all the time but male comics have been making fun of their wives for so long and I wonder if male comics get asked the same thing. This is what standup comics do: they talk about their life and if they have a partner, they talk about their partner. But I don’t feel like male comics are ever asked about what it’s like for their wife.” I think she is right, but a male comic probably would get asked, were he to make jokes, as Wong does, about the most intimate details of their sex life. “Right,” says Wong, with a laugh. “Yes, yes. That’s true.”

While her hilarious and unrelenting filthiness is what got Wong noticed, her comedy is full of more nuanced commentary on what it is to be a woman: the double standards of mothering, the pressures of out-earning one’s husband, the reconciliation of bringing up two children under four and doing a job she loves. “I constantly feel like I’m failing at both working and being your mom,” she writes in Dear Girls. In Hard Knock Wife, she talks about the scandal of the US’s lack of paid maternity leave; is she interested in being more political? “I don’t know,” she says, then, as an aside: “As a British person, don’t you think it’s just so barbaric that we don’t give maternity leave?” Topical, political jokes, she says, have “never been my forte. I’m also a little bit intimidated because there are so many other comics who are so good at that.” She is well placed to skewer it in the current climate in the US, increasingly hostile to immigrants, but doesn’t seem sure if she wants to go there. Still, she points out, by doing what she loves and doing it well, “even me putting myself out there sometimes is political. You know what I mean? Some people can’t stand that.”

Dear Girls is out today, published by Canongate, available for £13.19 from Guardian Bookshop.

• Comments on this piece are premoderated to ensure discussion remains on topics raised by the writer. Please be aware there may be a short delay in comments appearing on the site.