4

If I would like to interconnect two Smalltalks, namely Smalltalk/X with GemStone/S, what approach would you recommend? I would like to have an application in Smalltalk/X with persistent objects in GemStone/S.

Prior to any development I tried to investigate the issue. I have found some open-source implementation done - I like to learn from others mistakes so I don't repeat them.

I have found an implementation for Pharo - gt4gemstone - Glamorous Toolkit for remote work with Gemstone/S.

I have found also from James Foster - Jade which achieves more as it is an

Alternative Development Environment (IDE) for GemStone/S that runs on Microsoft Windows.

Where would you recommend to start? Would it be to read the gt4gemstone or Jade and then come up with similar way to interconnect Smalltalk/X with GemStone/S?

tukan
  • 17,050
  • 1
  • 20
  • 48

1 Answers1

3

Glad to hear of your interest in GemStone (one of my passions!). The key to interoperability with GemStone is to provide a wrapper for the GemStone C Interface (GCI), a C library used to connect to GemStone. This is the method used by every GemStone client (whether C, Smalltalk, or something else) to communicate with the system.

For a Smalltalk example, see GciLibrary* and GciSession in Jade.

For a couple other recent examples that might be cleaner starting points, see GciForJavaScript, GciForPython.

For an older (ruby) example see gemstone_ruby.

So, I'd suggest that you investigate what Smalltalk/X has for a Foreign Function Interface (FFI), then follow the examples above to connect to GemStone.

tukan
  • 17,050
  • 1
  • 20
  • 48
James Foster
  • 2,070
  • 10
  • 15
  • Great answer! I saw your 101 on GemStone (priceless), will have view it few times more because it is packed with information! Thank you for your hard work James. I know ruby so I'll read that + your Jade client looks really nice - your code is nicely readable, I enjoy that (python is close to ruby so I could read that, with the javascript I try to avoid it as much as I can). I did not manage to get to ESUG this year, I hope to be there next one. Hope you enjoyed it! – tukan Sep 05 '19 at 08:17
  • 2
    I think the best approach would be to port relevant portions of Jade code. In Smalltalk/X you can load Dolphin's `.cls` files using: ``` '/tmp/Jade/sources/GciThreadSafeLibrary.cls' asFilename readingFileDo:[ :s | ChangeSet fromDolphinPACStream: s ] ``` As for FFI, a quick glance to Smalltalk/X bytecode compiler and to `stc` compiles makes me think Dolphin FFI syntax is supported out-of-the-box. If not, automated refactoring from Dolphin to St/X syntax should be straightforward. `ChangeSet fromDolphinPACStream:` might also need some tweaks. – J.V. Sep 05 '19 at 22:08
  • @J.V. Thank you for the comment, will try to do so :). By the way James what is the difference between Jade & Jadeite (Jade's fork, why was there a need for a fork?) – tukan Sep 06 '19 at 11:27
  • 2
    @tukan, In the case of Jade[ite], GemTalk wanted to develop an "official" IDE that supported Rowan and we agreed to a fork with a new name to let that project proceed with what was expected to be some significant changes. Yes, this could have been done with a branch, but it didn't seem as appropriate for the "official" version to be in my personal repository. I expect that Jade will incorporate Jadeite's features eventually, once things stabilize. Or maybe we will merge some of Jade's changes (e.g., support for Unicode) into Jadeite. – James Foster Sep 07 '19 at 02:05
  • @JamesFoster I see, thank you clearning it up. The unicode, you mean UTF-16 within Jade? I have successfully compiled `DolpinVM` with `Jade` at VS 2019 Community Edition - there were some minor things to watch for, but otherwise than that it compiled just fine. – tukan Sep 09 '19 at 15:18