Re: [Vala] Vala - generates code at runtime



On Tue, Feb 09, 2010 at 23:29:39 +0100, jideel wrote:
It was quite seductive to be able to code as easily as with C#/Java while
having C performance/size.

If you have most of the code in a compiled library (that can be written in
Vala or C or C++) and just generate a bit of glue to put it together in
a custom way, the performance hit will not be significant unless you run it
in a tight loop millions of times per second.

The project is about a kind of distributed UUID generator, available
through different interfaces (socket, soap, rest...) , while being
manageable through a web interface, users can define their own
types/classes on-the-fly and link generated UUIDs to their objects so later
they can pick up an UUID from, say, a database and find what kind of object
it's related to, when it was created and so on. It can provide some
tracability to a normally "dumb" identifier.

I guess you might want to support multiple languages for thing like that,
than and Vala could be one. I'd however start with something fully reflexive
like CLR (.net) or Java as you can easily check the object structure there,
have ready-made serialization and such.

As it has to be reliable/scalable/... it's probably a java-like job.

I've investigated Java/C# previously for such a task and it's true it fits
well, but i had a good feeling about Vala, so i thought "why not give it
a try ?" :)

Vala is perhaps, at least for now, more desktop-oriented.

I wouldn't say. Vala's important goal is to allow implementing libraries,
that can be used by applications written in wide variety of languages. That's
something Java or C# can't do, because they are tied to their runtimes.

Anyway, it doesn't seems that the gmodule-2.0.vapi wraps any unload
functionality, while GModule provides a GModuleUnload function. Is it not
implemented or am i missing something (again) ?

The g_module_close function is bound as the destructor for GModule, so it
should be unloaded when the GModule object goes out of scope.

-- 
                                                 Jan 'Bulb' Hudec <bulb ucw cz>



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