perché javascript è un linguaggio di scripting ampiamente utilizzato nelle applicazioni web? [duplicare]

4

Non riesco a trovare plugin scritti in altre lingue oltre a javascript. C'è il supporto del browser solo per Javascript. Perché non hanno usato altri linguaggi di scripting diversi da Javascript quando le persone hanno iniziato a utilizzare gli script sulle loro pagine web? Perché javascript ha avuto la priorità?

    
posta Prem Anand 08.10.2013 - 10:20
fonte

3 risposte

5

era il primo linguaggio di scripting lato client introdotto da netscape nella guerra del browser nel '95 durante il tempo era dominante, presentato per la standardizzazione nel '96 (e standardizzato un anno dopo).

Microsoft non è riuscito a ottenere un linguaggio di scripting in competizione correttamente abbastanza veloce / popolare in modo che lo adottassero come JScript.

Qualche altro browser non ha avuto il mercato per introdurre il proprio linguaggio di scripting e sono stati costretti ad adottare javascript per rimanere competitivi.

    
risposta data 08.10.2013 - 10:36
fonte
2

Netscape è riuscito a dare un vantaggio al proprio browser Web, quindi si è bloccato.

Da questo video di Douglas Crockford: perché la sintassi è così com'è, perché si chiama JavaScript, perché Microsoft lo ha copiato e perché alcune delle parti difettose sono presenti. (Non ho copiato le parti su ECMAScript, ma questa è anche una storia interessante):

One of the things [Netscape] wanted to do was to put interactivity back into the browser, because we had lost interactivity when we went to the browser model. [...]

In order to do that, they hired this guy, Brendan Eich, who had been at Silicon Graphics. Brilliant guy. In his interview he said he wanted to write a Scheme interpreter, and they said ‘that’s great, that’s just what we want’. After they hired him they found out what Scheme was, and they said ‘no, no, no, you can’t do that. People won’t like that. Do something that looks more like Visual BASIC, or Java, something people like.’ [...]

Brendan took elements of all three of these languages [Java, Scheme, and Self], and a little bit of his own, and put them together into a new language that was called LiveScript. [...]

LiveScript was going to become one of the key technologies for Netscape going forward. It was going to be in Netscape Navigator 2, so you could have LiveScript applications running on the client-side, and on the server-side; Netscape’s LiveWire server had server-side JavaScript in it. This was back in ’95, so JavaScript was there from the very beginning. It was very clear at the time that there was a lot of excitement about Java and the Netscape browser, and Sun and Netscape decided they needed to work together against Microsoft because if they didn’t join forces Microsoft would play them off against each other and they’d both lose.

The biggest point of contention in that arrangement was what to do with LiveScript. Sun’s position was: "Well, we’ll put Java into the Netscape browser, we’ll kill LiveScript, and that’ll be that." And Netscape said no, that they really believed in the HyperCard-like functionality, and they wanted a simpler programming model in order to capture a much larger group of programmers. So there was an impasse, and the relationship almost broke up, when I think Marc Andreessen - and I have been able to document this, but people have told me - Marc Andreessen, maybe as a joke, suggested: ‘let’s change the name to JavaScript.’

[laughter]

And it worked, except that Sun claimed ownership of the trademark. Even though they had nothing to do with the language and they tried to kill the language, they said ‘we own the trademark, but we’ll give you a license to use the trademark’. Netscape said ‘great, an exclusive license only, we can call it JavaScript, that’s fine’.

At Microsoft they’d been watching this with some alarm, particularly when folks at Netscape were saying that Netscape Navigator was going destroy Microsoft. Microsoft said ‘oh, we don’t want to be destroyed’. It turned out Netscape Navigator didn’t destroy Microsoft. In fact, the software that is going to destroy Microsoft is Windows Mobile.

[laughter]

But I’m getting ahead of the story again. What Microsoft did was they decided they needed to copy the Netscape model in order to be competitive. They reverse engineered the JavaScript engine and called it JScript. They couldn’t call it JavaScript because Sun owned the trademark, and they weren’t getting along very well with Sun at that time, so they called it JScript. [...]

Most languages take years to develop – for example, Smalltalk was eight years from Alan Kay’s first prototype to Smalltalk 80, when it was first made available to the public. That’s a good timeframe for a programming language, because you want to go through it and test it, make sure that it works, and refine it in order to make sure that it’s meeting its goals. JavaScript was prepared in about as many days. It’s amazing that he could get it done and designed and working in such an incredibly short time; in about two weeks. I challenge any language designer – it’s sort of like a quickfire challenge. That turns out not to be a good way to make software, but that’s how it was done, and we’re now living with the consequences of that. Had Netscape been a better managed company, they might have taken a lot more time, maybe a couple of extra weeks, to clean it up, and we wouldn’t be dealing with the bad parts that we have now. But we have.

The good news is that, for the most part, the bad parts can be avoided. And if you avoid the bad parts, and if you work just with what’s left over, the good parts, there’s actually a brilliant language there.

link

    
risposta data 08.10.2013 - 15:45
fonte
-1

Penso che ci fossero due fattori principali tra i tanti:

  1. Il programmatore danese Lars Bak ha cambiato il panorama di Internet quando il suo team di Google ha progettato il runtime V8 di Chrome.
  2. Steve Jobs.

C'erano un sacco di altri linguaggi di scripting; Oracle ha creato applet selvatiche per poter utilizzare Java.

Ricordo che ActionScript era molto più avanti di JavaScript quando è stato rilasciato, e penso che in seguito JavaScript abbia sostanzialmente copiato ActionScript 2.

Ricorda quando tutto ciò che dovevi fare era cliccare qui e aspettare che Flash fosse installato? Allora era l'unico modo in cui potevano accadere cose interessanti, ActionScript di Flash è diventato il vero segno dello sviluppo di browser di alta qualità con UI / UX all'avanguardia.

JavaScript era terribile allora, ECMAScript 3 è stato un notevole miglioramento, ma Microsoft era troppo grande per preoccuparsi delle idee di qualcuno sugli standard.

All'improvviso l'ambiente di esecuzione è aumentato vertiginosamente con il V8 e le guerre del browser sono iniziate. Come FireFox, Chrome, Safari e molti altri hanno combattuto, il tempo di esecuzione era sotto costante ottimizzazione.

Un giorno, Steve Jobs si è svegliato e ha deciso di uccidere Flash .

Quindi sì, probabilmente Steve Jobs e Lars Bak sono stati i due principali motivi che vorrei dire.

    
risposta data 08.10.2013 - 11:36
fonte

Leggi altre domande sui tag