Re: [Grammatica-devel] Keeping C# and Java in sync

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [Grammatica-devel] Keeping C# and Java in sync

hilco
(Moving this discussion to grammatica-users; please only reply on
grammatica-users.)

Mmmh, well I guess it was too good to be true. :-) Still, it would be
an interesting challenge to get this to work with only one code base.

Long term, we could write a parser (in Grammatica, of course) that
parses the Grammatica Java source and outputs it as C#. It would be an
excellent test case and very clear proof of the power of the tool. For
now, we'll just have to keep the two code bases in sync manually.

Another option might be (I don't know the code well enough to really
make this call) to break up the code into a runtime engine and
everything else. This runtime engine would presumably be really stable
so that working with two code bases would not be a big deal. The other
code would only be Java (i.e. you'd use Java initially to create the
parser [in C#] and then continue on with the C# runtime engine and the
generated parser). This is already very much like it is now, I would
imagine.

Definitely interesting. :-)

2009/9/20 Per Cederberg <[hidden email]>:

> Oh, I wish it was so! But unfortunately, if you analyze all the code
> in detail, you'll find that the devil is in the details. The are a
> number of minor, but critical, changes to the code and API that were
> required in order to make things work properly in C#. Sometimes these
> are for the better (using enums when Java had none), but sometimes
> they are for the worse.
>
> I've done the copy-paste operation enough times to know that I've
> corrected some porting bugs more than once, so I don't believe it
> would be possible to create an automatic tool to do the job. Also,
> there are quite a number of C# users for Grammatica apparently, so
> they might be a bit disappointed if it was less native than it
> currently is...
>
> Cheers,
>
> /Per
>
> On Sun, Sep 20, 2009 at 04:28, Hilco Wijbenga <[hidden email]> wrote:
>> Hi all,
>>
>> I noticed that the C# code is pretty much a copy of the Java code.
>> Would it not be possible to generate it from the Java code instead of
>> maintaining two separate code bases?
>>
>> The main differences are the namespaces, the use of "...
>> DoSomething(...)" instead of "... doSomething(...)" and some C#
>> specifics ("get" and "set"). If we don't mind foregoing some of the
>> C#-isms then I think the Java code can be reused almost verbatim.
>>
>> Thoughts?
>>
>> Cheers,
>> Hilco
>>
>>
>> _______________________________________________
>> Grammatica-devel mailing list
>> [hidden email]
>> http://lists.nongnu.org/mailman/listinfo/grammatica-devel
>>
>
>
> _______________________________________________
> Grammatica-devel mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/grammatica-devel
>


_______________________________________________
Grammatica-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/grammatica-users