Re: libseed-list faster sprintf?
- From: "Alan Knowles" <alan akbkhome com>
- To: "Jonatan Liljedahl" <libseed-list-bounces gnome org>
- Cc: libseed-list gnome org
- Subject: Re: libseed-list faster sprintf?
- Date: Fri, 18 Jun 2010 06:58:54 +0800
There was some momentum (a long while ago) by the looks to unify the Stuff
http://git.gnome.org/browse/gnome-js-common/
gjs is being used heavily by the gnome-shell team, also from what I gather due to the fact it worked first.
Now they have used all those JS 1.8 features, it makes switching to seed more difficult.
> - imports.module only looks for 'module.js' for files, not 'module.*'
> - imports.directory runs __init__.js (nice way to keep a module in
> submodules)
I think seed does this - search for __init__ in the importer code.
> - JS 1.8 language features (let, iterators, [a,b,c] = foo(), etc..)
Those are all dependant on webkit, from what I've heard there has not been much traction on it.
I can't see any issue if we add printf() in C, it's a pretty handy feature.
Regards
alan
--- On 17/Jun/2010, Jonatan Liljedahl wrote:
> I'm not sure I follow you.. gjs doesn't seem to have print() nor
> Seed.sprintf(), but only log(). Do you mean that if one needs to port
> scripts from Seed to gjs, then one can just copy the Seed.js code?
> One could still have a sprintf.js in the tree for that purpose, but have
> a fast sprintf in C. I find sprintf("foo %d: %f",i,x) much nicer and
> clearer than "foo "+i+": "+x, plus the additional precision and width
> features.
>
> BTW, what is the current situation on gjs vs seed?
>
> One thing I don't like with gjs is that I never got it to build so I
> haven't actually tried it out ;)
>
> But looking at the source, some things I miss in seed are:
>
> - imports.module only looks for 'module.js' for files, not 'module.*'
> - imports.directory runs __init__.js (nice way to keep a module in
> submodules)
> - JS 1.8 language features (let, iterators, [a,b,c] = foo(), etc..)
>
> /Jonatan
>
> Alan Knowles wrote:
> > Keep in mind that there is some concern about keeping gjs and seed reasonably compatible. so writing the printf in Javascript enables both libraries to use it.
> >
> > Regards
> > Alan
> >
> > --- On 17/Jun/2010, Jonatan Liljedahl wrote:
> >> Why not rewrite Seed.sprintf in C, using g_strdup_sprintf()? It would
> >> probably be a lot more efficient. If there are no reasons not to, I will
> >> be happy to provide a patch.
> >>
> >> Also, it would be nice with a prints() (or something) that doesn't add a
> >> newline.
> >>
> >> /Jonatan
> >> _______________________________________________
> >> libseed-list mailing list
> >> libseed-list gnome org
> >> http://mail.gnome.org/mailman/listinfo/libseed-list
> >
> > _______________________________________________
> > libseed-list mailing list
> > libseed-list gnome org
> > http://mail.gnome.org/mailman/listinfo/libseed-list
>
> _______________________________________________
> libseed-list mailing list
> libseed-list gnome org
> http://mail.gnome.org/mailman/listinfo/libseed-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]