September 06, 2014
On 9/6/2014 11:42 AM, Andrej Mitrovic via Digitalmars-d wrote:
> On 8/21/14, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>> The trouble is, D is not a perfect superset of C++, not even close
>
> I don't think that's important for porting. To quote:
>
> -----
> Engineering teams at Mozilla and Epic ported the award-winning Unreal
> Engine 3 (UE3) to the Web in just four days using the powerful
> combination of asm.js and Emscripten, which enables developers to
> compile C++ code into JavaScript.[1]
> -----
>
> [1] : https://www.unrealengine.com/news/epic-games-releases-epic-citadel-on-the-web
>
> I'm still amazed that this is even possible. But it makes me think
> what does JS have over D that makes this possible? I have a feeling
> it's only down to the number and capability of people working on such
> a project which guarantees it's success (JS is important, and the
> Unreal Engine is important).
>

I'd have to see the source code and the translated code to form any judgement about that.
September 06, 2014
On Saturday, 6 September 2014 at 20:06:51 UTC, Walter Bright wrote:
> I'd have to see the source code and the translated code to form any judgement about that.

AFAIK Emscripten is not a source-to-source translator. It is a LLVM backend. asm2js code is very cryptic. You basically have everything in one big array and weird javascript expressions that are meant to ensure that expressions are taken as typed by the JIT. You cannot reasonably expect to be able to modify the output by hand.
September 06, 2014
On Saturday, 6 September 2014 at 18:42:43 UTC, Andrej Mitrovic via Digitalmars-d wrote:
> On 8/21/14, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>> The trouble is, D is not a perfect superset of C++, not even close
>
> I don't think that's important for porting. To quote:
>
> -----
> Engineering teams at Mozilla and Epic ported the award-winning Unreal
> Engine 3 (UE3) to the Web in just four days using the powerful
> combination of asm.js and Emscripten, which enables developers to
> compile C++ code into JavaScript.[1]
> -----
>
> [1] : https://www.unrealengine.com/news/epic-games-releases-epic-citadel-on-the-web
>
> I'm still amazed that this is even possible. But it makes me think
> what does JS have over D that makes this possible? I have a feeling
> it's only down to the number and capability of people working on such
> a project which guarantees it's success (JS is important, and the
> Unreal Engine is important).

asm.js is NOT javascript.

asm.js is a bytecode format for native code, and a very inefficient one for that matter, as it uses the same syntax as javascript.

One of the said advantage of this format, is that it is retro-compatible with javascript. That mean that the bytecode can be interpreted as javascript and still works.

For some values of "works".

Indeed, run as javascript, asm.js is an order of magnitude slower. You can consider that compatible for toy program, but the reason to use asm.js to begin with is performance, and so an order of magnitude slower is not acceptable.

For the example of unity, that means unplayable games.

Once you understand that this retro-compatibility with javascript argument is bullshit, it is easily understood that asm.js is simply a variant of pNaCl, that uses bloated bytecode to provide extra useless features and create fragmentation.

Brendan Eich being CTO of mozilla when they dropped pNaCl in favor of asm.js is probably relevant.
1 2 3
Next ›   Last »