emscripten

bearophile bearophileHUGS at lycos.com
Sun Dec 19 05:15:14 PST 2010


Adam Ruppe:

> Which brings me to emscripten... it most certainly does not work well! The Python
> example took a couple *minutes* to load for me, and actually running some python
> code took seconds each time.

On a more modern browser it works "well enough" (Firefox 4). Do you realize that the source code of CPython is a LOT of code, we are talking about a JavaScript source file of 2.6 MB, after compression! So just seeing it compile and be able to run it and run some Python scripts is a marvel for me :-) So I think emscripten is a very nice toy. I have not yet tried to use LDC & emscripten to convert some D1 code to JS.

Regarding the JavaScript language, they are going to fix some of its biggest mistakes (but not semicolons yet, hopefully later), so JS is gaining speed, fixing its mistakes, and gaining power (canvas, WebGL, audio, video, other widgets, frameworks, etc):
http://www.yuiblog.com/blog/2010/12/14/strict-mode-is-coming-to-town/

An interesting part from that blog post, that reminds us that D2 has sadly failed to fix this problem (and the octal!x syntax is not a significant improvement of the situation):

>In C, an extremely unfortunate representation of octalness was selected: Leading zero. So in C, 0100 means 64, not 100, and 08 is an error, not 8. Even more unfortunately, this anachronism has been copied into nearly all modern languages, including JavaScript, where it is only used to create errors. It has no other purpose. So in strict mode, octal forms are no longer allowed.<

Bye,
bearophile


More information about the Digitalmars-d mailing list