Dart bindings for D?
via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Oct 30 02:52:15 PDT 2014
On Thursday, 30 October 2014 at 09:35:04 UTC, Suliman wrote:
>> It is possible, but you need to design the language within the
>> constraints of javascript:
>>
>> 1. single threaded (or worker threads)
Javascript is single threaded by nature. Parallel execution is
done in isolation. No shared memory.
>> 2. 53 bits integers, 26 bits for multiplies.
Javascript only support double. Double has 53 bits precision. So
without emulation javascript support:
53 bit division /
52 bit addition +, -
32 bit masking &, |
26 bit fast multiply *
>> 4. "weird" fixed size heaps (ArrayView)
You can allocate a fixed size byte array and put aligned typed
views on it in modern browsers. This is used in asm.js
>> 5. if garbage collection then it has to be javascript style
You have no notion of a stack in javascript. You are therefore
stuck with what javascript provides.
>> 6. no tricks: forget coroutines
You cannot implement your own coroutines without an emulation
layer which will be heavy.
> I can't understand why this restructions? Could you explain
> them?
The restrictions come from what javascript can do efficiently
(execution time, code size and memory use).
More information about the Digitalmars-d-learn
mailing list