For example, if you inspect this page, you'll see that it has about 150 lines of Javascript.
There are two ways to change a webpage:
- manipulate it with Javascript
- reload a new page with the changes applied
If your page loads quickly and not all that often, you can get pretty far without Javascript. If you are willing to tolerate a pageload on each interaction, you don't need any Javascript.
To put some concrete examples to that...
The HN page uses javascript[1] for the upvote/downvote buttons and also to collapse/expand comments. It would be very disruptive and jarring to reload an entire page after someone clicks a vote button. Also, mobile phone users would be doubly punished since a page reload is slower than desktop highspeed internet.
A good example of a website not requiring javascript without penalizing user-interface usability is Wikipedia text pages.
There are a few solutions for Ruby, PHP and Python although I have no experience with them and how well they perform/work.
React is implemented in JS and uses JS to declare components, and it would be fun if there is some working JS-to-Python (-to-PHP/-to-Ruby) translator that is good enough to translate React code to run "natively".
You can see an example of the various controls here:
http://www.elevatesoft.com:8081/controlsdemo/controlsdemo.ht...
The code for the example is here:
http://www.elevatesoft.com/controlsdemo_code.txt
Most of the code is either a) auto-generated by the IDE (all non-private/public interface code, and all event handlers), or b) part of the "particles" canvas drawing code.
Other languages like C, C++, and Rust can also run on the Web thanks to WebAssembly, a new compiler target for the web that's on by default in Firefox, Chrome, and Safari Technical Preview, and available behind a flag in Edge: http://caniuse.com/#feat=wasm However, interaction between the DOM and WebAssembly is still pretty rough, so it's currently best at numeric / computationasl tasks, not replacing JavaScript entirely.
Python? C++? Do these languages have strong support for web stuff?