D to ASM.js vs D to Dart (VM)

Etienne via Digitalmars-d digitalmars-d at puremagic.com
Thu May 15 14:01:13 PDT 2014


On 2014-05-15 4:48 PM, bearophile wrote:
> Etienne:
>
>> the solution is to introduce a D to Dart compiler[2]. This compiler
>> would be written in D with Pegged,
>
> How much RAM is this going to use?
>
> Bye,
> bearophile

Good question, I'd be aiming for a 64 bit compiler with ~4 GB max memory 
usage, the ASN.1 compiler I made with pegged stayed well below 2 GB with 
1000 lines of BNF->PEG rules unless I had 700+ lines of code to parse 
(which check every OR possibility at 3 levels deep for the longest 
matching solution).

It's very efficient when you generate the grammar in a separate D file 
and make good use the garbage collector rather than mixin the grammar 
directly. 
https://github.com/globecsys/asn1.d/blob/master/asn1/parser/parser.d#L1022


More information about the Digitalmars-d mailing list