沙盒和无堆栈Python?

发布于 2024-10-01 08:57:53 字数 521 浏览 0 评论 0原文

我需要一种脚本语言来描述非常复杂的工作流程。

  • 这些工作流程需要暂停 每当需要用户输入时,以及 给出后恢复(可能是 几个月后)。看来来自 Stackless 的可序列化延续是一个不错的选择。

  • 用户还需要能够编辑 工作流程本身。我不确定序列化的延续将如何处理底层代码更改。我想我可能需要将 Git 版本哈希与延续一起保存,并且仅在不需要状态的检查点“升级”延续。

  • 我更喜欢 Python 语法,因为 可读性是一个非常高的优先级, 动态特性是关键。不过,我愿意接受建议。

  • 最终我可能会编写一个可视化流程图编辑器来操作底层代码。

我深入研究了 Stackless 和 PyPy。 Stackless 似乎没有提供任何沙盒的承诺,而 PyPy 似乎同时提供了 stackless 和沙盒,但我找不到任何提及同时拥有两者。

有什么解决方案吗?如果有专家可以帮助我找到一个好的解决方案,我就有一个 PayPal 帐户并且愿意使用它。

I need a scripting language for describing very complicated workflows.

  • These workflows need to be paused
    whenever user input is required, and
    resumed after it is given (could be
    months later). Seems like serializable continuations from Stackless would be a good fit.

  • Users also need to be able to edit
    the workflows themselves. I'm not sure how serialized continuations would handle underlying code changes. I think I might need to save the Git version hash along with the continuation, and only 'upgrade' a continuation at checkpoints where no state is needed.

  • I prefer the Python syntax since
    readability is a very high priority,
    and dynamic features are key. I'm open to suggestions, though.

  • Eventually I'll probably write a visual flow-chart editor that maniupulates the underlying code.

I've looked in depth at Stackless and PyPy. Stackless doesn't seem to offer any promises of sandboxing, while PyPy seems to offer both stackless and sandboxed, but I can't find any mention of having both at the same time.

Any solutions? If there's an expert out there who can get me going with a good solution, I've got a paypal account and I'm willing to use it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

星軌x 2024-10-08 08:57:53

在大多数具有本机协同例程库的语言中,您的序列化要求将很困难。您可能需要以另一种方式实现协同例程以允许对象图序列化。

Lua 有 Pluto 库,它可以持久化线程(协同例程): http://lua-users.org /wiki/PlutoLibrary

就沙盒中的“安全”执行而言,Lua 是首选。您可以在一个应用程序中拥有多个 lua 状态,而不会出现任何问题,并且它支持该语言中的协同例程。它还具有 VM 形式相当快的优点,并且 luajitluajit /shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php?gpp=on&javasteady=on&luajit=on&java=on&lua=on&python3=on&calc=chart “ rel="nofollow">在许多情况下与 Java JIT 竞争。

Your serialization requirement will be difficult in most languages with native co-routine libraries. You might need to implement co-routines in another way to allow for object graph serialization.

Lua has the Pluto library, which CAN persist threads (co-routines): http://lua-users.org/wiki/PlutoLibrary

As far as "safe" execution in a sandbox, Lua is a first choice. You can have multiple lua states in a single application with zero issues, and it supports co-routines in the language. It also has the benefit of being quite fast in its VM form, and with luajit is competitive with Java JIT in many cases.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文