TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

"Move" — a simpler programming language as a subset of JavaScript

38 点作者 tonyskn超过 14 年前

11 条评论

tomstuart超过 14 年前
<p><pre><code> Move is a subset of JavaScript [...] The following three examples are all valid Move code while the last one is also valid JavaScript code </code></pre> You keep using that word. I do not think it means what you think it means.
评论 #2216896 未加载
评论 #2216030 未加载
Maro超过 14 年前
I don't think Javascript being too complicated is a real world problem.
评论 #2216381 未加载
olalonde超过 14 年前
Now the question is, does it meet HN's notability requirements?
andolanra超过 14 年前
<p><pre><code> Variables need not be explicitly declared. Move will declare a newfound variable in the scope which it first was used. </code></pre> How does this interact with lexical scope? For example, how would the go-to counter example (in JavaScript below) be expressed in Move?<p><pre><code> function makeCounter() { var x = 0; return function() { return x++; }; } </code></pre> 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?<p><pre><code> 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). </code></pre> 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.
Andi超过 14 年前
Functions return the result of the last expression -&#62; Better use CoffeeScript - it's &#62; 1.0 - it will save you even more work.
igorw超过 14 年前
&#62; 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.<p>Except using named functions will also make your stack traces useful. Because function names tell you more than line numbers.
Ezku超过 14 年前
A subset? Doesn't seem so. Also doesn't seem to have anything on CoffeeScript.
jamesrom超过 14 年前
Step 1) Add some shortcuts to JavaScript<p>Step 2) Make it marginally more expressive<p>Step 3) ???<p>Step 4) Profit
评论 #2216767 未加载
davidk0101超过 14 年前
This is really cool. I really like his take on lambda being ^.
评论 #2216005 未加载
Charuru超过 14 年前
What about coffeescript.
评论 #2216818 未加载
robwgibbons超过 14 年前
JavaScript isn't simple enough already? I think libraries are the way to make syntactic sugar, not trying to replace the language itself.