News for hackers. Stuff that matters.
Re:Redline Smalltalk V1.0 by nicksergeant on Monday November 26, 2012 @10:11AM (#4832229)
JavaScript is Lisp now?
Re:Redline Smalltalk V1.0 by zackzackzack on Monday November 26, 2012 @10:31AM (#4832328)
It's pretty damn close. First class functions give javascript great power. Combined with something like sweet.js and underscore, and javascript becomes a language with the functional library of a lisp along with macros. After that, javascript is just lisp with really weird syntax.
Re:Redline Smalltalk V1.0 by chimeracoder on Monday November 26, 2012 @01:57PM (#4833329)
Not to be snarky, but that's like saying 'Javascript is just a Lisp except without the only characteristic that defines a Lisp'.

All the dialects of Lisp differ except in their homoiconicity, which is the one thing that gives Lisps their incredible expressive power.

I get frustrated when I hear people refer to languages with first-class functions as Lisp-like, because lots of languages have first-class functions, but that doesn't give them the power of Lisp - Lisp draws its power from homoiconic structure, which almost no other languages have (certainly not Javascript).

Re:Redline Smalltalk V1.0 by zackzackzack on Tuesday November 27, 2012 @03:20PM (#4838736)
Most of my comment comes from the fact that Eich originally wanted to build a homoiconic lisp for netscape and built many of the features into javascript instead. Still no a lisp ,but it was designed to be similar. http://www.2ality.com/2011/03/javascript-how-it-all-began.ht...
Re:Redline Smalltalk V1.0 by bgarbiak on Monday November 26, 2012 @10:39AM (#4832361)
Crockford called it "Lisp in C's Clothing" and then created this: http://www.crockford.com/javascript/little.html
Re:Redline Smalltalk V1.0 by Jach on Monday November 26, 2012 @11:10AM (#4832522)
I like the comparisons with ClojureScript: http://himera.herokuapp.com/synonym.html The major thing that continues to really annoy me about JS is the lack of proper lexical scoping, other deficiencies are just slight annoyances now (especially with a couple libraries that help the language be tolerable in certain use cases--e.g. https://github.com/coolaj86/futures).
Re:Redline Smalltalk V1.0 by klibertp on Monday November 26, 2012 @12:11PM (#4832815)
JS has no "proper lexical scoping"? How so? I'm really curious... what your definition of "proper" is here, because JS definitely has lexical scoping.
Re:Redline Smalltalk V1.0 by jerf on Monday November 26, 2012 @12:30PM (#4832889)
Paste this into your browser location bar (it won't navigate away):

    javascript:void(function(){a = 1; {var a = 2;} alert(a)}())
That var a doesn't declare a new var within its scope, it declares it in the function, plus it is counterintuitive how that var a "retroactively" makes that local scope. Javascript has lexical scoping, but only within functions, not within all the scopes other languages have.
Re:Redline Smalltalk V1.0 by secoif on Monday November 26, 2012 @12:54PM (#4832991)
You want block scoping. Block scoping is coming in ES6 with the let keyword.
Re:Redline Smalltalk V1.0 by klibertp on Tuesday November 27, 2012 @06:39AM (#4836703)
Python is the same here, for example, any many other languages too. Making `a` a local variable here is rather ugly thing to do, but it's (somewhat) consistent with how `function` keyword (not an expression) works.

The point being: JS implements full and proper lexical scoping; implementing lexical scoping for every block is not a requirement for having lexical scoping.

Re:Redline Smalltalk V1.0 by draegtun on Tuesday November 27, 2012 @04:59AM (#4836446)
> "Lisp in C's Clothing"

And Perl probably has an even greater claim to this because it shares 6 of the 7 What Makes Lisp Different? things described by Norvig.