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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

MoonScript - A programmer friendly language that compiles to Lua.

107 点作者 newtonapple将近 14 年前

18 条评论

jacques_chester将近 14 年前
I quite like the lua syntax as-is.<p>It's simple, predictable and easy to read.<p>This obsession with boiling everything down to strings of symbols is how folk wind up making fun of Perl and OCaml.<p>What's this do?<p><pre><code> $$&#38;[%] </code></pre> Or this?<p><pre><code> ?:&#62; </code></pre> Buggered if I know. <i>Only a professional Perl or OCaml programmer could tell you</i> -- and indeed I made those up. Only a professional Perl or OCaml programmer could tell if they do anything at all.<p>But pretty much anyone from any language background can eyeball an Algol-family syntax and tell you what's going down.
评论 #2872034 未加载
评论 #2871977 未加载
评论 #2872004 未加载
gmac将近 14 年前
Almost all the examples look like pure CoffeeScript (so I find it strange that this isn't mentioned/namechecked anywhere on the site).<p>Edit: happily, an attribution has now been added at the bottom, as noted in child comments.
评论 #2871899 未加载
评论 #2871849 未加载
评论 #2871897 未加载
评论 #2871839 未加载
skrebbel将近 14 年前
In all honesty, what's the point of this? I understand the point of compiling to JavaScript simply because that's the only language that runs on the most ubiquitous platform in the world. Why compile to any other high-level language?<p>Are there so many similar places where users are forced to use Lua, to warrant an extra layer? (with all the complexities such as debugging, a compile step, tracing errors back to MoonScript code, etc)<p>Note, I'm not commenting about the language's choices. Maybe coding in MoonScript rocks big time. I just don't get why it compiles to Lua.
评论 #2873761 未加载
评论 #2872373 未加载
评论 #2872734 未加载
评论 #2873838 未加载
评论 #2872941 未加载
wildmXranat将近 14 年前
If this compiles into Lua/JIT bytecode then there might be a use for it, if this transforms into Lua code then what is the point? Lua is a great and simple language, so this would seem useless
评论 #2872559 未加载
评论 #2872819 未加载
评论 #2872790 未加载
评论 #2872847 未加载
neworbit将近 14 年前
Very cool. I confess I'm not likely to use it anytime soon, since I am conversant with how Lua works today and not so much with Coffeescript, but I'm glad for the aid to adoption!
rbxbx将近 14 年前
The killer feature of MoonScript would be 0 based indexes. See no mention of it though...
aashay将近 14 年前
Anybody try writing an iPhone app with MoonScript -&#62; Lua -&#62; Wax -&#62; Objective C?
评论 #2871891 未加载
stephth将近 14 年前
This looks very promising. Congrats on the launch.<p>I am enjoying this wave of new programming languages that compile down to existing ones in a human readable way. They are pleasant to write and read and yet performant and don't require a special runtime, making them easy to integrate anywhere in their parent language.<p>I hope someone talented will build one of these for C/C++. Mobile an game developers could use it.
评论 #2872141 未加载
svdad将近 14 年前
Still don't understand the fad for "programmer-friendly" languages. Why on earth would you even start learning to program if you didn't find something diabolically fascinating about learning a new syntax for symbolic computation?<p>C, C++, APL, etc. all seem perfectly "programmer-friendly" to me, once you've learned them...
wsxiaoys将近 14 年前
Wow, i've asked this before, <a href="http://www.reddit.com/r/coffeescript/comments/hmtjv/what_about_implement_a_lua_backend_for/" rel="nofollow">http://www.reddit.com/r/coffeescript/comments/hmtjv/what_abo...</a><p>Really happy to see some action!
Herald_MJ将近 14 年前
Lua isn't programmer friendly?
评论 #2872491 未加载
clyfe将近 14 年前
There's also this effort <a href="https://github.com/CDR2003/coffee-script-lua" rel="nofollow">https://github.com/CDR2003/coffee-script-lua</a> don't know how far it reached tough.
blackRust将近 14 年前
The first thing I do is click on the 'Lua' link. <a href="http://ww.lua.org" rel="nofollow">http://ww.lua.org</a> Really? Please fix.
z92将近 14 年前
The next time I need to code in C, I shall try moonscript first. Thanks author for this great piece of software.
vjeux将近 14 年前
<a href="http://moonscript.org/reference/#considerations" rel="nofollow">http://moonscript.org/reference/#considerations</a><p><pre><code> b = x-10 is converted to local b = x(-10) </code></pre> This looks like to be really error prone.
malkia将近 14 年前
That looks very cool!
nknight将近 14 年前
Some of this is a definite improvement over Lua, but I'm getting really tired of some of these cute little syntaxes showing up everywhere, like '-&#62;' and '=&#62;' for creating functions, and what's with this:<p><i>! operator can be used to call a function with no arguments</i><p>Seriously?<p>I feel like people are coming up with these things just to be "different". Programming language syntax is a UI, and needs to be treated like one -- you don't make major changes to basic UI paradigms without convincing reason.<p>Edit: Maybe more to the point, you don't add random buttons to a UI that do non-obvious things. Language syntax should be self-evident and quickly readable, and shouldn't require careful parsing of individual characters.
评论 #2871953 未加载
hackinthebochs将近 14 年前
I will be extremely happy when the whitespace-for-blocks fad passes. I have a feeling it's going to be a long winter.
评论 #2872905 未加载