Some combinatorics?

Robert Jacques sandford at jhu.edu
Sun Apr 3 20:52:58 PDT 2011


On Sun, 03 Apr 2011 12:22:24 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> On 4/3/11 10:50 AM, Robert Jacques wrote:
>> On Sun, 03 Apr 2011 09:55:54 -0400, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>
>>> On 4/3/11 8:31 AM, Philippe Sigaud wrote:
>>>> David:
>>>>
>>>>> Some code by Philippe Sigaud does it better than my implementations
>>>>> (http://svn.dsource.org/projects/dranges/trunk/dranges/docs/algorithm.html)
>>>>> and is
>>>>> Boost licensed. �He was thinking of getting parts of this lib into
>>>>> Phobos, but I
>>>>> don't know what the status of that is. �If this project is abandoned
>>>>> and you like
>>>>> it, you could take it over, or you could just write your own.
>>>>
>>>> Hi there,
>>>>
>>>> I was even invited into Phobos by Andrei in August (so, before the
>>>> Git migration). I
>>>> intended to cut the more 'Phobos-y' parts of dranges and present them
>>>> for inclusion.
>>>> It's just, I was then propelled two levels upwards hierarchically and
>>>> things have been a
>>>> bit hectic since then. I don't have any time right now to participate
>>>> in Phobos. If I
>>>> ever get some rest, I'll formally knock on the door again.
>>>>
>>>> I still read the D mailing lists with interest (even more so when I
>>>> see the rate at
>>>> which bugs are corrected). dranges is Boost licensed specifically to
>>>> be compatible with
>>>> Phobos. If anyone is interested in using it in any way (even
>>>> proposing it for Phobos
>>>> inclusion), you have my permission.
>>>>
>>>>
>>>> Philippe
>>>
>>> Congrats. Were you the one working on a simple JSON replacement?
>>>
>>> Andrei
>>
>> I've been working on a JSON replacement.
>
> Apologies, I had the names mangled.
>
> What is the status of that? Do you think you could use a student's help  
> for completing and expanding that work?
>
>
> Thanks,
>
> Andrei

No problem. I'd say JSON is now basically ready for review. However, it is  
dependent on my improvement to std.variant. Variant core code is close to  
being ready for a rough review; I'm doing a code cleanup and documentation  
pass right now. But I feel a need to do a thorough review / update the  
unit tests, particularly for Algebraic and Prototype, in part because of  
alias this issues, new functionality, etc.

As for completing and expanding the work, there are a couple of issues  
that might be of interest:
- Currently, Json is an Algebraic type, which means that methods that act  
on Json values, like toStringHR or isValid, must be called as  
JSON.isValid(json). This isn't terrible, but it would be nice to be able  
to add functions to an algebraic type. I've been thinking of ways this  
might be done, i.e. detecting template parameters of the form  
function(Algebraic, args), but I haven't gotten around to trying it yet.
- Serialization: Currently, Json supports a simple form of serialization,  
which currently requires first constructing a json value before/after  
writing/parseing can occur. So methods to provide direct  
serialization/de-serialization would be a good extension. Also, there is  
the general question of serialization with polymorphism support, etc. ala  
Orange.
- Reflection: I've added some basic compile-time to runtime reflection  
capabilities to Variant, but I don't know (from a design perspective)  
where to go beyond var.x == 10 or foo.bar(10,20). And good runtime  
reflection folds into serialization.
- Prototype: I've added a proof-of concept Prototype class, which  
uses/tests some of variant's reflection capabilities. But some good use  
cases/unit tests would really flesh this out.

 


More information about the Digitalmars-d mailing list