And in the spirit of open source, I couldn't not recommend the open source game engine Godot, which is rapidly closing in on its proprietary competitors like Unity and Unreal: https://godotengine.org/
1. Terrible, terrible tooling
2. Hostility from browser vendors themselves
3. Many APIs are still non-standard/officially "experimental", even if implemented
4. Possible performance issues for ordinary programs, likely issues for many games
5. People will make fun of you for this
What. Using a mature language and not relying on feature of the day will produce a game you can compile 5 years from now and it will just work.
Use SFML or something to provide a cross platform way to create windows and interface with the system and you're pretty much set.
If doing all the drawing and physics code is too much for you to do, use a game engine or a physics library. Those will also compile in 5 years from now and run on other people's computers (assuming you get the source).
>easy ways to make things that will run on someone else's computer and will still run in 5 years without futzing around
SFML does that. Java does that. Godot engine does that. Bullet physics does that. And yes, a javascript engine also does that.
Moving the goalposts involves introducing new constraints or altering old ones after the fact. That's not what's happening here, except for maybe on your end. You can choose to ignore them or not, but they're right there in the question:
> what are the easy ways to make things that will run on someone else's computer
No amount of handwaving and category errors are going to adapt these constraints or any other constraints of the world we're actually living in to be more favorable to your suggested solution.