<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi,</p>
    <p>I used JSON with the addition of carrying the class (JSON being
      Javascript born has no concept of classes) because it requires
      only very little work after loading the JSON package. (And because
      I've been doing some web application where I needed JSON anyway.)<br>
    </p>
    <p>Each class needs on the class side:</p>
    <p>constructFromJson: j<br>
          ^ self new constructFromJson: j</p>
    <p>and on the instance side:</p>
    <p>jsonWriteOn: aStream<br>
          Json renderInstanceVariables: <br>
                  (self class allInstVarNames collect: [:ea| ea
      asSymbol])<br>
              of: self <br>
              on: aStream</p>
    <p>and:</p>
    <p>constructFromJson: j<br>
          j keysAndValuesDo: [:key :value|<br>
              self instVarNamed: key put: value]</p>
    <p>Simple, stupid and good enough for several of my applications.<br>
    </p>
    <p>This should work across dialects if the destination image has the
      required classes in the same shape. The @Classname designator is a
      Smalltalk specific extension to JSON. I think it is not good
      enough to transfer object trees with cyclic dependencies. Other
      languages with a different ideas of how a class is constructed it
      might need more work.</p>
    <p>JSON excerpt:<br>
    </p>
    <p>[@IndividualGenom{"halfNum":77,"fitness":2.364011719201257,"fitnesses":null,"geneValues":[-0.7875619210225705,-1.1191086825115324,2.2987547782235476,-2.1996847933965746,3.3254889274350594,-1.7481778033261461
      ......<br>
    </p>
    Cheers,<br>
    <br>
    Herbert<br>
    <br>
    <div class="moz-cite-prefix">Am 21.10.2017 um 18:33 schrieb Kjell
      Godo:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAM+JcOjLfLcgMfBepnuxy3eXbnts74Nh5XFMTZPQso8cD4hGOQ@mail.gmail.com">
      <div dir="auto">Is JSON the preferred way to transfer data between
        different </div>
      <div dir="auto">     Smalltalk platforms?</div>
      <div dir="auto">     like Dolphin S8 visualWorks GnuSmalltalk
        Smalltalk/X Amber etc?</div>
      <div dir="auto">i would like a way for all the different things to
        talk to each other</div>
      <div dir="auto">     why should they all be seperate?</div>
      <div dir="auto"><br>
      </div>
      <div dir="auto">I am assuming JSON would be best for going between
        languages like </div>
      <div dir="auto">     Smalltalk - Lisp</div>
      <div dir="auto">     ( it is the easiest to get access to
        everything has a Package for it ).</div>
      <div dir="auto"><br>
      </div>
      <div dir="auto">Are there any Packages that are designed to link
        different languages together?</div>
      <div dir="auto">     like Smalltalk - Racket - CommonLisp -
        SWIProlog etc?</div>
      <div dir="auto">     i am assuming that sockets + JSON are the
        easiest quickest way</div>
      <div dir="auto">     or DCom or what was that Linux d-Bus is d-Bus
        also on Windows?easy?</div>
      <div dir="auto">     is COM also on Linux?does anyone use it?hard
        to use? </div>
      <div dir="auto">          Dolphin and VisialWork do COM</div>
      <div dir="auto">     is anyone doing this sort of thing?who would
        just know?</div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">
</pre>
    </blockquote>
    <br>
  </body>
</html>