Good afternoon. I have a need for doing JSON encoding in both Squeak & pharo so I would like a common framework. As I need to do pre/post processing each object written, it needs to be a SAX-DOM style callback parser. What would be my best option for JSon encoding in both Squeak and Pharo? If the sax is absent I will need to write it and I would like to do so in an existing encoder framework, such as Magma or Fuel. What would be best?
--- alan |
I don't think there's anything that meets all your criteria.
Common framework: http://www.squeaksource.com/JSON.html But its not a callback parser where you can edit things as they are parsed. Parser that allows pre/post editing but doesn't work on Squeak AFAIK (but likely easily ported): the NeoJSON project in http://smalltalkhub.com/#!/~SvenVanCaekenberghe/Neo If you want a SAX-DOM style parser your best bet might be adding a JSON parser to the XMLParser here http://smalltalkhub.com/#!/~PharoExtras/XMLParser Here is an HTML parser based on that parser :http://smalltalkhub.com/#!/~PharoExtras/XMLParserHTML . Depending on your budget you could hire the XMLParser's maintainer (Monty) to add it for you. hope this helps Paul
|
In reply to this post by Alan Pinch
The one on SqueakSource is pretty tight (portable):
Installer new merge: #jsonParser There are only about 10 implementations of #jsonWriteOn:, which could be replaced with #jsonWriteOn:do:, taking one-arg block as the second argument, or a visitor object if more flexibility is needed. On Fri, Aug 11, 2017 at 2:42 PM, Alan Pinch <[hidden email]> wrote: > Good afternoon. I have a need for doing JSON encoding in both Squeak & pharo so I would like a common framework. As I need to do pre/post processing each object written, it needs to be a SAX-DOM style callback parser. What would be my best option for JSon encoding in both Squeak and Pharo? If the sax is absent I will need to write it and I would like to do so in an existing encoder framework, such as Magma or Fuel. What would be best? > > --- > alan > |
Thanks for the pointers, I'll also need pre/post on write. I realize I also need support for schemes so I will peruse code and see the XML Parser also. Would Magma or Fuel support JSon encoding? Also did the FLDecoder get replaced.
Thank you --- alan > On Aug 11, 2017, at 16:52, Chris Muller <[hidden email]> wrote: > > The one on SqueakSource is pretty tight (portable): > > Installer new merge: #jsonParser > > There are only about 10 implementations of #jsonWriteOn:, which could > be replaced with #jsonWriteOn:do:, taking one-arg block as the second > argument, or a visitor object if more flexibility is needed. > > > >> On Fri, Aug 11, 2017 at 2:42 PM, Alan Pinch <[hidden email]> wrote: >> Good afternoon. I have a need for doing JSON encoding in both Squeak & pharo so I would like a common framework. As I need to do pre/post processing each object written, it needs to be a SAX-DOM style callback parser. What would be my best option for JSon encoding in both Squeak and Pharo? If the sax is absent I will need to write it and I would like to do so in an existing encoder framework, such as Magma or Fuel. What would be best? >> >> --- >> alan >> > |
In reply to this post by Paul DeBruicker
I will take a closer look at NeoJSON. I am using JSON right now but I need to do schemas and substitutions.
Thanks for goodness, alan > On Aug 11, 2017, at 16:31, Paul DeBruicker <[hidden email]> wrote: > > I don't think there's anything that meets all your criteria. > > > Common framework: > > http://www.squeaksource.com/JSON.html > > But its not a callback parser where you can edit things as they are parsed. > > > > Parser that allows pre/post editing but doesn't work on Squeak AFAIK (but > likely easily ported): > > the NeoJSON project in > > http://smalltalkhub.com/#!/~SvenVanCaekenberghe/Neo > > > > > If you want a SAX-DOM style parser your best bet might be adding a JSON > parser to the XMLParser here > > http://smalltalkhub.com/#!/~PharoExtras/XMLParser > > > Here is an HTML parser based on that parser > :http://smalltalkhub.com/#!/~PharoExtras/XMLParserHTML . > Depending on your budget you could hire the XMLParser's maintainer (Monty) > to add it for you. > > > hope this helps > > Paul > > > > Alan Pinch wrote >> Good afternoon. I have a need for doing JSON encoding in both Squeak & >> pharo so I would like a common framework. As I need to do pre/post >> processing each object written, it needs to be a SAX-DOM style callback >> parser. What would be my best option for JSon encoding in both Squeak and >> Pharo? If the sax is absent I will need to write it and I would like to do >> so in an existing encoder framework, such as Magma or Fuel. What would be >> best? >> >> --- >> alan > > > > > > -- > View this message in context: http://forum.world.st/JSon-Encoders-tp4960276p4960289.html > Sent from the Squeak - Dev mailing list archive at Nabble.com. > |
In reply to this post by Paul DeBruicker
I see NeoJSON has schema support, I think I'll work from there.
- Alan > On Aug 11, 2017, at 16:31, Paul DeBruicker <[hidden email]> wrote: > > I don't think there's anything that meets all your criteria. > > > Common framework: > > http://www.squeaksource.com/JSON.html > > But its not a callback parser where you can edit things as they are parsed. > > > > Parser that allows pre/post editing but doesn't work on Squeak AFAIK (but > likely easily ported): > > the NeoJSON project in > > http://smalltalkhub.com/#!/~SvenVanCaekenberghe/Neo > > > > > If you want a SAX-DOM style parser your best bet might be adding a JSON > parser to the XMLParser here > > http://smalltalkhub.com/#!/~PharoExtras/XMLParser > > > Here is an HTML parser based on that parser > :http://smalltalkhub.com/#!/~PharoExtras/XMLParserHTML . > Depending on your budget you could hire the XMLParser's maintainer (Monty) > to add it for you. > > > hope this helps > > Paul > > > > Alan Pinch wrote >> Good afternoon. I have a need for doing JSON encoding in both Squeak & >> pharo so I would like a common framework. As I need to do pre/post >> processing each object written, it needs to be a SAX-DOM style callback >> parser. What would be my best option for JSon encoding in both Squeak and >> Pharo? If the sax is absent I will need to write it and I would like to do >> so in an existing encoder framework, such as Magma or Fuel. What would be >> best? >> >> --- >> alan > > > > > > -- > View this message in context: http://forum.world.st/JSon-Encoders-tp4960276p4960289.html > Sent from the Squeak - Dev mailing list archive at Nabble.com. > |
In reply to this post by Alan Pinch
Magma and Fuel do not serialize to JSON but their own, proprietary,
binary formats. On Fri, Aug 11, 2017 at 4:13 PM, Alan Pinch <[hidden email]> wrote: > Thanks for the pointers, I'll also need pre/post on write. I realize I also need support for schemes so I will peruse code and see the XML Parser also. Would Magma or Fuel support JSon encoding? Also did the FLDecoder get replaced. > > Thank you > > --- > alan > >> On Aug 11, 2017, at 16:52, Chris Muller <[hidden email]> wrote: >> >> The one on SqueakSource is pretty tight (portable): >> >> Installer new merge: #jsonParser >> >> There are only about 10 implementations of #jsonWriteOn:, which could >> be replaced with #jsonWriteOn:do:, taking one-arg block as the second >> argument, or a visitor object if more flexibility is needed. >> >> >> >>> On Fri, Aug 11, 2017 at 2:42 PM, Alan Pinch <[hidden email]> wrote: >>> Good afternoon. I have a need for doing JSON encoding in both Squeak & pharo so I would like a common framework. As I need to do pre/post processing each object written, it needs to be a SAX-DOM style callback parser. What would be my best option for JSon encoding in both Squeak and Pharo? If the sax is absent I will need to write it and I would like to do so in an existing encoder framework, such as Magma or Fuel. What would be best? >>> >>> --- >>> alan >>> >> |
Yes, and NeoJSON does schemas. On schemas, ASN1 has Modules. I need substitutability though, and I know Magma and Fuel are expert at this, as is possibly Xtreams. I looked at Fuel a while back but not Magma or Xtreams. I think NeoJSON does custom mappings as well. I am trying to fold in NeoJSON now...Would changing Magma's/Fuel's encoding be possible? - Alan
|
For serialization it seems like you'd probably want to start with STON as its format is simplest and then if you need more than a zipped STON file you could pursue other options. There are a messagepack and thrift serializers too. I think STON cannot serialize contexts, and maybe some other things. I think the limitations are well documented.
STON http://wiki.squeak.org/squeak/6504 Thrift https://thrift.apache.org/ Message pack https://github.com/mumez/StOMP
|
In reply to this post by Alan Pinch
No, Magma and Fuel are not intended for interfacing to external
environments, but reaching INTO the Smalltalk environment to give the user more power over the objects there. On Fri, Aug 11, 2017 at 7:26 PM, Alan Pinch <[hidden email]> wrote: > Yes, and NeoJSON does schemas. On schemas, ASN1 has Modules. > > I need substitutability though, and I know Magma and Fuel are expert at > this, as is possibly Xtreams. I looked at Fuel a while back but not Magma or > Xtreams. I think NeoJSON does custom mappings as well. I am trying to fold > in NeoJSON now...Would changing Magma's/Fuel's encoding be possible? > > - Alan > > On Aug 11, 2017, at 20:09, Chris Muller <[hidden email]> wrote: > > Magma and Fuel do not serialize to JSON but their own, proprietary, > binary formats. > > On Fri, Aug 11, 2017 at 4:13 PM, Alan Pinch <[hidden email]> wrote: > > Thanks for the pointers, I'll also need pre/post on write. I realize I also > need support for schemes so I will peruse code and see the XML Parser also. > Would Magma or Fuel support JSon encoding? Also did the FLDecoder get > replaced. > > > Thank you > > > --- > > alan > > > On Aug 11, 2017, at 16:52, Chris Muller <[hidden email]> wrote: > > > The one on SqueakSource is pretty tight (portable): > > > Installer new merge: #jsonParser > > > There are only about 10 implementations of #jsonWriteOn:, which could > > be replaced with #jsonWriteOn:do:, taking one-arg block as the second > > argument, or a visitor object if more flexibility is needed. > > > > > On Fri, Aug 11, 2017 at 2:42 PM, Alan Pinch <[hidden email]> wrote: > > Good afternoon. I have a need for doing JSON encoding in both Squeak & pharo > so I would like a common framework. As I need to do pre/post processing each > object written, it needs to be a SAX-DOM style callback parser. What would > be my best option for JSon encoding in both Squeak and Pharo? If the sax is > absent I will need to write it and I would like to do so in an existing > encoder framework, such as Magma or Fuel. What would be best? > > > --- > > alan > > > > > > |
Free forum by Nabble | Edit this page |