Re: [Vala] inline C

On 14.12.2008 00:00:31, Jamie McCracken wrote:
On Sat, 2008-12-13 at 17:46 +0000, 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 implementing workarounds ;)
+1 it would be nicer for certain things to just use C rather than having to write vapi e.g. the uuid.vapi I had to write for wizbit, meant more code than just using C... There would have to be some sanity wrapping though to make sure that the C stuff would work properly with the vala stuff...

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)

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.

1. inlining asm is most unportable. But this did not prevent from adding it to GCC. Surely it should be documented as limiting portability. 2. Making different backends can be planned only when Vala will correctly implement 100% of it's features (delegates, properties). When time comes, we can limit this feature to just one backend, etc. etc. Anyway let's make small steps: those ones that we need; later we can change it ( XP approach ).

Best regards,
Ildar  Mulyukov,  free SW designer/programmer
email: ildar users sourceforge net
ALT Linux Sisyphus

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]