ravi
ravi

Reputation: 797

What tools generate JavaScript?

Are there any good tools to generate JavaScript? I remember in .NET, there was Script# - don't know its status today.

Anyone have experience with any tools?

Upvotes: 4

Views: 6636

Answers (9)

tomdemuyt
tomdemuyt

Reputation: 4592

Try Haxe.

It can target JavaScript, ActionScript and Neko bytecode. The language is close to Java.

Upvotes: 0

OlliP
OlliP

Reputation: 1585

Kotlin can generate JavaScript out of Kotlin code. For Kotlin see http://kotlin.jetbrains.org/ and also http://devnet.jetbrains.com/thread/447468?tstart=0

Upvotes: 0

Tyler
Tyler

Reputation: 28874

As others have said, GWT is a very good option. To summarize some good points:

  • fast, very portable code using deferred binding; only loads the code that works on the user's browser, and only loads functions that are actually called; also, they're compressed
  • reliability; very few known issues
  • easier debugging using a Java-based IDE; you can also look directly at un-obfuscated javascript if you want to, but it seems (based on some reports I've seen & personal experience) that you basically never need this
  • good library support including a nice inline javascript interface, the ability to use existing Java libraries, and special support for ajax / rpc calls
  • extensible & stylistically flexible; you can fine-tune all styles with your own css rules, and extend the Widget base with your own Java subclasses

So I humbly disagree with dominic that the results are ugly since it is up to the coder to 'prettify' the basic functionality with their own css rules and other decorations. It would be the same mistake to call HTML 'ugly' - if you don't try hard, it isn't pretty, but the power and flexibility is in the hands of the coder.

Oh, and it's open source, too.

Upvotes: 2

BCS
BCS

Reputation: 78585

I've used D templates (think C++ without the pain and you'll be 50% there) to generate a AJAX based Object proxy.

Upvotes: 0

Jason Bunting
Jason Bunting

Reputation: 58931

I use my keyboard, a text editor and my brain to generate JavaScript.

:P

Upvotes: 3

dmazzoni
dmazzoni

Reputation: 13236

Google Web Toolkit is one option. Write Java code, debug it with a standard Java debugger, then press the "Compile" button and turn it into highly-optimized JavaScript. It generates completely separate JavaScript for each major browser family (IE, Firefox, Safari, etc.).

Very mature, very powerful, and easy to embed into an existing site. One downside is that the UIs it creates are ugly nested tables.

Upvotes: 0

Eric Schoonover
Eric Schoonover

Reputation: 48402

Latest version of Script# was posted less than a month ago. Nikhil continues to actively work on that project and it's a very good tool for generating JavaScript code from C#. It is actively used in a couple of different internal Microsoft projects.

Some of the benefits of Script# are:

  • Intellisense
  • Build errors at compile time
  • Refactoring support
  • Documentation support
  • FxCop code analysis
  • MSBuild support

Upvotes: 1

gizmo
gizmo

Reputation: 11909

There is currently a lot of tools to generate JavaScript, like GWT.

But giving you a good answer really depends on what is your originator language and what king of JavaScript functionnality you want to use.

Upvotes: 0

Related Questions