[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rpm-devel
Subject:    Re: [CVS] RPM: rpm/ CHANGES configure.ac devtool.conf rpm/rpmio/
From:       Jeff Johnson <n3npq () mac ! com>
Date:       2009-04-18 13:16:18
Message-ID: F6CB93A1-7E43-45AC-B869-E28A329ED15F () mac ! com
[Download RAW message or body]


On Apr 18, 2009, at 2:52 AM, Ralf S. Engelschall wrote:

> On Fri, Apr 17, 2009, Jeff Johnson wrote:
>
>> Took a bit to figger (and I still haven't a clue ;-),
>> but javascript is now embedded:
>>
>> [jbj@fedora10 wdj]$ rpm -E '%{js:"Hello World!"}'
>> --> js 0xa07fe10 ++ 1 rpmjsNew at rpmjs.c:115
>> ==> rpmjsRun(0xa07fe10,"Hello World!")
>> --> js 0xa07fe10 -- 1 expandMacro at macro.c:1931
>> Hello World!
>> [jbj@fedora10 wdj]$ rpm -E '%{js: 1 + 1}'
>> --> js 0x9c9b460 ++ 1 rpmjsNew at rpmjs.c:115
>> ==> rpmjsRun(0x9c9b460, 1 + 1)
>> --> js 0x9c9b460 -- 1 expandMacro at macro.c:1931
>> 2
>
> Very nice! What is now just missing for most languages except Lua is
> that the RPM C API functions are available to the embedded language.
> Because that's one of the major points for Lua currently: it exports a
> few very important RPM C functions...
>

Well, all depends on "available" POV in the PHP like cassoulet.

And the Lua convention that
	All embedded interpreter expansions return strings on stdout.
which is used everywhere else is not yet followed in JavaScript.

Also Python and perl (unlike LUA) have methods to
invoke rpmtsCheck/rpmtsOrder/rpmtsRun(). Both
Python/perl likely have better access to RPM objects
than Lua atm, rpm-python/rpm-perl bindings are loaded
when interpreters are started.

But if you mean JavaScript specifically, show me
a usage case and I'll write JavaScript bindings for RPM.

The means to extend JavaScript is sufficiently similar
to Python that the existing rpm-python could be rewritten into
JS extensions pretty easily. OTOH, the python bindings
aren't particularly well designed or widely used either.

There does seem to be a paucity of bindings/extensions for
JavaScript for non-web applications. I looked at both
SpiderApe and Flusspferd for examples without seeing
anything too interesting.


73 de Jeff
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        rpm-devel@rpm5.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic