I used to work for an industrial company in the defence sector. We were working on very complex problems with difficult requirements in term of resilience and performance. It was extremely interesting: complex algorithms, redondant architecture, hard real time development, most of it in C++ or Ada. Deadlines were tight. It was very stressful and the pay was miserable.
I left the field entirely but most of my former colleagues now work as fullstack developers for companies building SaaS solutions. They all complain about how boring it is but they all have doubled their total comp.
Meanwhile, I heard from my former boss that the company still complain that the part of the org doing software is more expensive on average per employee that the ones doing production (apparently no one has realised we don’t hire blue collar workers in this part of the company) and keeps grumbling about how talent is too hard to retain in my city.
Just how much can a skilled JS dev get paid?
In general, the big cos hire maybe 1 JS dev for every 2 or 3 backend devs. But they're on the same payscale. From what I've heard, it's more challenging to climb the level ladder, but if you come in at a terminal level and aren't particularly interested in that stuff, it's pretty comfortable.
Midwestern state, large health care company - between $150-$200K (this is FTE status with benefits)
You can also be a contractor (hourly, no benefits) and squeeze a bit more out and just jump around from company to company. Senior JS devs are in seriously high demand right now. I get around 5-6 emails a day from recruiters looking for Senior JS devs.
Think about how web companies can have very low up-front costs, use a cloud provider and some high-level frameworks for python or JS etc, make a stupid social-media connected app, and start making big money (or get investments assuming they will after capturing many users).
Then think about hardware companies - it's a very competitive space, it's mostly a commodity, the high-level software doesn't care so much about the specific chips providing those cores of cpu and gigs of ram, and what's available on the market is really amazingly powerful at a really amazingly reasonable price, due to competition with other providers in the market, and with older hardware!
It does seem kinda perverse, but ... the closer you are working to the hardware, the cheaper the market for your work, but the further up the stack, the more potential for high pay, based on the higher monetary efficiency of those companies, by running very in-efficiently on super-competitive hardware, and differentiating with features and services etc.
It's really not worth it
I had a large group of devs I used to hang out with. It was about 50/50 front-end and C, C++ guys. Over the last decade or so, every single C developer either transitioned to PHP like yourself, or went the full-stack JS route and have never looked back.
And it was all over the issues around dealing with legacy systems and the poor pay. One guy told me flat out he can make close to twice as much being a very in demand JS developer with great benefits and reasonable hours compared to the horror show of working in government (military) or finance.