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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Colony, an experimental JavaScript-to-Lua compiler

31 点作者 timcameronryan超过 13 年前

5 条评论

timcameronryan超过 13 年前
Hey all, I'm posting this to HN to see if there's any interest in a full-fledged JavaScript port to Lua. Colony right now is a proof-of-concept, but there might be a real use case out there for embeddable JavaScript where solutions like V8 would simply be too large.<p>Since it's a source-to-source compiler, you can use Colony generally wherever Lua source is required. For example, I was able to follow the beginners tutorials of the Corona SDK (<a href="http://www.anscamobile.com/corona/" rel="nofollow">http://www.anscamobile.com/corona/</a>, a cross-platform mobile SDK that uses Lua) by programming CoffeeScript instead, which was surprisingly fun.
评论 #3161438 未加载
评论 #3160437 未加载
评论 #3161218 未加载
ZitchDog超过 13 年前
Lua is a great language. I personally would rather go the other way and use Lua instead of JS in the browser.<p>This is cool though from a hacking perspective. Good work.
fab13n超过 13 年前
In which cases would anyone need:<p>- to write code in JS rather than in Lua;<p>- and run the result on a platform which supports Lua but not JS?<p>Except in a Dilbert-like situation, where a clueless middle manager decides that using a dirty hack is safer than letting JS programmers take the 2 days it would take them to become very proficient in Lua, I can't think of one.
评论 #3160533 未加载
评论 #3160509 未加载
friggeri超过 13 年前
The fun thing about transpilers is that you can chain them together. Waiting to see some C stuff ported to Lua using Emscripten via JS.
评论 #3160477 未加载
评论 #3161488 未加载
meric超过 13 年前
I remember google's dart that compiled to javascript which ran 7% as fast as hand-written javascript. I wonder what the performance for this will be compared to handwritten lua? I've tried wrapping everything into tables like this in lua, and there definitely is a performance penalty.<p>I guess programmers will always be programmers. "Ooo look, this year CPU speed has quadtripled! Let's make a compiler for X to Y which will reduce performance by only 75%; It means you can run it at the same speed as running hand-written Y last year!"<p>I'll cringe when I see someone creating a WoW addon using this.