News for hackers. Stuff that matters.
Re:"Move" — a simpler programming language as a subset of Ja... by tomstuart on Monday February 14, 2011 @03:57AM (#2216001)

  Move is a subset of JavaScript [...] The following three examples are all valid Move code while the last one is also valid JavaScript code
You keep using that word. I do not think it means what you think it means.
Re:"Move" — a simpler programming language as a subset of Ja... by rgbrgb on Monday February 14, 2011 @09:48AM (#2216896)
It says subset in the title and superset in the description.
Re:"Move" — a simpler programming language as a subset of Ja... by samwillis on Monday February 14, 2011 @04:11AM (#2216030)
I think it is more accurately described as a superset of javascript, Just as C++ is(nt) a superset of C.
Re:"Move" — a simpler programming language as a subset of Ja... by paradoja on Monday February 14, 2011 @06:18AM (#2216343)
It is neither. It is another language which can be interpreted from JS through a library.

The difference in the semantics of «==» is an example. Also, it does not have things that JS has, and has other things JS doesn't.

Re:"Move" — a simpler programming language as a subset of Ja... by mambodog on Monday February 14, 2011 @05:16AM (#2216207)
Or as Objective-C is a superset of C.
Re:"Move" — a simpler programming language as a subset of Ja... by Maro on Monday February 14, 2011 @05:14AM (#2216197)
I don't think Javascript being too complicated is a real world problem.
Re:"Move" — a simpler programming language as a subset of Ja... by KeithMajhor on Monday February 14, 2011 @06:38AM (#2216381)
Javascript isn't complicated but it does have some ugly boiler-plate. I would love to see C# style lambda's in Javascript.

C# style: var item_names = $( "li.menu_item span" ).map( x => x.innerHTML )

JS style: var item_names = $( "li.menu_item span" ).map( function( x ) { return x.innerHTML } )

Re:"Move" — a simpler programming language as a subset of Ja... by Skofoo on Monday February 14, 2011 @09:49AM (#2216901)
CoffeeScript has C#-esque lambdas.

item_names = $("li.menu_item span").map (x) -> x.innerHTML

Re:"Move" — a simpler programming language as a subset of Ja... by silverlake on Monday February 14, 2011 @09:59AM (#2216935)
yeah, but the parser is messed up because it is whitespace sensitive. This would fail: compose (x)-> f(x) (y)-> g(y).
Re:"Move" — a simpler programming language as a subset of Ja... by lhorie on Monday February 14, 2011 @02:57PM (#2218344)
javascript 1.8:

$("li.menu_item span").map(function(x) x.innerHTML)

for that particular exaple, you could also steal pluck() from Prototype.js:

$("li.menu_item span").pluck("innerHTML")

Re:"Move" — a simpler programming language as a subset of Ja... by olalonde on Monday February 14, 2011 @04:00AM (#2216010)
Now the question is, does it meet HN's notability requirements?
Re:"Move" — a simpler programming language as a subset of Ja... by andolanra on Monday February 14, 2011 @07:05AM (#2216443)

    Variables need not be explicitly declared. Move will
    declare a newfound variable in the scope which it first
    was used.
How does this interact with lexical scope? For example, how would the go-to counter example (in JavaScript below) be expressed in Move?

    function makeCounter() {
        var x = 0;
        return function() {
            return x++;
        };
    }
Does Move not require declarations because it has implicit declarations whenever there's a usage of any variable? (In which case the above example couldn't be expressed without some kind of circumlocution—again, like in Python.) Or are variables always looked up in the outermost scope, so you can't have a variable whose name is shared by another variable in an enclosing scope?

    No commas required to terminate expressions. Move will
    determine when a comma is needed so you don't have to
    (and the code gets more readable).
Given that all the code has commas in the same places as in JavaScript, I'm going to assume s/comma/semicolon, and s/expression/statement, to be pedantic.
Re:"Move" — a simpler programming language as a subset of Ja... by Andi on Monday February 14, 2011 @04:45AM (#2216119)
Functions return the result of the last expression -> Better use CoffeeScript - it's > 1.0 - it will save you even more work.
Re:"Move" — a simpler programming language as a subset of Ja... by igorw on Monday February 14, 2011 @04:59AM (#2216156)
> In JavaScript, there are two different ways to define a function: using the function expression and the function declaration statement, the latter having subtle restrictions. Move only has function expressions.

Except using named functions will also make your stack traces useful. Because function names tell you more than line numbers.

Re:"Move" — a simpler programming language as a subset of Ja... by Ezku on Monday February 14, 2011 @04:45AM (#2216117)
A subset? Doesn't seem so. Also doesn't seem to have anything on CoffeeScript.
Re:"Move" — a simpler programming language as a subset of Ja... by jamesrom on Monday February 14, 2011 @03:56AM (#2215998)
Step 1) Add some shortcuts to JavaScript

Step 2) Make it marginally more expressive

Step 3) ???

Step 4) Profit

Re:"Move" — a simpler programming language as a subset of Ja... by tilltheis on Monday February 14, 2011 @09:03AM (#2216767)
Maybe Rasmus wants to make writing Kod.app plugins easier?
Re:"Move" — a simpler programming language as a subset of Ja... by davidk0101 on Monday February 14, 2011 @03:55AM (#2215996)
This is really cool. I really like his take on lambda being ^.
Re:"Move" — a simpler programming language as a subset of Ja... by rdouble on Monday February 14, 2011 @03:58AM (#2216005)
Re:"Move" — a simpler programming language as a subset of Ja... by Charuru on Monday February 14, 2011 @03:39AM (#2215954)
What about coffeescript.
Re:"Move" — a simpler programming language as a subset of Ja... by dpritchett on Monday February 14, 2011 @09:20AM (#2216818)
CoffeeScript benefits from the work done on other JS dialects. Last year jashkenas rolled in "features and optimizations" from Coco which is itself a dialect of CoffeeScript [1].

http://news.ycombinator.com/item?id=2037996

Re:"Move" — a simpler programming language as a subset of Ja... by robwgibbons on Monday February 14, 2011 @01:19PM (#2217859)
JavaScript isn't simple enough already? I think libraries are the way to make syntactic sugar, not trying to replace the language itself.