易于使用、可能是图形化的脚本语言的灵感

发布于 2024-08-13 20:13:34 字数 700 浏览 3 评论 0原文

我必须在我们的产品中实现一些脚本功能。脚本通常用于简单的事情,例如:

IF param1 > 5 + param3 AND current time > 18.00:
  SET param2 TO 3
ELSE
  SET param2 TO 4

另一个非常常见的任务是让参数在一天中变化,最好使用一些带有可以在视觉上移动的设定点的线图等。

现在,我需要关于如何实现的灵感这。我们的客户今天使用的非常过时的工具只不过是图形化的基本方言:您不必以纯文本形式键入脚本,但可以拖动“IF”、“THEN”、“ELSE”、“参数”等符号、“当前时间”等到画布上,你必须知道并理解语法和语义。我认为我们可以做得更好。

我一直在寻找图形语言,但还没有找到一个令人信服的系统。

例如,有乐高 Mindstorm 语言,它非常简单,但非常面向自动化,并且不能很好地处理数学和逻辑。还有labview,对于典型用户来说似乎有点太复杂了。 PLC 使用梯形图编程,但我的经验是,它们也非常面向自动化,并且不能很好地处理数学。有雅虎管道和一些软件合成器的互连盒方法,但是当需要数学时它们使用起来也很麻烦,并且控制序列不是很自然。然后还有非常简单的向导式替代方案,例如 Outlook 和 Evolution 中的过滤器,但我认为它们不够灵活。

那么,您偶然发现并喜欢哪些图形语言? (我知道几乎没有程序员,包括我自己,喜欢这些语言,但我认为它们在这里有一个目的。)

I have to implement some scripting capabilities in our product. The scripting will typically be used for simple things such as:

IF param1 > 5 + param3 AND current time > 18.00:
  SET param2 TO 3
ELSE
  SET param2 TO 4

Another very common task is to let a parameter vary over the day, preferably using some line diagram with setpoints that can be moved around visually etc.

Now, I need inspiration for how to implement this. The very outdated tool our clients use today is little more than a graphical basic dialect: you don't have to type the script in plain text but can drag symbols such as "IF", "THEN", "ELSE", "Parameter", "Current time", etc, onto a canvas, and you have to know and understand the syntax and semantics. I think we could do better.

I've been looking around for graphical languages, but I've yet to find a compelling system.

For example, there's the Lego Mindstorm language, that is very simple but it's very directed to automation, and does not handle math and logic very nice. There's labview, which seems a little too complicated for the typical users. There's ladder-programming as used for PLC's, but my experience is that they are also very automation-oriented and doesn't handle math very well. There's the interconnected-boxes approach of Yahoo Pipes and some software synthesizers, but they also get cumbersome to work with when math is needed, and control sequences are not very natural. Then there's very simple, wizard-style alternatives, such as the filters in Outlook and Evolution, but I don't think they are flexible enough.

So, what graphical languages have you stumbled upon and kind-of liked? (I know hardly no programmers, myself included, enjoy these kind of languages, but they serve a purpose here I think.)

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

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

发布评论

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

评论(1

紫﹏色ふ单纯 2024-08-20 20:13:34

您正在寻找表达式树类型的图形语言,还是命令式语言?

以下是我过去使用过的几种图形语言。不幸的是,它们不是通用或独立的产品,因此它们仅作为灵感:

Unreal Kismet:图形化、基于节点的脚本游戏脚本环境。基于事件生成器和操作。每个节点都可以获取输入事件并生成输出事件。非常适合简单的脚本编写,其中游戏需要对游戏中的某些事件做出反应(当玩家进入触发音量等时锁门)。实现复杂的逻辑(例如 for 循环、数组等)非常繁琐且容易出错,并且此类构造通常使用 UnrealScript 通过构建专门的 Kismet 节点来实现。基于事件流。

Native-instruments Reaktor:模块化合成器环境。与 Kismet 有点相似,但用于生成和处理音频和 MIDI 事件。同样,创建复杂的逻辑也很乏味。

着色器/合成/动画树编辑器:许多游戏引擎和 3D 软件都包含这些。基本上是一个表达式树,其中有带有输入和输出的运算符节点。

AI行为树:不仅仅是表达式树,类似于有限状态机。

Are you looking for expression tree kind of graphical language, or imperative language?

Here are few graphical languages I've used in the past. Unfortunately they are not generic or stand-alone products, so they only serve as an inspiration:

Unreal Kismet: A graphical, node based scripting game scripting environment. Based on event generators and actions. Each node can take input events and generate output events. Well suitable for simple scripting where game needs to react to certain events in the game (lock door when player enters a trigger volume etc). Implementing complex logic (such as for-loops, arrays etc) is quite tedious and error-prone, and such constructs are usually implemented using UnrealScript by building specialized Kismet nodes. Based on flow of events.

Native-instruments Reaktor: A modular synthesizer environment. A bit similar as Kismet, but used for generating and processing audio and MIDI events. Similarly, creating complex logic is tedious.

Shader/composition/animation tree editors: Many game engines and 3D software include these. Basically an expression tree where you have operator nodes with inputs and outputs.

AI behavior trees: More than expression trees, similar to finite state machines.

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