Question

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.)

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top