8 ms·
I'm a HUGE fan of Scheme. And of Lisp, in general. But having seen in the "real world" how so many people are so adverse to Lisp's beautiful syntax, I'm pretty
by nessus42 10y ago
I'm a HUGE fan of Scheme. And of Lisp, in general. But having seen in the "real world" how so many people are so adverse to Lisp's beautiful syntax, I'm pretty confident that JavaScript would never have caught on if it looked like Lisp rather than like C.
- zeveb 10y agoThey wouldn't have had a choice, though, just as folks don't have a choice with JavaScript. I imagine that folks would have cottoned on to the advantage pretty quickly. And those that didn't … I guess they could have always become telephone cleaners or something:-)
- brlewis 10y agoPure Scheme would not be sufficient. You need at least DOM-handling libraries. And if those libraries were poorly designed, then people wouldn't cotton onto the advantage quickly. Look at DSSSL.
- shakna 10y agoJust about every modern Lisp has an X-Expression library, and having used Racket's in production, it's a hell of a lot better than the DOM browsers have today.
- fiddlerwoaroof 10y agoBecause of macros lisps are more resistant to bad APIs than other languages, in my experience.
- brlewis 10y agoThat is a very good point.
- zeveb 10y ago> You need at least DOM-handling libraries. Did you see the '(set! (inner-html (get-element-by-id document "demo")) "Hello JavaScript!")' bit? That's DOM-handling in Scheme. Not a really great API, but it's not terrible either.
- tmzt 10y agoWell we could all be using VBScript. If Netscape had failed to establish a defacto standard, Microsoft was waiting in the wings.
- nessus42 10y agoYou underestimate the average programmer's aversion to Lisp syntax, despite it being the clearly superior syntax. If JavaScript had had Lisp syntax, then everyone would still be using Flash. Or some other plugin that provided a language with a more popular syntax.
- lacampbell 10y agoYou underestimate the average programmer's aversion to Lisp syntax, despite it being the clearly superior syntax. IME it's a learned thing from only knowing languages that at least superficially resemble ALGOL. JS is a first language for a lot of people - because their goal was to make a website do something. Scheme would not have been any different.
- nessus42 10y agoIME it's a learned thing from only knowing languages that at least superficially resemble ALGOL. IME many computer programmers learned Lisp in college and for some reason hated it–I think in part due to the syntax and in part because they had a hard time with recursion and other "mind-bending" concepts. They often still harbor an irrational precedent to this day. Me, on the other hand, I loved Lisp as soon as I learned it. (Perhaps I was primed by having learned APL in high school.) I changed my major from Astrophysics to Computer Science because I felt that SICP was even cooler than black holes and neutron stars.
- khedoros1 10y ago> They wouldn't have had a choice, though, just as folks don't have a choice with JavaScript. If people disliked the syntax enough to avoid the language (and the browser that uses it), I imagine that other browsers would've started supporting other languages, and something else would've dominated.
- int_19h 10y agoBrowsers actually did support other languages back then. Remember VBScript? IIRC there was also an attempt to draft Tcl into that role. In IE world, things were actually even crazier, because the whole scripting story was extensible (via Active Scripting). So you could use Perl, for example...
- randomdata 10y agoBrowsers worked just fine before the advent of Javascript. Nobody had to use it, but they decided to use it because it was good enough. If some other language was deemed not good enough, there would have been more aversion to using it, and it would have never taken off. Not to mention that there were other ways to execute code in the browser in those days. We have 'no choice' but Javascript today simply because it's the option that people eventually gravitated towards, forcing the others out of the market.
- int_19h 10y agoThey decided to use it because it let you add things like drop-down menus (and falling snowflakes!) to your website, which made it look better than your competitor's website. Syntax was just the hoop to jump through to achieve that, and a very minor one at that. I doubt it would have made any difference.
- randomdata 10y agoYou honestly believe that Javascript would have been equally successful if it had shared similar syntax to, say, Brainfuck? Especially given the alternatives that were available at the time? If syntax doesn't matter, I guess so, but I'm not sure I'm convinced.
- lomnakkus 10y agoThere's a pretty big difference between Brainfuck and Scheme. Of course syntax matters, but parent wasn't asserting that it doesn't matter at all.
- randomdata 10y agoThere is a big difference, but since we're talking about any language "deemed not good enough", a language similar to Brainfuck definitely applies, and perhaps is the shining example. The original suggestion was that people would use Javascript, or any other language in its place, simply by virtue of it being the only option. I argue that the wrong language would hamper adoption, and eventually some other language – like, say, VBScript which came only 6 months later – would have taken over. Javascript persisted, and eventually completely dominated, because it was good enough. A language not good enough would have not had the same success, even given the otherwise same environment to grow up in.
- deleted 10y ago[deleted]