Scala 类似 JavaScript 的替代品
有没有像 Scala 一样的 JavaScript 替代品?我正在寻找具有以下特性的语言:
- 嵌入 XML
- 比经典 JavaScript 更好的标准库
- 隐式转换
Is there any Scala like alternative to JavaScript? I'm looking for language with:
- Embeded XML
- Better standard library than classic JavaScript
- Implicit Conversion
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
有一个项目“Scala+GWT”编译Scala -> GWT 中间目标。然后 GWT 可能会将其编译为 JavaScript。 http://scalagwt.github.com/
There is a project "Scala+GWT" that compiles Scala -> a GWT intermediate target. GWT then presumably compiles it to JavaScript. http://scalagwt.github.com/
并不真正符合您的要求,但回答您最初的问题“有没有像 Scala 这样的 JavaScript 替代品?”:
如果您不喜欢 Ruby/Python/Coffescript,您也许应该看看谷歌新语言 Dart 的技术预览:
http://www.dartlang.org/
乍一看很像java,但有很多优点这也让人感觉很糟糕。
(但不要错误地将其视为另一个 Scala。只有 Scala 才是 Scala!)
Not truly matching your requirements, but answering your initial question "Is there any Scala like alternative to JavaScript? ":
If you do not like Ruby/Python/Coffescript, you should perhaps have a look at the technology preview of google's new language Dart:
http://www.dartlang.org/
Looks very java-ish on a first glance, but has many niceties that make it feel scalastic too.
(But do not make the mistake to approach it as another Scala. Only Scala is Scala!)
我认为你能得到的最好的就是像 CoffeeScript 这样的东西,它最终会编译为 JavaScript 。 AFAIK,浏览器没有任何其他支持 DOM 的跨浏览器客户端语言。
I think the best you're going to get is something like CoffeeScript, which ultimately compiles to JavaScript. AFAIK, browsers don't have any other cross-browser client-side language with DOM support.
还有一种 Fantom 语言。在其网站的主页上写着:编写可移植到 Java VM、.NET CLR 的代码,和浏览器中的 JavaScript。
There's also a Fantom language. On the main page of its site which it says: Write code portable to the Java VM, .NET CLR, and JavaScript in the browser.
Scala.js
可能就是您正在寻找的内容:“Scala.js 将 Scala 代码编译为 JavaScript,允许您完全用 Scala 编写 Web 应用程序!”
站点:http://www.scala-js.org/
Github:https://github.com/scala-js/scala-js
Scala.js
might be what you are looking for:"Scala.js compiles Scala code to JavaScript, allowing you to write your Web application entirely in Scala!"
Site: http://www.scala-js.org/
Github: https://github.com/scala-js/scala-js