开发者

Is it possible to make a Squeak VM embedded in C without any plugins?

开发者 https://www.devze.com 2023-03-13 00:19 出处:网络
I want to use Smalltalk as an embedded DSL engine in C. No plugins required, and whole customenvironment will be made by me. So almost ObjectEngine will be remained. Is this possible? I\'m currently t

I want to use Smalltalk as an embedded DSL engine in C. No plugins required, and whole custom environment will be made by me. So almost ObjectEngine will be remained. Is this possible? I'm currently trying, however any help will be appreciated.

-- edit --

An开发者_如何学JAVAy of Smalltalk implementation embedding guidance will also be appreciated. (except GNU Smalltalk. Because of it's license...)


This is a difficult thing to do with Pharo/Squeak:

  1. The object engine depends on many primitives and thus many plugins need to be present. A while back most plugins couldn't be compiled statically. I don't know if this is still the case?
  2. Building a whole custom environment is tricky, because it most likely means to strip down an existing image. There are various projects that try to build the infrastructure to bootstrap new images, but I haven't seen working solutions yet.

As Davorin writes Dolphin Smalltalk can be deployed as DLL. Similarly this is possible with Cincom Smalltalk and Smalltalk/X. All these Smalltalk's are commercial though.

To summarize, you are probably better off looking at Lua or Python that have been applied in your context many times already.


There was once a proposal for GSoC but never done:

Packaging Squeak as a DLL

A conventional approach to making libraries written in a particular language available to other languages is to package a library as a dynamic load library or shared object (dll from here on in). Adapting that approach to Squeak would both allow use of Smalltalk code by a wider audience and enable alternative deployment approaches for Squeak applications, easing the creation of Squeak plug-ins for systems like Apache, web browsers and so on. There are broadly two different approaches one can take, which one could call passive or active. In the passive architecture, the Squeak dll is inactive until called from another language, and runs only until a result is answered to the caller. In the active architecture the act of loading the dll causes Squeak to start up on its own thread and accept incoming calls from other threads in a form of rendezvous. The passive approach is easier to build but less useful; one does not have the full range of Squeak facilities such as light-weight processes, delays etc.

The objective of the project would be to implement either the passive or the active approach, depending on the student's interest and ability. The goal is to make Squeak more broadly useful to users and application deployers alike. There are many technical challenges to be met that will involve both Smalltalk and C coding and the use of the Smalltalk-C hybrid language Slang in which the Squeak VM is written.

The benefits to the student include gaining an in-depth understanding of dlls, interfacing to dynamic languages, foreign function interfaces and of the Squeak VM. The student will also be gaining an understanding of architectural issues by considering the many trade-offs between the passive and active approaches.

The benefits to the Squeak community will be in being able to package and deploy Squeak applications much more broadly than before.


Dolphin Smalltalk from Object Arts can be deployed as dll. But you would need to check the license for your particular use case, and it is windows only.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号