Re: [Vala] bugs



On Sat, 2007-09-08 at 20:45 +0200, pancake wrote:
BTW I have noticed the -O flag in valac, that it's just the same as passing
it to gcc. The problem I see here is that you're forced to place a space
between the flag and the argument. Hardcoding some flags like -O0 -O1 -O3 ..
would be more closer to gcc.

Talking about design patterns. This is a bad idea because you are dupping
LOCs without needing to. There the -X flag to directly pass flags to gcc,
so -O is not necessary there. So you can:

 $ valac -o foo foo.vala -X -O3

which is the same as:

 $ valac -o foo foo.vala -O 3

For me the first way looks cleaner and more orthogonal :)

Yes, you're probably right. I've added the -O option before the -X
option, IIRC, that's why it's like that now.

The same can be applied to the -g flag

Not quite, the -g tells valac to emit #line directives, for example.

The only way I can understand the existence of these flags is to keep operation
consistence between different compilers (gcc, tcc, msvc, ...) wrapping these
flags to the correct syntax for the target compiler.

BTW the best way to do this (imho) is to create another program that acts
as a meta-compiler wrapper for gcc/icc/.. and make valac call the meta-compiler
and the meta-compiler call the desired compiler with the right flags and environment
variables.

I don't want to make half a build-system out of valac, the -X option
should work fine the same way it does for C compilation.

A little question... is there any way to browse namespaces classes and methods?
a cmdline tool to query this will be nice for an IDE (or vim ;) integration for
method autocompletion and so.

You can do that via libvala, although it's probably too slow for IDE
integration right now as it has to parse the VAPI files every time -
unless you just keep the symbol tree in memory. A binary - possibly
mmap-able - cache file might make sense here.

Jürg




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