是否可以在不使用任何插件的情况下将 Squeak VM 嵌入到 C 中?
我想使用 Smalltalk 作为 C 中的嵌入式 DSL 引擎。不需要插件,整个自定义环境将由我制作。所以几乎ObjectEngine将被保留。这可能吗?我目前正在尝试,但是任何帮助将不胜感激。
-- 编辑 --
任何 Smalltalk 实现嵌入指南也将受到赞赏。 (GNU Smalltalk 除外。因为它的许可证...)
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 --
Any of Smalltalk implementation embedding guidance will also be appreciated. (except GNU Smalltalk. Because of it's license...)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 Pharo/Squeak 来说这是一件困难的事情:
正如 Davorin 所写,Dolphin Smalltalk 可以部署为 DLL。同样,Cincom Smalltalk 和 Smalltalk/X 也可以实现这一点。不过所有这些 Smalltalk 都是商业的。
总而言之,您可能最好查看已经在您的环境中多次应用的 Lua 或 Python。
This is a difficult thing to do with Pharo/Squeak:
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.
曾经有一个关于 GSoC 的提案,但从未完成:
将 Squeak 打包为 DLL
使用特定语言编写的库可供其他语言使用的传统方法是将库打包为动态加载库或共享对象(DLL 从这里开始) )。将该方法应用于 Squeak 既可以让更广泛的受众使用 Smalltalk 代码,又可以为 Squeak 应用程序提供替代部署方法,从而简化为 Apache、Web 浏览器等系统创建 Squeak 插件的过程。一般来说,人们可以采取两种不同的方法,可以称为被动方法或主动方法。在被动架构中,Squeak dll 在从另一种语言调用之前处于非活动状态,并且仅在向调用者应答结果之前运行。在主动架构中,加载 dll 的行为会导致 Squeak 在自己的线程上启动,并以集合的形式接受来自其他线程的传入调用。被动方法更容易构建,但用处不大;没有全套的 Squeak 设施,例如轻量级流程、延迟等。
该项目的目标是根据学生的兴趣和能力实施被动或主动方法。目标是让 Squeak 对用户和应用程序部署者等具有更广泛的用途。需要满足许多技术挑战,其中涉及 Smalltalk 和 C 编码以及使用编写 Squeak VM 的 Smalltalk-C 混合语言俚语。
对学生的好处包括深入了解 dll、动态语言接口、外部函数接口和 Squeak VM。学生还将通过考虑被动和主动方法之间的许多权衡来了解架构问题。
Squeak 社区的好处在于能够比以前更广泛地打包和部署 Squeak 应用程序。
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.
Object Arts 的 Dolphin Smalltalk 可以部署为 dll。但是您需要检查您的特定用例的许可证,并且它仅限于 Windows。
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.