6 ms·
"Move" — a simpler programming language as a subset of JavaScript
- Charuru 16y agoWhat about coffeescript.
- dpritchett 16y agoCoffeeScript 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 http://news.ycombinator.com/item?id=2037996
- davidk0101 16y agoThis is really cool. I really like his take on lambda being ^.
- rdouble 16y agoIt's lifted from C Blocks http://en.wikipedia.org/wiki/Blocks_(C_language_extension) http://en.wikipedia.org/wiki/Blocks_(C_language_extension)
- jamesrom 16y agoStep 1) Add some shortcuts to JavaScript Step 2) Make it marginally more expressive Step 3) ??? Step 4) Profit
- tilltheis 16y agoMaybe Rasmus wants to make writing Kod.app plugins easier?
- tomstuart 16y agoMove 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.
- olalonde 16y agoNow the question is, does it meet HN's notability requirements?
- Ezku 16y agoA subset? Doesn't seem so. Also doesn't seem to have anything on CoffeeScript.
- Andi 16y agoFunctions return the result of the last expression -> Better use CoffeeScript - it's > 1.0 - it will save you even more work.
- igorw 16y ago> 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.
- Maro 16y agoI don't think Javascript being too complicated is a real world problem.
- KeithMajhor 16y agoJavascript 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 } )
- Skofoo 16y agoCoffeeScript has C#-esque lambdas. item_names = $("li.menu_item span").map (x) -> x.innerHTML
- silverlake 16y agoyeah, but the parser is messed up because it is whitespace sensitive. This would fail: compose (x)-> f(x) (y)-> g(y).
- lhorie 16y agojavascript 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")
- andolanra 16y agoVariables 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.
- robwgibbons 16y agoJavaScript isn't simple enough already? I think libraries are the way to make syntactic sugar, not trying to replace the language itself.