Why doesnt alternative to JavaScript exist

Can someone explain to me why is it so difficult to have lets say python c lisp whatever as a scripting language in browser next to JavaScript.
Why cant it be like scripts in linux.You can script in bash python ruby whatever.Why cant there be something lik /bin/bash at the top that sets the language.

Attached: Zw (1).png (1200x1200, 50.7K)

Other urls found in this thread:

pyscript.net/
twitter.com/SFWRedditImages

There is something called web assembly that does that.

Sorry, shills, but I will, never use typescript or anything coming from microsoft

Based Microshill hunter

never saw it used says its still in development.Seems easier to me to add another scripting language than to do this

thats shit I want a normal language as script.Why is setting elements in HTML only possible with JavaScript.Or all apis also JavaScript.

Recently I've heard about python implementation on frontend of the websites.
It's called PyScript if I remember correctly.
Yet it is in pre-alpha though but you might want to check on it still.
I don't think it will be JS killer but who knows, maybe in a couple of years it will become somewhat of an alternative at least.
I also think it's hard to find JS alternative mainly due to it's speed, and also due to the fact that JS is very easy to learn.

All browsers support JavaScript. So you can put JavaScript code on a webpage and browsers already know how to run it.
If you wanna run Python code on a webpage then there are three options:
- Get a browser that understands Python. But then your webpage only works in that browser, and browsers don't want to support many different languages in the first place.
- Translate Python to JavaScript. This only really works for simple toy code.
- Put a full Python implementation in your webpage to run your Python code. You can actually do this (see PyScript and Brython), but then your page takes a lot longer to download and start running because you've added this large blob of code.

All browsers except IE support it. It's not very widespread but you've probably used it before without noticing.
>Seems easier to me to add another scripting language than to do this
It isn't.

doesn't support DOM manipulation

>lets say python c lisp whatever as a scripting language in browser next to JavaScript.
yes, yes, give us more bloat to cater to retards

>browsers don't want to support many different languages in the first place.
why its not like they are saving memory or something .Why cant lets say python manipulate dom directly.

is every non bashscript on linux bloat.

>why its not like they are saving memory or something
The JavaScript implementation is part of the browser. It's created by the people who write the browser.
They don't want to do that to twenty different languages. It would be an enormous amount of work and also lead to more vulnerabilities. (JavaScript alone causes many.)
To support Python they'd definitely have to make their own Python version that can't just look around on your system and do whatever it want. JavaScript is sandboxed so that it can only access the webpage but Python doesn't have that.

It was an incredibly bumpy road to get JS where it is today, where it more or less just works across all the browsers. Didnt use to be that way. Doing that and supporting multiple languages would have been ever more confusing.

You basically can thank Microsoft for all of this. They didn't invent Javascript, but once they implemented it into internet explorer, it became the de facto standard of the internet.

>what is pyscript

>doesn't support DOM manipulation
Good. A black box that's able to manipulate the DOM is an absolutely terrible idea.

>cater to retards
Be careful now.
pyscript.net/
>In short, our mission is to bring programming for the 99%.

>To support Python they'd definitely have to make their own Python version that can't just look around on your system and do whatever it want. JavaScript is sandboxed so that it can only access the webpage but Python doesn't have that.
couldnt we just limit the whole browser access to the system.So even the most unsafe language cant do anything bad.

Browsers do try that, but I also don't want it to read my passwords right out of another tab. Many bad things can happen without even leaving the browser.

>Browsers do try that, but I also don't want it to read my passwords right out of another tab. Many bad things can happen without even leaving the browser.
sure separating browser memory in to tabs and probably many other stuff.But limiting acess at browser level seems way more safe than limiting the language.some plugin can add extra features and boom language is suddenly dangerous.

>But limiting acess at browser level seems way more safe than limiting the language.
It's a mitigation, to prevent further damage once something has already gone wrong. There are very strict limits on what JavaScript (and WASM) is allowed to do and there's a lot of effort to stop it from exceeding those.
>some plugin can add extra features
Plugins are dangerous, yeah, and thankfully rare now.
Sometimes plugins actually need to be able to do dangerous things. Otherwise you could just use a regular extension which is itself written in JavaScript and so can't add extra capabilities.