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。该语言允许程序员添加可视化交互语法,并将该语法的实例嵌入程序文本中。增强型混合集成开发环境可将这些嵌入实例显示为可供交互的微型图形界面,而其他集成开发环境则会显示该语法的文本表示。本文论证了此类可扩展机制的必要性,展示了该设计的可采纳性,并探讨了在其他语言中应用此设计可能需要的条件。