Re: [Vala] vala libgda LINQ



2013/12/4 Luca Bruno <lethalman88 gmail com>

On 04/12/2013 16:52, Daniel Espinosa wrote:


Vala has provide nice/sexy syntax for GObject/C programing. Have added
lot of new features, witch have been possible to write in C but with lot of
lines of code. I love Vala because allows me to be more productive, even
Genie allows more simplification on Vala's syntax.

I think that former syntax are more productive and easy to read than the
last. Could allow to work with-in Vala's code with lot of data from a
DataBase or any other data source. GdaData objects and interfaces allows to
access that data using just GObjects and Vala code, abstracting most of
internal operations and mapping to properties and methods, and allow to use
Gee collections to make more easy to access to data using by code; but
could reach a next level by adding some syntax support on Vala for SQL like
queries.

I know that adding syntax support may is not easy or is far from Vala
principles.

Then I would like to see a way to allows Vala compiler with a mechanism
of PLUG-INS for syntax support. Then GdaData could add its own plug-in for
SQL syntax when it is installed.

The above allows not to distract Vala from its principles, but allows to
others add syntax for specific task that makes more easy/productive and
clear way to do the same.

Less code and clear syntax, allows more productive less errors.

Plugins are planned, but not for changing the syntax. Plugins will be able
to transform the ast into other ast, but neither semantics nor syntax are
allowed to change.

Consider this alternative, doable with such plugins:
select(Class.foo, Class.bar).from(collection).where(equal(some_field,
"some value")).


This could be possible using GDA and GdaData infrastructure. Just require
to create some classes and interfaces. Of course this don't need a Vala
plug-in just install GDA and enable GdaData :-)


Collection may be anything from an array to a gee collection to anything.
The plugin in this case can generate the relevant code by doing the
necessary magic, and it has all the information about the collection from
the ast.


GdaData already do this. You have mapped tables, records, fields to Gee
collections and implements some interfaces to allow any other to be a data
provider not just databases that actually use GDA as back-end.


However, such plugins will not be there anytime soon, there's first a huge
experimental branch to be merged (yet to be completed).


After that merge, are there any plan for plug-in support and include syntax
support too? Are we need to go the Genie way?

If Genie way is recommended, then we need to fix missings in GdaData to
allow basic programically query execution and then think about to create
Vala/Genie syntax.

-- 
Trabajar, la mejor arma para tu superación
"de grano en grano, se hace la arena" (R) (en trámite, pero para los
cuates: LIBRE)


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