D => asm.js for the web?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Mar 22 19:37:55 PDT 2013


On Sat, Mar 23, 2013 at 03:34:54AM +0100, Adam D. Ruppe wrote:
> On Saturday, 23 March 2013 at 02:20:33 UTC, bearophile wrote:
> >I think someone will be happy to use D instead of C/C++ on the web
> >for performance-sensitive code, like games.
> 
> If it compiles to any kind of javascript it is a mistake to think
> they'll be a performance boost over just writing javascript, with or
> without annotations. Odds are there will be leaky abstractions in
> the compile process that can hurt speed.

Any kind of translation from language X to language Y will incur at
least the performance overhead of language Y, plus some incidental
overhead incurred by non-trivial or imperfect mapping of X's features to
Y'es features. This incidental overhead is rarely every zero.

So there is no way translating from language X to language Y will be
faster than writing in language Y in the first place, no matter how good
your optimizer is. Otherwise, you might as well just write in language Y
to begin with, and run the optimizer on *that*.


T

-- 
Nothing in the world is more distasteful to a man than to take the path that leads to himself. -- Herman Hesse


More information about the Digitalmars-d mailing list