Re: [Vala] Rv: C to Vala

2012-09-21 Thread Mario Daniel Ruiz Saavedra
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 
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 
> An: Mario Daniel Ruiz Saavedra 
> CC: Vala List 
> 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


Re: [Vala] Rv: C to Vala

2012-09-21 Thread Gilzad Hamuni
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 
> An: Mario Daniel Ruiz Saavedra 
> CC: Vala List 
> 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


Re: [Vala] Rv: C to Vala

2012-09-20 Thread Eric Gregory
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


Re: [Vala] Rv: C to Vala

2012-09-20 Thread Mario Daniel Ruiz Saavedra


Unlikely. You are confusing translate with transform. Please argue properly.


 De: Jonas Kulla 
Para: Mario Daniel Ruiz Saavedra  
CC: Vala List  
Enviado: Jueves, 20 de septiembre, 2012 13:55:50
Asunto: Re: [Vala] Rv: C to Vala
 



2012/9/20 Mario Daniel Ruiz Saavedra 

What hinders it from making it the other way (taking c code which heavily uses 
GLib, and turning it into Vala Code)?
>

 The same thing that hinders an oven from producing flour and water from bread 
I suppose.___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Rv: C to Vala

2012-09-20 Thread Jonas Kulla
2012/9/20 Mario Daniel Ruiz Saavedra 

> What hinders it from making it the other way (taking c code which heavily
> uses GLib, and turning it into Vala Code)?
>


The same thing that hinders an oven from producing flour and water from
bread I suppose.
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Rv: C to Vala

2012-09-20 Thread Mario Daniel Ruiz Saavedra
Once the Vala to C rules are defined, the inverse rules should work for C to 
vala, at least in a 80%
- Mensaje original -
De: Landon Blake 
Para: Mario Daniel Ruiz Saavedra 
CC: 
Enviado: Jueves, 20 de septiembre, 2012 12:47:10
Asunto: Re: [Vala] Rv: C to Vala

It would be possible to take a program that translates English to
Spanish and make it translate Spanish to English, but I think it would
take some major tweaking. I'm sure the same concept applies to the
Vala compiler.

Landon

On Thu, Sep 20, 2012 at 10:23 AM, Mario Daniel Ruiz Saavedra
 wrote:
> valac takes Vala code, analyzes it, and generates C code accordingly. What 
> hinders it from making it the other way (taking c code which heavily uses 
> GLib, and turning it into Vala Code)? Also, whould prove correctness, as 
> doing Vala to C and then C to Vala should produce similar code.
> - Mensaje original -
> De: Landon Blake 
> Para: Mario Daniel Ruiz Saavedra 
> CC:
> Enviado: Jueves, 20 de septiembre, 2012 11:38:53
> Asunto: Re: [Vala] Rv: C to Vala
>
> Mario:
>
> I've just started using Vala, but I think I can take a stab at your questions.
>
> Vala is compiled to C, C is not compiled to Vala. Therefore, I don't
> think there would be an easy and automated way to convert C code into
> Vala code.
>
> Does that make sense?
>
> Landon
>
> On Wed, Sep 19, 2012 at 4:05 PM, Mario Daniel Ruiz Saavedra
>  wrote:
>> I'll resend this, hoping for an answer :D
>>
>>
>> - Mensaje reenviado -
>> De: Mario Daniel Ruiz Saavedra 
>> Para: Vala List 
>> CC:
>> Enviado: Viernes, 17 de agosto, 2012 0:28:58
>> Asunto: C to Vala
>>
>>
>>
>> Is it possible that, having a program written in C, making full use of GLib, 
>> a conversion from c to vala would be plausible? Obviously, rewrite the 
>> application should be the way to go, but at least for giving an overview of 
>> how the new design may look, especially if you did not write the app, such 
>> feature would be useful.
>> ___
>> 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


Re: [Vala] Rv: C to Vala

2012-09-20 Thread Mario Daniel Ruiz Saavedra
valac takes Vala code, analyzes it, and generates C code accordingly. What 
hinders it from making it the other way (taking c code which heavily uses GLib, 
and turning it into Vala Code)? Also, whould prove correctness, as doing Vala 
to C and then C to Vala should produce similar code.
- Mensaje original -
De: Landon Blake 
Para: Mario Daniel Ruiz Saavedra 
CC: 
Enviado: Jueves, 20 de septiembre, 2012 11:38:53
Asunto: Re: [Vala] Rv: C to Vala

Mario:

I've just started using Vala, but I think I can take a stab at your questions.

Vala is compiled to C, C is not compiled to Vala. Therefore, I don't
think there would be an easy and automated way to convert C code into
Vala code.

Does that make sense?

Landon

On Wed, Sep 19, 2012 at 4:05 PM, Mario Daniel Ruiz Saavedra
 wrote:
> I'll resend this, hoping for an answer :D
>
>
> - Mensaje reenviado -
> De: Mario Daniel Ruiz Saavedra 
> Para: Vala List 
> CC:
> Enviado: Viernes, 17 de agosto, 2012 0:28:58
> Asunto: C to Vala
>
>
>
> Is it possible that, having a program written in C, making full use of GLib, 
> a conversion from c to vala would be plausible? Obviously, rewrite the 
> application should be the way to go, but at least for giving an overview of 
> how the new design may look, especially if you did not write the app, such 
> feature would be useful.
> ___
> 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


[Vala] Rv: C to Vala

2012-09-19 Thread Mario Daniel Ruiz Saavedra
I'll resend this, hoping for an answer :D


- Mensaje reenviado -
De: Mario Daniel Ruiz Saavedra 
Para: Vala List 
CC: 
Enviado: Viernes, 17 de agosto, 2012 0:28:58
Asunto: C to Vala



Is it possible that, having a program written in C, making full use of GLib, a 
conversion from c to vala would be plausible? Obviously, rewrite the 
application should be the way to go, but at least for giving an overview of how 
the new design may look, especially if you did not write the app, such feature 
would be useful.
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list