可视化编程语言如何工作?
我正在探索向应用程序的用户呈现可视化界面的可能性,该界面将允许他们以数据流风格(a Yahoo Pipes)输入一些自定义代码/功能。
我想知道,例如在 Pipes 中,他们的可视化编辑器如何工作。视觉代码可以编译成文本语言并存储在数据库中吗?或者各个块、连接器、变量等都可以存储在数据库中吗?
像微软的 Visual Studio 这样的可视化编程语言 IDE 怎么样?代码是直接从可视界面解释的吗?
I'm exploring the possibility of presenting a visual interface to users of an application that would allow them to enter some custom code/functionality in a dataflow-ish style (a la Yahoo Pipes).
I'm wondering how, in Pipes for example, their visual editor could work. Could the visual code be compiled into a textual language which to be stored in a database? Or could the individual blocks, connectors, variables, etc. all be stored in a database?
What about visual programming language IDEs like Microsoft's Visual Studio? Is the code interpreted straight from the visual interface?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在屏幕上看到的只是冰山一角。组件是不同大小、困难或简单的程序,具有公共接口。在数据流编程中,这些接口是生产者和消费者(输出和输入),因此该组件可以可视化为一个黑匣子,其输入和输出侧都有引脚。当您连接引脚(端口)时,您将一个程序的输出引导到另一个程序的输入。这些组件已为您预编译,它们已准备好运行,您只需通过连接它们来设置它们的消费者(输入)和生产者(输出)。这就是为什么它们是黑匣子:它们是程序,您无法更改它们(除非您获得了源代码)。
这些组件被设计为可以与其他组件连接。在某些情况下,组件可以独立运行,但通常它们必须连接起来才能完成完整的工作。基本上,有以下三种组件:
- 源:生成输出(需要进一步处理或显示),
- 处理:接收输入,处理它,然后将其传递到进一步处理或显示,
- 接收器:接收输入,显示或保存它,并且不将其传递给任何人。
一个典型的完整数据流结构包含一个源-流程-流程-汇链,其中流程型组件的数量甚至可以为零(源生成的数据由汇组件显示)。您可以将这三个组件视为一个程序,但它们已经损坏,现在您可以重新组装它们。
最著名的数据流系统之一是 Unix shell。 CLI 命令是组件。它们是预编译的,你只需通过输入“|”来定义一个链他们之间。此外,大多数“源”命令可以独立使用,例如ls,并且大多数“接收器”组件可以从定义为参数的文件接收输入,例如more。
What you see on the screen is the top of the iceberg. Components are different size, difficult or simple programs, with public interfaces. In dataflow programming, these interfaces are producers and consumers (outputs and inputs), so the component can visualised as a black box with pins on its input and output sides. When you connect pins (ports), you lead one program's output to another program's input. The components are pre-compiled for you, they are ready to run, you have just set their consumers (inputs) and producers (outputs) by connecting them. That's why they are black boxes: they're programs, which you can't change (except if you got the source code).
The components are designed to be connected to others. Some cases, components can run stand-alone, but usually they have to be connected to do the complete work. Basicly, there are three kind of components:
- source: generates output (which requires further processing or displaying),
- process: receives input, processes it, then passes it to further processing or displaying,
- sink: receives input, displays or saves it, and doesn't pass it to anyone.
A typical complete dataflow construction contains a source-process-process-sink chain, where the number of process-type components can be even zero (the data generated by source is displayed by a sink component). You can think for that three components as they were one program before, but they've had broken, and you can now re-assemble them.
One of the most well known dataflow system is Unix shell. The CLI commands are the components. They're precompiled, you just define a chain by putting "|" between them. Also, most "source" commands can be used stand-alone, like ls, and most "sink" components can receive input from file defined as argument, e.g. more.