But some lawmakers are balking at the prospect of activists unilaterally writing a law that would have such a profound effect on the state. The legislators would rather write the proposed law themselves, allow for lots of public input, and have final say on the scope and details.

Advocates have long planned an initiative petition to legalize the recreational use of the drug for adults, and political analysts have expected that measure to pass in the next presidential election year.

Beacon Hill legislators are working on a marijuana legalization proposal, in part as an effort to short-circuit an expected 2016 ballot push.


"Wouldn't it be a good idea for the Legislature to look at it ahead of time, listen to every point of view, anticipate every problem that we could, and try to do it right?" said Senator Patricia D. Jehlen, Democrat of Somerville and a lead sponsor of a bill to legalize, tax, and regulate recreational use of marijuana.

Senate President Stanley C. Rosenberg, who said he doesn't have a strong opinion on legalization and backs a Senate panel researching the issue, added, "I think it's better, if we're going to do this, to do it in the Legislature than on the ballot." Rosenberg, who is not listed as a cosponsor, later continued, "I believe if the Legislature doesn't act on it, it will be done on the ballot."

Opposition from top officials could doom a legislative push. Governor Charlie Baker, Attorney General Maura Healey, and Mayor Martin J. Walsh of Boston all oppose legalizing marijuana for recreational use.

But that is not stopping legislators from trying.

Nor is the legislative push slowing efforts of multiple groups working to give voters a direct say on legalization for recreational use, which four states and the District of Columbia have approved so far.


"Colorado has demonstrated that regulating marijuana works," said Mason Tvert of the Marijuana Policy Project, a national group that was deeply involved in the successful 2012 campaign for legalization there and is backing one of two official committees working toward a ballot question here.

He said the success of regulation instead of prohibition is something Massachusetts "voters are going to take into consideration."

Previous popular votes indicate Massachusetts voters are open-minded on marijuana-related issues. Strong majorities approved measures that decriminalized possession of small amounts of marijuana in 2008 and allowed its use for medical purposes in 2012. In 2016, political analysts of all stripes expect a yet-undetermined legalization measure to probably garner the tens of thousands of signatures to get on the ballot and enough votes to pass into law.

Looming over the discussion of recreational marijuana is the state's troubled implementation of the voter-approved medical marijuana law. Massachusetts has struggled in its licensing of medical marijuana dispensaries, with the process prompting more than two dozen lawsuits against the health department. And although the measure became law following a November 2012 vote, no dispensaries have yet opened.

Jehlen, the Somerville Democrat, said lawmakers behind the legalization bill hope to avoid a repeat of the state's experience with medical marijuana. She indicated a "thoughtful and careful" legislative process, including committee hearings and public input, would help make a better law than a narrow group of activists would write.

"I think it's time we got on with it and legalized marijuana," said Senator William N. Brownsberger, a Belmont Democrat, committee chairman, former prosecutor, and one of more than a dozen cosponsors of the bill. "There are too many ways for people to get in trouble in this state, and it's time to get rid of one of them."


But not all legislators feel the same way.

Representative Bradley H. Jones Jr., the House Republican leader, said he opposes legalization by ballot or bill. He said he understands the legislative impulse to fear a ballot question "not dotting all the i's or crossing all the t's."

But, he said, "I just don't understand how we can be in this headlong rush to legalize when we're dealing with the opioid crisis in the state."

Senator John F. Keenan, Democrat of Quincy, said he is opposed to the legalization of marijuana for recreational use and it would be a good idea for Massachusetts to wait for more long-term data from states that have legalized the drug — Colorado, Washington, Alaska, and Oregon.

"There are," he said, "so many unanswered questions."

Specifically, Keenan cited safety issues such as people driving under the influence, long-term health effects of inhaling or ingesting marijuana, and concerns about addiction.

His worries are similar to those expressed by the state's chief executive.

Baker has said he is "going to always be opposed to legalizing" recreational use of the drug, which remains illegal under federal law. The governor, who has made addressing the state's opioid epidemic a top goal, underscored his position on marijuana legalization again last week, pointing to concerns from people in the "addiction community" about its being a gateway drug and worry about the effect it has on teenagers and young adults.


Asked whether he would veto a marijuana legalization bill if it reached his desk, Baker paused for a few seconds before saying he hates to speak to hypothetical situations, but "conceptually" he is opposed to legalization.

The attorney general, who also is focusing on the scourge of opioid overdoses, is opposed to "the full legalization of marijuana in Massachusetts," a Healey spokesman said.

And the state's district attorneys expect to "oppose the legalization of marijuana in Massachusetts" and expect to join "education and health care experts in doing so," said a spokesman for Suffolk District Attorney Daniel F. Conley, president of the Massachusetts District Attorneys Association.

So will Boston's mayor, who said recently the push to legalize marijuana is a "big mistake," alluding to concerns about its being a gateway drug, and pointing to what he said are struggles with legalization in Colorado.

A spokeswoman for Walsh added in an e-mail that the mayor has indicated he would campaign against a ballot question that would legalize recreational marijuana.

Advocates reject the link between the opioid crisis and marijuana legalization.

Matt Simon, New England political director for the Marijuana Policy Project, said many are very legitimately concerned about opioid addiction and heroin use, "but people have to realize that marijuana is not heroin. No one has died of a marijuana overdose." He said marijuana is objectively safer than alcohol, prohibition isn't a good policy for either, and it's better to have a regulated marijuana market than a black market.


The chairman of one of the ballot question committees pushing for legalization, Northampton lawyer Dick Evans, said he hopes Beacon Hill moves on the legalization bill, which he helped write, but he is not holding his breath.

"I've been an advocate for marijuana reform for close to 40 years," he said. "And if there is anything I have learned during that time, it is what politicians want when it comes to marijuana: They want to change the subject."

Come 2016, they might not have a choice.

Joshua Miller can be reached at joshua.miller@globe.com. Follow him on Twitter @jm_bos.