MediaWiki:Blockedtitle

From askoh.net wiki

Jump to: navigation, search

This will serves as a record of work done on the project Squeak DLL.


Contents

VS SqueakVM

Embedded Squeak

Update 18 Jan 2010: Please take a look at Embedded Squeak.

With only console input, Embedded Squeak is probably what we need for a Squeak DLL.

  1. Download Embedded Squeak. This zip file comes with Squeak.exe and also the source code. Squeak.exe may be use to experience Embedded Squeak. I'm going to use the source code for VS compilation so that I can step through it (in debug mode).
  2. Open Visual Studio, create a new project. e.g. name it EmbeddedSqueak, under directory C:\Work\EmbeddedSqueak.
  3. From the zip file, extract these following files into working directory. e.g. C:\Work\EmbeddedSqueak.
    1. ImageFileInMemory.c
    2. interp.c
    3. sqMiscPrims.c
    4. sqEmbedded.c
    5. sqFilePrims.c
    6. sqWin32.h
    7. sq.h
    8. sqConfig.h
    9. sqMachDep.h
    10. sqPlatformSpecific.h
    11. readme.txt
    12. Squeak.ini
  4. Right-click on the project name, choose Add -> Existing item.., add all .h and .c files above to the project.
  5. Right-click on project name, choose Properties. Under Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions, fill in WIN32;_DEBUG;_WINDOWS;__i386__;_CRT_SECURE_NO_DEPRECATE;VM_NAME=\"Squeak\";_USE_32BIT_TIME_T;EMBEDDED.
  6. Now, build can be successfully carried out. But, trying to debug will cause runtime error. Error message: The variable 'result' is being used without being initialized. Edit line 6697 in interp.c, i.e. int result = 0;. Do the same for any similar error pops up.
  7. Build the project, and debug it. Type in Smalltalk expression, e.g. 0.1234 class, returns Float.

Note

30 June 2009 ref:8

DLL limitation: plugin is expected to link against main application. But dll doesn't link back to application. Solution:

  1. Create a way for dll to receive a pointer to an object defined in the main application.
  2. The sub-DLL solution: create a small dll to link against real dll. This dll can export all symbols needed in a plug-ins.
  3. The .def & .a solution: create a .def and .a set of files from main application. These files can later be used to link the DLLs. This solution is to trick the linker and later the LoadLibrary() function to look in the main application for symbols.
  4. The edll solution

Virtual Machine Work

  1. Build VM's with Visual Studio and GCC for Squeak, Cobalt, Pharo, Cog.
  2. Make every package self contained and ready to run and debug independently.
  3. Keep them up to date.
  4. Show how to make named primitives.
  5. Show how to make plugins.
  6. Make SimulatorInterpreter work.
  7. Make VM handle callbacks.
  8. Make VM run as DLL or shared library.

Virtual Machine Questions

1.How is interp.c generated? interp.c is generated by VMMaker in Squeak. It is written in Slang, it include Interpreter and ObjectMemory class mainly. Changes can be made to these classes in Squeak, and VMMaker will translate it into C.


2.What does VMMaker do? Translate Slang into C. Manage location (directory) of each file for a VM build, including platform specific files. See VMMaker.


Other pages available

  1. VS SqueakVM 3.10
  2. VS SqueakVM 3.9 (1)
  3. VS SqueakVM 3.9 (2)
  4. Embedded Squeak
  5. SqueakDLL
  6. SqueakDLL4.0
  7. VMMaker
  8. Squeak Virtual Machine
  9. Interpreter Simulator
  10. Slang Browser
  11. Work with SketchUp
Personal tools
Navigation