Commit 030632a9e227082b4bf0d38e0ca5a6242badb424

Authored by Göran Krampe
1 parent 71252402

Tweaked README

Showing 1 changed file with 22 additions and 11 deletions
README.md
@@ -11,7 +11,18 @@ You write a Nim module and use some macros to generate a .st file on the side @@ -11,7 +11,18 @@ You write a Nim module and use some macros to generate a .st file on the side
11 containing the Smalltalk glue code. When you compile the Nim code the .st file 11 containing the Smalltalk glue code. When you compile the Nim code the .st file
12 is automatically generated. You then file that into the image. 12 is automatically generated. You then file that into the image.
13 13
14 -See full example in tests directory. 14 +See full example in tests directory. Here is how to try it:
  15 +
  16 +- Install Nim, latest. See nim-lang.org.
  17 +- Clone squeaknim, its just a single source file really.
  18 +- Install FFI into your Squeak/Nim image. Old one.
  19 +- Compile the Test1.nim file using "nim c Test1.nim". Should give you Test1.st and libTest1.so/dll.
  20 +- Make sure the compiled libTest1.so/dll is loadable by the VM (copy to working dir for example)
  21 +- File in Test1.st that was generated.
  22 +- File in Test1-Test.st that has a SUnit test for the above glue code.
  23 +- Run in SUnit. Bask in green glory, or cry.
  24 +
  25 +The FFI should be the "good old" one - via Configurations in Pharo seems to work fine. Via SqueakMap worked in Squeak 5, I think I had to use "head".
15 26
16 ## Squeak FFI 27 ## Squeak FFI
17 28
@@ -19,7 +30,7 @@ What follows is a text written by Sean DeNigris describing the FFI. You can @@ -19,7 +30,7 @@ What follows is a text written by Sean DeNigris describing the FFI. You can
19 also see the code in the client image of course, with tests and class comments 30 also see the code in the client image of course, with tests and class comments
20 etc. 31 etc.
21 32
22 -## How does FFI work? 33 +### How does FFI work?
23 34
24 Technically what happens is: 35 Technically what happens is:
25 36
@@ -146,7 +157,7 @@ Caveats @@ -146,7 +157,7 @@ Caveats
146 - If you crash Squeak when it is running the garbage collector, then 157 - If you crash Squeak when it is running the garbage collector, then
147 you know your FFI code is leaking bits into object memory [2] 158 you know your FFI code is leaking bits into object memory [2]
148 159
149 -What do I need to use FFI with Squeak? 160 +### What do I need to use FFI with Squeak?
150 161
151 You need the FFI plugin, which is included with most VM's as of Squeak 3.6 162 You need the FFI plugin, which is included with most VM's as of Squeak 3.6
152 or so. 163 or so.
@@ -154,12 +165,12 @@ or so. @@ -154,12 +165,12 @@ or so.
154 You can also build the plugin yourself. See VMMaker. 165 You can also build the plugin yourself. See VMMaker.
155 166
156 References: 167 References:
157 -[1] http://wiki.squeak.org/squeak/1414  
158 -[2] http://wiki.squeak.org/squeak/2424  
159 -[3] http://wiki.squeak.org/squeak/5716  
160 -[4] http://wiki.squeak.org/squeak/2426  
161 -[5] http://forum.world.st/squeak-dev-Alien-Squeak-FFI-issues-on-Snow-Leopard-td85608.html  
162 -[6] http://wiki.squeak.org/squeak/5846  
163 -[7] http://forum.world.st/FFI-Callbacks-td54056.html#a54073  
164 -[8] http://forum.world.st/Security-td99624.html#a99635: 168 +1 http://wiki.squeak.org/squeak/1414
  169 +2 http://wiki.squeak.org/squeak/2424
  170 +3 http://wiki.squeak.org/squeak/5716
  171 +4 http://wiki.squeak.org/squeak/2426
  172 +5 http://forum.world.st/squeak-dev-Alien-Squeak-FFI-issues-on-Snow-Leopard-td85608.html
  173 +6 http://wiki.squeak.org/squeak/5846
  174 +7 http://forum.world.st/FFI-Callbacks-td54056.html#a54073
  175 +8 http://forum.world.st/Security-td99624.html#a99635:
165 176