4 ms·
Javascript was originally built for the browser and later expanded to other areas. I'm not claiming that python wouldn't need a new standard library to manipul
by Yxven 15y ago
Javascript was originally built for the browser and later expanded to other areas.
I'm not claiming that python wouldn't need a new standard library to manipulate a browser's dom tree or whatever. That's about all it would need though, so it seems like it would have been far less work to embrace and extend than to completely start over.
You seem to be arguing from the perspective (and please correct me if I'm wrong) that javascript is a good solution and a fine programming language, and I am not claiming otherwise. I just don't understand why so much effort has been spent creating and polishing Javascript instead of making slight improvements to a previously established quality language.
I suspect the answer is that your browser has an advantage if your javascript engine is faster, but there can be no advantage if everyone uses the standard python interpreter.
- tikhonj 15y agoI'm not sure why Netscape decided to write their own language for the job. Perhaps integrating a different language into their browser would have been difficult back then. Now, however, JavaScript is a well-established language so there is no need to replace it with anything else. Also, unless I'm unaware of something, wasn't Perl the most popular scripting language back then? So if they had included an already existing language, Perl would probably have been the best bet.
- chromatic 15y agoSo if they had included an already existing language, Perl would probably have been the best bet. Embedding Perl was (and is) painful. Tcl would have been easier. Sandboxing would have been more difficult. Auditing all of Perl 5's operations for the possibility of escaping that sandbox is a huge task.