DMDScript now under Boost license

bearophile bearophileHUGS at lycos.com
Wed Mar 31 05:10:56 PDT 2010


> What I think I'd like in D is something like this, but I think there's no need to use JavaScript for this, it can be used just D code:
> https://developer.mozilla.org/en/Treehydra

This page explains what Treehydra is:
https://developer.mozilla.org/En/Treehydra_Manual

>Treehydra is meant to be used for analyses that need more detail than Dehydra's flattened ASTs. Instead of representing code in "easy" form like Dehydra, Treehydra relies on GIMPLE, the GCC Internals "middle-end" intermediate representation.<

This is Dehydra, that's quite simpler to use:
https://developer.mozilla.org/en/Dehydra

Dehydra for example allows to add JavaScript callbacks to the compiler:
https://developer.mozilla.org/En/Dehydra/Function_Reference
>Callback Functions The following functions may be provided by the analysis script and will be called by Dehydra while compiling. See the Dehydra object reference for details on the available object properties.<

The nicer page about Dehydra can be this one:
https://developer.mozilla.org/En/Dehydra/Object_Reference

>Dehydra represents C++ types and variables as JavaScript objects. The objects are designed to distill that type system to the minimum such that it can be easy to match on.<

All those properties are present for all the variables, functions, etc, of the C++ code. Such static reflexivity can be useful in D too, to extend the type system a little, for user-defined properties, as a starting point to implement macros.

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list