cleverpig | 22 Aug 10:55

Does pike support JSON?

Hi,all!

I'm looking for json feature of pike now.

From gotpike.org,I get a little
info:http://modules.gotpike.org/display_docs.pike/Public.Parser.JSON/0.2/33
But there is only source code download,not a binary.

It's difficult to compilation source code?! Is there available another
json module?

--

-- 
cleverpig
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liudan <at> hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
My Facebook ID:cleverpig
My Blog: www.morpheus.org.cn
My Tags: del.icio.us/cleverpig
My Twitter: twitter.com/cleverpig
My Organization: www.beijing-open-party.org
My Organ <at> Facebook: http://www.facebook.com/group.php?gid=8159558294

Arne Goedeke | 22 Aug 11:07

Re: Does pike support JSON?

you can compile the module easily by using "pike -x module" and 
"pike -x module install" inside the module dir. for the second you 
probably need to be root.

there is another json module, also at modules.gotpike.org, but I guess 
Public.Parser.JSON will work just fine.

best

arne

On Fri, 22 Aug 2008, cleverpig wrote:

> Hi,all!
>
> I'm looking for json feature of pike now.
>
> From gotpike.org,I get a little
> info:http://modules.gotpike.org/display_docs.pike/Public.Parser.JSON/0.2/33
> But there is only source code download,not a binary.
>
> It's difficult to compilation source code?! Is there available another
> json module?

Bertrand LUPART | 22 Aug 11:18
Favicon

Re: Does pike support JSON?

Hey,

> I'm looking for json feature of pike now.
> 
> From gotpike.org,I get a little
> info:http://modules.gotpike.org/display_docs.pike/Public.Parser.JSON/0.2/33
> But there is only source code download,not a binary.

Source code from modules.gotpike.org is best installed using monger:
<http://modules.gotpike.org/docs/UsingMonger.html>
(real world example below)

> It's difficult to compilation source code?! Is there available another
> json module?

Interrestingly enough, Public.Parser.JSON nor Public.Parser.JSON2 will
install using monger, i guess due to the lack of dependencies on Pike
(to be changed in modules informations on modules.gotpike.org):

----8<----8<----8<----8<----
$sudo pike -x monger --install Public.Parser.JSON
an error occurred while getting the recommended version.
repository error: no recommended version to install.
use --force --version=ver to force install of a particular version.

$ sudo pike -x monger --install Public.Parser.JSON2
an error occurred while getting the recommended version.
repository error: no recommended version to install.
use --force --version=ver to force install of a particular version.
---->8---->8---->8---->8----
(Continue reading)

Arne Goedeke | 22 Aug 13:29

Re: Does pike support JSON?


On Fri, 22 Aug 2008, Bertrand LUPART wrote:

> Interrestingly enough, Public.Parser.JSON nor Public.Parser.JSON2 will
> install using monger, i guess due to the lack of dependencies on Pike
> (to be changed in modules informations on modules.gotpike.org):
>
> ----8<----8<----8<----8<----
> $sudo pike -x monger --install Public.Parser.JSON
> an error occurred while getting the recommended version.
> repository error: no recommended version to install.
> use --force --version=ver to force install of a particular version.
>
> $ sudo pike -x monger --install Public.Parser.JSON2
> an error occurred while getting the recommended version.
> repository error: no recommended version to install.
> use --force --version=ver to force install of a particular version.
> ---->8---->8---->8---->8----
Good to know. I was always looking for a way to select one version as
the recommended one in the module info. I did not know that that was
triggered by the missing Pike dependency. I added Pike 7.6-7.8 now, I
think I should test it for pike 7.4 first...

It would actually be great to add some automatic testing for modules
on monger. Do you think that can be integrated into xenofarm?

arne

Martin Bähr | 22 Aug 13:59

Re: Does pike support JSON?

On Fri, Aug 22, 2008 at 01:29:50PM +0200, Arne Goedeke wrote:
> It would actually be great to add some automatic testing for modules
> on monger. Do you think that can be integrated into xenofarm?

hmm, that's an interesting idea. trigger a xenofarm build every time
someone uploads a new module version.

it would have to do the builds per module though, does not make sense to
rebuild all modules, and also people will want to be able to only look
at stats for their own module. 

greetings, martin.
--

-- 
cooperative communication with sTeam      -     caudium, pike, roxen and unix
offering: programming, training and administration   -  anywhere in the world
--
pike programmer   working in china                      community.gotpike.org
unix system-      iaeste.(tuwien.ac|or).at                     open-steam.org
administrator     caudium.org                                    is.schon.org
Martin Bähr       http://www.iaeste.or.at/~mbaehr/

Bertrand LUPART | 22 Aug 14:50
Favicon

monger xenofarm (was: Re: Does pike support JSON?)

Martin Bähr <mbaehr <at> email.archlab.tuwien.ac.at> wrote:
> On Fri, Aug 22, 2008 at 01:29:50PM +0200, Arne Goedeke wrote:
> > It would actually be great to add some automatic testing for modules
> > on monger. Do you think that can be integrated into xenofarm?
> hmm, that's an interesting idea. trigger a xenofarm build every time
> someone uploads a new module version.
> 
> it would have to do the builds per module though, does not make sense to
> rebuild all modules, and also people will want to be able to only look
> at stats for their own module. 

That's a real good idea.

I guess this should be totally independant from actual Pike xenofarm, so
that modules could be compiled against a real world pike
distribution/version.

--

-- 
Bertrand LUPART

http://bertrand.gotpike.org/

monger xenofarm (was: Re: Does pike support JSON?)

Now please figure out a security model for that...

Bill Welliver | 22 Aug 16:34
Gravatar

Re: Does pike support JSON?

I'm assuming we're not talking about windows... monger (nor module 
building) work on Windows. There's a pure pike json module bundled in 
Fins (Tools.JSON, iirc)...

http://hww3.riverweb.com/space/pike/Fins

Bill

On Fri, 22 Aug 2008, Bertrand LUPART wrote:

> Hey,
>
>> I'm looking for json feature of pike now.
>>
>> From gotpike.org,I get a little
>> info:http://modules.gotpike.org/display_docs.pike/Public.Parser.JSON/0.2/33
>> But there is only source code download,not a binary.

Christian Reß | 24 Aug 18:34

Re: Does pike support JSON?

Hi cleverpig,

Tobias Josefowitz reminded me of a JSON Parser I wrote some years ago - 
and I just submitted it to monger. It rewrites the serialized JSON 
string to suite Pike syntax and uses the Pike interpreter to convert it 
to a Pike datatype. The examples on json.org work fine, so most of the 
JSON stuff seems to work. IIRC the parser was a bit faster than the 
other ones, however, I don't have any benchmarks.

It doesn't support "null", "true" or "false" and simply coverts them to 
0, 1, 0.

Monger works fine with this module:

pike -x monger --install Public.Parser.JSON3

afterwards, try it:

pike
 > string s = Public.Parser.JSON3.encode( ([ "hello" : ({ "world", 5, 0 
}) ]) );
 > s;
(2) Result: "{\"hello\":[\"world\",5,0]}"
 > Public.Parser.JSON3.decode(s);
(3) Result: ([ /* 1 element */
               "hello": ({ /* 3 elements */
                     "world",
                     5,
                     0
                 })
(Continue reading)


Gmane