Re: [Vala] Support for coroutines in Vala

2011-07-06 Thread Luca Dionisi
Replace first line with:

async void foo () {

and compile with --pkg gio-2.0

On Wed, Jul 6, 2011 at 3:42 AM, Serge Hulne serge.hu...@gmail.com wrote:
 Support for coroutines in Vala:

 Has it been dropped ?

 otherwise how does one compile examples like:


 /

 void foo () yields {

        message (hello);
        yield;
        message (world);
 }

 void main () {
        foo.begin ();
        message (vala);

        var loop = new MainLoop (null, false);
        loop.run ();
 }

 /

 ___
 vala-list mailing list
 vala-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/vala-list


___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Support for coroutines in Vala

2011-07-06 Thread Luca Bruno
On Wed, Jul 06, 2011 at 03:42:09AM +0200, Serge Hulne wrote:
 Support for coroutines in Vala:

http://live.gnome.org/Vala/Tutorial#Asynchronous_Methods

-- 
http://www.debian.org - The Universal Operating System
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Support for coroutines in Vala

2011-07-06 Thread Serge Hulne
 If you need something more flexible then GIO asynchronous functions,
 look at GNU Pth.
 http://www.gnu.org/software/pth/

 If pth is what you need, I have written a vapi for it. Let me know.


Yes please, I am interested !
Basically the only feature of Go I miss in Vala are the Goroutines,
i.e. an easy way  to achieve concurrency.


 BTW notice that you did not include the mailing list in your answer.

Yes, you are right !


Thank you !
Serge
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Support for coroutines in Vala

2011-07-06 Thread Luca Dionisi
On Wed, Jul 6, 2011 at 9:21 AM, Serge Hulne serge.hu...@gmail.com wrote:
 If pth is what you need, I have written a vapi for it. Let me know.


 Yes please, I am interested !

I'll send you in private.
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Support for coroutines in Vala

2011-07-06 Thread pancake

why dont share it?

http://hg.youterm.com/vala-vapis

On 07/06/11 09:35, Luca Dionisi wrote:

On Wed, Jul 6, 2011 at 9:21 AM, Serge Hulneserge.hu...@gmail.com  wrote:

If pth is what you need, I have written a vapi for it. Let me know.


Yes please, I am interested !

I'll send you in private.
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list



___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] [ANNOUNCE] Vala 0.13.1 - Compiler for the GObject type system

2011-07-06 Thread Jürg Billeter
We are pleased to announce version 0.13.1 of Vala, a compiler for the
GObject type system.

Vala 0.13.1 is now available for download at:
   http://download.gnome.org/sources/vala/0.13/

Changes since 0.13.0
 * Many bug fixes and binding updates.

Vala is a new programming language that aims to bring modern programming
language features to GNOME developers without imposing any additional
runtime requirements and without using a different ABI compared to
applications and libraries written in C.

valac, the Vala compiler, is a self-hosting compiler that translates
Vala source code into C source and header files. It uses the GObject
type system to create classes and interfaces declared in the Vala source
code.

More information about Vala is available at

http://www.vala-project.org/


Jürg Billeter

___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Why the temporary variables in the C code are usefull ?

2011-07-06 Thread pancake
The compiler can optimize this. Those temp vars are just to make the vala 
compiler simpler.. It would be great if vala could do some minor optimization 
steps before spitting C. But if you compile with -O2 it shouldnt be something 
to worry.

On 06/07/2011, at 18:51, Jacques-Pascal Deplaix jp.depl...@gmail.com wrote:

 Hi everybody,
 
 Why assignements in Vala make C code with multiples temporary variables ?
 It's not very good for the performances...
 I read codegen/valaccodeassignmentmodule.vala and I found this:
 
 if (!is_pure_ccode_expression (lhs)) {
/* Assign lhs to temp var to avoid repeating side effect */
var lhs_value_type = assignment.left.value_type.copy ();
string lhs_temp_name = _tmp%d_.printf (next_temp_var_id++);
var lhs_temp = new LocalVariable (lhs_value_type, * + lhs_temp_name);
emit_temp_var (lhs_temp);
ccode.add_assignment (get_variable_cexpression (lhs_temp_name), new 
 CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, lhs));
 lhs = new CCodeParenthesizedExpression (new CCodeUnaryExpression 
 (CCodeUnaryOperator.POINTER_INDIRECTION, get_variable_cexpression 
 (lhs_temp_name)));
 }
 
 What are the side effects corrected by the temporary variables ?
 ___
 vala-list mailing list
 vala-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/vala-list
 
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Why the temporary variables in the C code are usefull ?

2011-07-06 Thread Jacques-Pascal Deplaix

On 07/06/2011 08:15 PM, pancake wrote:

The compiler can optimize this. Those temp vars are just to make the vala 
compiler simpler.. It would be great if vala could do some minor optimization 
steps before spitting C. But if you compile with -O2 it shouldnt be something 
to worry.

Ok, fine...
Thank you !
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list