Doing some research, i found something relevant: http://razum.si/automagical/

It's not the same, but uses the same principle i've thought, declaring some 
rules about when finding a class declaration, translate; etc. Shouldn't be that 
hard, for a good declarative programmer (i'm not one, not even a coder). No 
bytecode needed, for i wasn't talking about decompiling. The idea is, given a C 
code with total use of GLib, can that be translated to Vala code? I wonder if 
there is some real problem holding back that possibility.

________________________________
 De: Gilzad Hamuni <gil...@gmx.net>
Para: vala-list@gnome.org 
Enviado: Viernes, 21 de septiembre, 2012 10:33:38
Asunto: Re: [Vala] Rv: C to Vala
 
If I understand correctly, that approach requires an intermediate bytecode 
either from Java or from .NET to finally create sourcecode.

Alas, in the OP's case the best we can get would be native machine code (being 
different for x64, i386, arm, etc) so the parser wouldn't be able to stick to 
one static 'syntax', even if it would support Vala as an output.

I'm guessing here, but: If it's possible to automatically generate vapi's out 
of g-object-based libraries, then a similar tool might be able to create 
vala-code out of g-object-based sourcecode. But I'm really just guessing here, 
not knowing anything about the effort behind it.
At least the need for such a tool (that turns C-code into Vala just before 
C-code is generated again) proves that vala is a favourable language :)


Interesting though that XMLVM can create Objective-C-code.


Gilzad








-------- Original-Nachricht --------
> Datum: Thu, 20 Sep 2012 12:09:39 -0700
> Von: Eric Gregory <e...@yorba.org>
> An: Mario Daniel Ruiz Saavedra <desideran...@rocketmail.com>
> CC: Vala List <vala-list@gnome.org>
> Betreff: Re: [Vala] Rv: C to Vala

> On Thu, Sep 20, 2012 at 12:01 PM, Mario Daniel Ruiz Saavedra <
> desideran...@rocketmail.com> wrote:
> 
> >
> >
> > Unlikely. You are confusing translate with transform. Please argue
> > properly.
> >
> 
> 
> He's right though -- the relationship between C and Vala is not 1:1 unless
> the C code was generated by valac.  Converting arbitrary C code into Vala
> is possible, but unwieldy.
> 
> A professor from my college days did a project that converts between
> various languages.  It's quite complex, but amazingly all the conversion
> is
> done in XSLT.  I'd recommend checking it out to see what kind of territory
> you're wading into here: http://xmlvm.org
> 
>  - Eric
_______________________________________________
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list
_______________________________________________
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to