Need a Faster Compressor

Guillaume Boucher via Digitalmars-d digitalmars-d at puremagic.com
Tue May 24 13:27:02 PDT 2016


On Tuesday, 24 May 2016 at 20:16:32 UTC, Walter Bright wrote:
> On 5/24/2016 9:22 AM, Timon Gehr wrote:
>> Yes, it does. The compiler does not use exponential space to 
>> store the AST.
>
> BTW, all types in dmd have a 'deco' string which is the AST 
> linearized as a string. This string is also used to build the 
> mangled names.
>
> All the deco's are put into a hashtable, and then all types can 
> be uniquely identified by their address in the hashtable. This 
> reduces type comparisons to a single pointer comparison.

There's no reason not to use the compression in the deco name.  
Just make sure the references are relative and you're set.  No 
exponential space to store the AST.

Please, if you change the ABI, do it right the first time.  Some 
arbitrary compression algorithm doesn't solve the problem.




More information about the Digitalmars-d mailing list