Beta

Slashdot: News for Nerds

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

JavaScript Assembly Language

mikejuk (1801200) writes | about a year ago

Programming 0

mikejuk (1801200) writes "The idea of using JavaScript as a modern day assembly language for browser code is being taken very seriously by Mozilla. Asm.js is a specification for a high performance JavaScript assembly language and OdinMonkey is an engine that runs it really fast. It is a detailed specification for a subset of JavaScript. Notice that while this means that this isn't a new language there are new features which would be ignored by a standard JavaScript engine. For example, the language only has strictly-typed integers, floats, arithmetic, function calls, and heap accesses. This is achieved using annotations in the form of comments and a restricted set of operations which only work with the data type — for example logical operators convert numeric values to int32.

The fact that asm.js is a subset of JavaScript means that you can take an asm.js program and run it in a standard unmodified browser or JavaScript engine. However, to get any real value from using it you need it to be run using an optimizing JavaScript engine. This is the second half of the project. Mozilla is working on OdinMonkey, a JavaScript engine that recognizes when it has been fed an asm.js program and can apply automatic optimizations.
At the moment asm.js runs no worse than half the speed of native code. So who needs NaCL or PNaCL — JavaScript might be all we need."

Link to Original Source

cancel ×

0 comments

Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...