STRANGE rituals have been taking place behind closed doors in Paris this summer. While much of Europe basked on the beach, elaborate rites and unfamiliar incantations could be overheard in the French capital. Paranormal activity was detected at unusual hours. In 300 hours of talks, which led to the unveiling last week of 36 reforms to the country’s notoriously complicated labour rules, it looked as if President Emmanuel Macron’s government and union leaders were simply negotiating a technical overhaul of France’s rigid employment law. In fact, they were exorcising some of the country’s most troublesome demons.

For decades, the spirit of Karl Marx and his inheritors has hovered over thinking about French labour reform. In 2000, when the Socialist government of Lionel Jospin introduced the 35-hour working week, the underlying idea was to share out existing work and create more jobs. Martine Aubry, the labour minister at the time, described the shorter week as a “project of solidarity towards the unemployed”. By working less, the benevolent French were to hand on their remaining tasks to the jobless, in line with Trotsky’s call for “all the work on hand” to “be divided among all existing workers”.

Over the years, solid worker protection for the French has been entrenched by European labour law. Yet France’s 3,448-page door-stopping labour code adds a wedge of other rights, which often seem inspired by the need to constrain bosses from their urge to exploit their workers. Such distrust has persuaded policymakers to favour public spending as a tool to combat unemployment. Directly subsidised jobs are preferred to a proper attempt to ease the rules that deter firms from creating such posts themselves. France operates a menagerie of schemes for subsidising jobs. The names come and go, as governments of the left and right rotate in and out of power: contrats jeunes, contrats d’avenir, contrats aidés, contrats de génération. Yet, despite the public subsidy, France’s unemployment rate has remained unacceptably high. At 9.5%, it is more than twice that in Germany, and has not dipped below 7% since 1980. The jobless rate for the under-25s is over 20%.

Bold is the French politician who defends the idea that firms might be more willing to hire more staff if redundancy rules were less punitive. “Who could imagine that making redundancies simpler will favour jobs?” sniffed a group of politicians and intellectuals in Le Monde, a newspaper, last year. Unlike its European counterparts, the French Socialist Party never explicitly embraced a more moderate form of social democracy, because it is “haunted by a Marxist superego” argued Manuel Valls, a former Socialist prime minister. France’s problem, says a liberal commentator, is that its society has never been démarxisé.

Enter the exorcists. On August 31st Edouard Philippe, Mr Macron’s prime minister, and Muriel Pénicaud, his labour minister, walked out of their last spirit-chasing session with the unions and into the parquet-floored salon next door to explain their reform plan. The product of all these summer talks, it gives firms more flexibility to negotiate working conditions; it caps court-awarded redundancy payouts for unfair dismissals; it simplifies worker representation in companies; it allows small firms to bypass union agreements; and it makes it easier to hire people just for specific projects. Employers are to be trusted to reach deals with employees. Small firms are to be freed of many constraints. There is no new project to subsidise jobs, and existing such schemes—“the least efficient of all employment policies”, said Ms Pénicaud—will be shrunk. Contained in five “ordinances”, under an accelerated procedure already approved by parliament, the reform will be written into law next month.

It is a radical turnaround, not just because of the technical changes to labour law that should help firms in France to plan, recruit and budget for a less stable world of work. It also represents a shift in thinking that would have been unimaginable even a year ago. In the summer of 2016, strikes and angry demonstrations obliged the previous French government to force through a far more timid labour reform by decree. This time, their disapproval of the detail notwithstanding, two of the country’s three big unions have decided not to join a day of strikes on September 12th. Mr Macron recognises that France cannot stand still while technology dislocates the jobs market. It is people, rather than posts, that need protecting. “For 30 years we’ve suffered from the sickness of mass unemployment,” he said on a recent trip to Austria, where joblessness is 5.4%. “That’s the French problem.”

Les revenants

If the young French president is chasing the lingering spirit of Marx from labour-market policy, though, it is not because he seeks to deliver France into the hands of ghoulish unchecked capitalism. A former minister in a Socialist government, Mr Macron knows that he needs to match a liberalised labour market with a modernised welfare system, which can better protect people—rather than jobs—from spells without, or with less, work. This week, for instance, the government announced plans to bring self-employed workers into the unemployment-benefit system for the first time. Mr Macron seeks to turn France not into America or Britain, but a sort of Scandinavia à la française.

It was while in Paris in 1843-1845, under the July monarchy, that Marx was first drawn to revolutionary-socialist thought. His ghost will haunt the capital again when France’s most powerful, and communist-linked, union holds its one-day strike. It will be back on September 23rd during a day of protests organised by the far left’s Jean-Luc Mélenchon, a defender of the Venezuelan regime and an advocate of a top income-tax rate of 100%. Thanks to his well-planned talks, Mr Macron may have banished the spectre of communism from labour reform. But he may still need to face it down on the streets.