admin管理员组

文章数量:1419244

Is there any Scala like alternative to JavaScript? I'm looking for language with:

  • Embeded XML
  • Better standard library than classic JavaScript
  • Implicit Conversion

Is there any Scala like alternative to JavaScript? I'm looking for language with:

  • Embeded XML
  • Better standard library than classic JavaScript
  • Implicit Conversion
Share Improve this question edited Oct 18, 2011 at 7:18 tereško 58.5k25 gold badges100 silver badges150 bronze badges asked Oct 17, 2011 at 20:32 MateuszMateusz 4984 silver badges17 bronze badges 9
  • 1 I guess he meant implicit conversion – Ben James Commented Oct 17, 2011 at 20:36
  • 2 Where do you want to run that code ? Browser, server, desktop, toaster ? – nos Commented Oct 17, 2011 at 20:36
  • In a browser. This language should have DOM support – Mateusz Commented Oct 17, 2011 at 20:38
  • 2 That means that at the end of the day you'll have to produce . Also note that user-defined implicit conversions (unless intended to be fully dynamic, which introduces notable overhead to pretty much every operation everywhere) require a static type system. – user395760 Commented Oct 17, 2011 at 20:40
  • 3 Some typed alternatives in that list: github./jashkenas/coffee-script/wiki/… – Debilski Commented Oct 18, 2011 at 0:44
 |  Show 4 more ments

5 Answers 5

Reset to default 4

There is a project "Scala+GWT" that piles Scala -> a GWT intermediate target. GWT then presumably piles it to JavaScript. http://scalagwt.github./

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/

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!)

I think the best you're going to get is something like CoffeeScript, which ultimately piles to JavaScript. AFAIK, browsers don't have any other cross-browser client-side language with DOM support.

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 might be what you are looking for:

"Scala.js piles Scala code to JavaScript, allowing you to write your Web application entirely in Scala!"

Site: http://www.scala-js/

Github: https://github./scala-js/scala-js

本文标签: Scala like alternative to JavaScriptStack Overflow