The dominant programming languages support nothing but linear text to express domain-specific geometric ideas. What is needed are hybrid languages that allow developers to create visual syntactic constructs so that they can express their ideas with a mix of textual and visual syntax tailored to an application domain. This mix must put the two kinds of syntax on equal footing and, just as importantly, the extended language must not disrupt a programmer's typical workflow. This means that any new visual syntax should be a proper language extension that is composable with other language features. Furthermore, the extensions should also preserve static reasoning about the program. This paper presents Hybrid ClojureScript the first such hybrid programming language. Hybrid ClojureScript allows programmers to add visual interactive syntax and to embed instances of this syntax within a program's text. An enhanced hybrid IDE can then display these embedded instances as mini-GUIs that programmers interact with, while other IDEs will show a textual representation of the syntax. The paper argues the necessity of such an extensibility mechanism, demonstrates the adoptability of the design, and discusses what might be needed to use the design in other languages.
翻译:当前主流的编程语言仅支持线性文本来表达领域特定的几何思想。实际需求是开发混合语言,允许开发者创建视觉化的句法结构,从而能够结合针对应用领域定制的文本与视觉语法表达其思想。这种混合必须使两种句法处于平等地位,更重要的是,扩展后的语言不能干扰开发者的典型工作流程。这意味着任何新的视觉句法都应是恰当的语言扩展,能够与其他语言特性组合使用。此外,这些扩展还应保留对程序的静态推理能力。本文提出了Hybrid ClojureScript——首个此类混合编程语言。Hybrid ClojureScript允许程序员添加视觉交互式句法,并将该句法的实例嵌入程序文本中。增强型混合IDE可将这些嵌入式实例显示为程序员可交互的微型图形界面,而其他IDE则会展示该句法的文本表现形式。本文论证了此类可扩展机制的必要性,展示了该设计的可采纳性,并讨论了在其他语言中应用该设计所需的潜在条件。