2

Since NaCl uses a messaging system between the browser and the module I thought that serializing objects to / from JSON would be a good way to communicate with the javascript. I am using this library: http://code.google.com/p/pjson/ because it was the only one that I found that I could get to compile along with Pepper15.

It seems to work, however with really large messages (>20K) it seems to crash. I'm trying to use NaCl for a WebGL project which won't have the actual opengl being done in NaCl, I just wanted to do the vertex processing. This ends up having huge amounts of data passed back and forth. I don't think it's a limit on the NaCl/Pepper postMessage method.

Anyone else using JSON in NaCl that might have a better library or some insight?

Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201
Warspawn
  • 46
  • 5
  • Have your tryed http://www.boost.org/doc/libs/1_41_0/doc/html/property_tree.html ? – Jaffa Jan 03 '12 at 22:27
  • Well I haven't, I know that for NaCl boost would have to be converted (I think some version might be). Also I was hoping for more of a specific JSON lib, but I'll see if I can give this a try. – Warspawn Jan 05 '12 at 15:56
  • in order to compile any lib for NaCl it has to be converted into usable for the Pepper toolchain. http://code.google.com/p/naclports/ looks like they have a conversion, sadly my primary OS is Windows so I'm going to have to do it the hard way. – Warspawn Jan 05 '12 at 16:52
  • Boost property tree is a header-only lib, so you don't have to compile anything before using it. – Jaffa Jan 05 '12 at 17:41
  • I think that something needs to happen for boost to work in NaCl. Also reading about the property tree, I'm not sure if it'll ultimately do what I want. In the meantime, I'm trying this one: http://jsoncpp.sourceforge.net. – Warspawn Jan 05 '12 at 23:50
  • Have you ever simply tryed to set a var to an std::string or std::vector value? https://developers.google.com/native-client/reference/pepper15/peppercpp/classpp_1_1_var – Jaffa Jan 06 '12 at 06:35

1 Answers1

2

NaCl ports contains a port of jsoncpp library.

vissi2
  • 83
  • 6