Re: GIR namespaces Override/Extension system standardisation



Comments inline...

 --- On 01/Sep/2011, Alexandre Mazari wrote: 
> Heya everyone,
> 
> Working on some namespace extensions for seed. I had a look at the
> equivalent facilities in Gjs.
> 
> Both of them offer a way to implicitely extend 'native' GIR namespaces
> with javascript code at importation time.
> This is often used to provide easier and more 'jsesque' APIs over
> imported symbols.
> 
> Currently those two systems are slightly different requiring some manual
> editing to shared code:
> - naming: 
> 	seed: look in an 'extensions' directory 
> 	(imports.extensions.namespce)
> 	gjs: calls them 'overrides' 
> 	(imports.overrides.namespace)

Overrides does look like a slightly clearer naming. Seed could include both for a period of time, and migrate to use overrides eventually to be consistent.


> 
> - initialization: 
> 	seed: an anonymous initialization method is defined and invoked
> 	*within* the extension js code.
> 	gjs: an _init method is defined in the override, looked-up and
> 	invoked in the C importer code.

_init() is a little python'y, I think seeds way of doing this is defiantly more 'Javascripty'..., I'm not sure how many gjs core developers are on this list, but it would be interesting to hear if they are interesting in merging these bits of code. 

> 
> It'd be great if we could find a common ground and use the same
> conventions/mecanism.

It's always been an aim from what I've head from seed developers to try and share more code, If you are willing to push this along, I'd be happy to commit on seed's side... 

 
> Obviously, that wont make overrides/extensions directly copypastable
> because of the differences in the language support ('let', multiple
> values return... kinda envious here) but would make us much more closer.
> More common code could then move to gnome-js-common.

I miss those multiple returns to ;) - not to sure about 'let' though ;)

Regards
Alan

> 
> What do you think ?
> 
> Happy Coding,
> Alexandre
> 
> 
> _______________________________________________
> javascript-list mailing list
> javascript-list gnome org
> http://mail.gnome.org/mailman/listinfo/javascript-list



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