What scripting languages can be used with the HTML5 canvas element?
Asked Answered
W

2

10

What scripting languages can be used with the HTML5 canvas element? This question may really come down to "what scripting languages are commonly supported by browsers?"

Nearly all of the HTML5 canvas examples/tutorials use JavaScript. Some use processing, but even those fall back to Processing.js to do the rendering. Are there any good alternatives to JavaScript for interactive animation in a canvas?

Wales answered 2/3, 2010 at 18:48 Comment(1)
Processing is not a language, it's a JavaScript library.Hitt
S
11

Yes, when it comes to the canvas tag, it's all about JavaScript. Read more at http://en.wikipedia.org/wiki/Canvas_element

No, there are no alternatives if you want to use the <canvas> tag. JavaScript is the only language that is widely supported in web browsers without plugins.

If you want alternatives, you cannot use <canvas>. Two alternatives for custom painting in browsers are ActionScript/Flash (requires Flash plugin) and Java Applets or JavaFX/JavaFX Script.

Stomatology answered 2/3, 2010 at 18:57 Comment(1)
The world has spoken: Applets are not an alternative.Hitt
K
6

You can use languages that compile to JavaScript:

Note that GWT adds a lot of bulk to your page and I’m not sure it’s really such a great idea in any case.

Haxe always includes its standard library in JavaScript output, so it adds a little bulk to the page.

CoffeeScript and Kaffeine are very thin layers over JavaScript, and don’t add any extra bulk to your page other than your code. The JavaScript output by CoffeeScript is often significantly shorter than it would have been had you written the JavaScript by hand.

You will certainly need to know JavaScript to debug your code, no matter what language you write in.

Kaput answered 18/8, 2010 at 3:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.