Re: [Vala] inline C

2008-12-16 Thread Ildar Mulyukov
Hi! On 16.12.2008 01:37:45, Jürg Billeter wrote: I don't really like the idea of inline C in general. The only reason to use it is to avoid writing bindings or work around bugs in the compiler. That was the original idea Supporting full-featured inline C is not trivial as you would not on

Re: [Vala] inline C

2008-12-15 Thread Jürg Billeter
On Sat, 2008-12-13 at 17:46 +, Karl Lattimer wrote: > On Sat, 2008-12-13 at 23:44 +0600, Ildar Mulyukov wrote: > > What do you think about having C inline in Vala? This looks quite > > natural for Vala. Especially while Vala is quite unperfect (having 304 > > open bugs). This could ease imp

Re: [Vala] inline C

2008-12-15 Thread Conrad Steenberg
On Mon, 2008-12-15 at 19:39 +0100, Jürg Billeter wrote: > On Mon, 2008-12-15 at 09:49 -0800, Conrad Steenberg wrote: > > On Mon, 2008-12-15 at 12:42 -0500, Jamie McCracken wrote: > > > On Mon, 2008-12-15 at 09:18 -0800, Conrad Steenberg wrote: > > > > Hmmm, I would love to be able to use C++ librar

Re: [Vala] inline C

2008-12-15 Thread Jürg Billeter
On Mon, 2008-12-15 at 09:49 -0800, Conrad Steenberg wrote: > On Mon, 2008-12-15 at 12:42 -0500, Jamie McCracken wrote: > > On Mon, 2008-12-15 at 09:18 -0800, Conrad Steenberg wrote: > > > Hmmm, I would love to be able to use C++ libraries from Vala (or > Genie, > > > since it's a natural jump from

Re: [Vala] inline C

2008-12-15 Thread Conrad Steenberg
On Mon, 2008-12-15 at 12:42 -0500, Jamie McCracken wrote: > On Mon, 2008-12-15 at 09:18 -0800, Conrad Steenberg wrote: > > On Sat, 2008-12-13 at 13:00 -0500, Jamie McCracken wrote: > > > The disadvantage to inlining is it destroys the platform independence - > > > IE you would not be able to create

Re: [Vala] inline C

2008-12-15 Thread Jamie McCracken
On Mon, 2008-12-15 at 09:18 -0800, Conrad Steenberg wrote: > On Sat, 2008-12-13 at 13:00 -0500, Jamie McCracken wrote: > > The disadvantage to inlining is it destroys the platform independence - > > IE you would not be able to create a gcc front end for vala nor would > > you be able to have vala->

Re: [Vala] inline C

2008-12-15 Thread Conrad Steenberg
On Mon, 2008-12-15 at 12:28 -0500, Levi Bard wrote: > > Hmmm, I would love to be able to use C++ libraries from Vala (or Genie, > > since it's a natural jump from Numeric Python which I currently use). > > > > Any ideas on how to do that? Compile the vala/genie-produced C code with > > a C++ compil

Re: [Vala] inline C

2008-12-15 Thread Conrad Steenberg
On Mon, 2008-12-15 at 12:21 -0500, Yu Feng wrote: > On Mon, 2008-12-15 at 09:18 -0800, Conrad Steenberg wrote: > > On Sat, 2008-12-13 at 13:00 -0500, Jamie McCracken wrote: > > > The disadvantage to inlining is it destroys the platform independence - > > > IE you would not be able to create a gcc f

Re: [Vala] inline C

2008-12-15 Thread Levi Bard
> Hmmm, I would love to be able to use C++ libraries from Vala (or Genie, > since it's a natural jump from Numeric Python which I currently use). > > Any ideas on how to do that? Compile the vala/genie-produced C code with > a C++ compiler? You could use a C wrapper library ala taglib_c... ___

Re: [Vala] inline C

2008-12-15 Thread Yu Feng
On Mon, 2008-12-15 at 09:18 -0800, Conrad Steenberg wrote: > On Sat, 2008-12-13 at 13:00 -0500, Jamie McCracken wrote: > > The disadvantage to inlining is it destroys the platform independence - > > IE you would not be able to create a gcc front end for vala nor would > > you be able to have vala->

Re: [Vala] inline C

2008-12-15 Thread Conrad Steenberg
On Sat, 2008-12-13 at 13:00 -0500, Jamie McCracken wrote: > The disadvantage to inlining is it destroys the platform independence - > IE you would not be able to create a gcc front end for vala nor would > you be able to have vala->c++ or vala->jvm/clr. > > jamie Hmmm, I would love to be able to

Re: [Vala] inline C

2008-12-15 Thread Levi Bard
>> > You can currently get the same effect by using extern keyword for c >> > functions in an included c file (you can pass a .c file to valac for >> > this purpose) >> [...] > > Vala is not a preprocessor for gcc, although I'm sure many people look > at it this way. >[...] > Personally, I rather h

Re: [Vala] inline C

2008-12-14 Thread Yu Feng
On Sun, 2008-12-14 at 07:45 +0100, Hans Vercammen wrote: > On Sun, 2008-12-14 at 05:23 +0100, Hans Vercammen wrote: > > On Sat, 2008-12-13 at 22:05 -0500, Yu Feng wrote: > > > Machines can be happy if the ccode are written carefully, but a > > > bilingual text is usually difficult for human beings

Re: [Vala] inline C

2008-12-13 Thread Hans Vercammen
On Sun, 2008-12-14 at 05:23 +0100, Hans Vercammen wrote: > On Sat, 2008-12-13 at 22:05 -0500, Yu Feng wrote: > > Machines can be happy if the ccode are written carefully, but a > > bilingual text is usually difficult for human beings to understand; to > > me this is more convincable than any other

Re: [Vala] inline C

2008-12-13 Thread Hans Vercammen
On Sat, 2008-12-13 at 22:05 -0500, Yu Feng wrote: > On Sun, 2008-12-14 at 00:55 +0100, Hans Vercammen wrote: > > > > > On Sat, 2008-12-13 at 23:44 +0600, Ildar Mulyukov wrote: > > >[...] > > > 1. inlining asm is most unportable. But this did not prevent from > > > adding it to GCC. Surely it sho

Re: [Vala] inline C

2008-12-13 Thread Yu Feng
On Sun, 2008-12-14 at 00:55 +0100, Hans Vercammen wrote: > On Sun, 2008-12-14 at 00:51 +0600, Ildar Mulyukov wrote: > > On 14.12.2008 00:00:31, Jamie McCracken wrote: > > > On Sat, 2008-12-13 at 17:46 +, Karl Lattimer wrote: > > > > On Sat, 2008-12-13 at 23:44 +0600, Ildar Mulyukov wrote: > > >

Re: [Vala] inline C

2008-12-13 Thread Hans Vercammen
On Sun, 2008-12-14 at 00:51 +0600, Ildar Mulyukov wrote: > On 14.12.2008 00:00:31, Jamie McCracken wrote: > > On Sat, 2008-12-13 at 17:46 +, Karl Lattimer wrote: > > > On Sat, 2008-12-13 at 23:44 +0600, Ildar Mulyukov wrote: > >>> What do you think about having C inline in Vala? This looks quit

Re: [Vala] inline C

2008-12-13 Thread Ildar Mulyukov
On 13.12.2008 23:46:50, Karl Lattimer wrote: There would have to be some sanity wrapping though to make sure that the C stuff would work properly with the vala stuff... At the moment it seems almost impossible to implement and not necessary as gcc anyway checks this staff. Or you meant somet

Re: [Vala] inline C

2008-12-13 Thread Ildar Mulyukov
On 14.12.2008 00:00:31, Jamie McCracken wrote: On Sat, 2008-12-13 at 17:46 +, Karl Lattimer wrote: > On Sat, 2008-12-13 at 23:44 +0600, Ildar Mulyukov wrote: What do you think about having C inline in Vala? This looks quite natural for Vala. Especially while Vala is quite unperfect (having

Re: [Vala] inline C

2008-12-13 Thread Jamie McCracken
On Sat, 2008-12-13 at 17:46 +, Karl Lattimer wrote: > On Sat, 2008-12-13 at 23:44 +0600, Ildar Mulyukov wrote: > > Hi, > > > > Take a look: > > int main (void) { > > int Cvariable; > > __asm__ ("movl Cvariable, %eax"); // Cvariable > > contents > eax > >

Re: [Vala] inline C

2008-12-13 Thread Karl Lattimer
On Sat, 2008-12-13 at 23:44 +0600, Ildar Mulyukov wrote: > Hi, > > Take a look: > int main (void) { > int Cvariable; > __asm__ ("movl Cvariable, %eax"); // Cvariable > contents > eax > __asm__ ("movl $Cvariable, %ebx"); // ebx ---> Cvariab

[Vala] inline C

2008-12-13 Thread Ildar Mulyukov
Hi, Take a look: int main (void) { int Cvariable; __asm__ ("movl Cvariable, %eax"); // Cvariable contents > eax __asm__ ("movl $Cvariable, %ebx"); // ebx ---> Cvariable } These are Assembler inline instructions, which you can use in C. What do yo

Re: [Vala] Inline C

2008-01-25 Thread Jürg Billeter
Hi, On Fri, 2008-01-25 at 00:02 +0100, Mikael Hermansson wrote: > Is it possible to have "inline" C code in vala if not it would be great > too have it. Vala doesn't support inline C code as it would only make the language unnecessary complicated. If you want to write C code, use [Import] as desc

Re: [Vala] Inline C

2008-01-25 Thread Ed Schouten
* Mikael Hermansson <[EMAIL PROTECTED]> wrote: > Is it possible to have "inline" C code in vala if not it would be great > too have it. You mean whether it's possible to call inline routines? That's no problem. Because valac just generates C code, the C compiler will do the inlining for you. Whet

Re: [Vala] Inline C

2008-01-25 Thread vlad
On Jan 25, 2008 1:02 AM, Mikael Hermansson <[EMAIL PROTECTED]> wrote: > Hello! > > Is it possible to have "inline" C code in vala if not it would be great > too have it. > > For example right now i need too use mysql in vala... > > You can use an [Import] public static my_external_function(...) o

[Vala] Inline C

2008-01-24 Thread Mikael Hermansson
Hello! Is it possible to have "inline" C code in vala if not it would be great too have it. For example right now i need too use mysql in vala... ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list