Hacker News new | past | comments | ask | show | jobs | submit login

Maybe he wanted to. If that was his goal, I think he failed.

    Scheme: First-class functions, tail-call elimination, macros,
            hygienic macros, write and parse the AST directly.
    JavaScript: First-class functions.
    
    Scheme: Immutable arrays and lists, mutable strings.
    JavaScript: Mutable-only arrays, immutable-only strings.
Yes, I have, and have read, Coders at Work. I don't see how it's relevant. JavaScript and Scheme share only one defining feature in common, first-class functions. It's an important feature, no doubt, but many other languages have it: C/Objective-C (with Apple's blocks extension), C++ (with Boost.Lambda), Perl, Python, Ruby, Lua, Io, OCaml, ML, Haskell, the list goes on. People compared Perl to Lisp once, briefly, when it was one of the few dynamic languages, but they don't anymore.



They share only one defining feature? Bullshit. If we include "garbage collected", that gets rid of C and C++. If we include "dynamically typed", that gets rid of OCaml, ML, Haskell. If we include "single namespace for functions and variables", that gets rid of Ruby, Io, and Perl. Now we're down to JavaScript, Python, and Scheme, which, yes, are all in basically the same family of languages. If we include the (admittedly subjective) feature "small language spec", that gets rid of Python, and we're left with JavaScript and Scheme as the only two mainstream languages with those particular defining features.

If I were describing JavaScript to someone who was a programming language expert but somehow was never exposed to it, I would describe it as "Scheme, with C syntax, no tail calls, and a strange prototype-based object system".


People compared Perl to Lisp once, briefly, when it was one of the few dynamic languages, but they don't anymore.

They should; Perl 5 compares quite well and Perl 6 fares even better (of the nine fundamental features of a Lisp, lacking only homoiconicity). See the book Higher-Order Perl, for example.

http://hop.perl.plover.com/


Oh, come on, you're cherry picking the features that suit your argument. If we include "garbage collected", that gets rid of C and C++. If we include "dynamically typed", that gets rid of OCaml, ML, Haskell. If we include "single namespace for functions and variables", that gets rid of Ruby, Io, and Perl. Now we're down to JavaScript, Python, and Scheme, which, yes, are all in basically the same family of languages. If you add the (admittedly subjective) feature "small language spec", that gets rid of Python, and we're left with JavaScript and Scheme as the only two mainstream languages with that particular feature set.


You have to compare JavaScript with Scheme of the time when JavaScript was designed. Both macros and immutable structures are pretty recent (1999 and 2006 IIRC) additions to Scheme, previously such facilities were either non-existent or implementation-specific.

While Scheme's syntax superficially looks like it's data, specification does not imply that there should be accessible AST as list structure anywhere (in contrast to Common Lisp, which is specified in terms of list structures and algorithm to build them from text serialization)

And by the way: You have left off the one most important defining feature of Scheme: first-class continuations. And JavaScript really does not have them (I would say that this is completely reasonable omission for JS's purpose)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: