978-1-6654-4214-5/22/$31.00 ©2022 IEEE Code-Chips: Interactive Syntax in Visual Programming Anthony Savidis Institute of Computer Science – FORTH, and Computer Science Department - University of Crete, Heraklion, Crete, Greece as@ics.forth.gr Emanuel Agapakis Computer Science Department, University of Crete, Heraklion, Crete, Greece agapakis@csd.uoc.gr Abstract— Visual programming is widely adopted in learning, usually with jigsaw-style blocks that may be freely placed on a canvas. While grammatical correctness is forced by the allowed compositions, syntactic information is not communicated to learners, causing the underlying language grammar to be experientially assimilated. But grammars are crucial for the deeper understanding of languages, since syntax reflects all important semantic aspects and elements. We present a general- purpose syntax-directed visual editor with syntactic tooltips, accepting as input the grammar of the subject language. It adopts a block-based visual style for program elements. However, contrasting to the typical canvas layout, it supports a row-based grid for spatial organization, enabling newlines and indentation. It also allows users view the production chain of any program element for a better understanding of the language. Our early evaluation findings indicate that such a combination of interactive syntax and visual code blocks is very positively received by learners. Keywords— Visual programming, interactive programming environments, syntax-directed editing I. INTRODUCTION Visual languages for programming are distinguished from text-based source-code, providing multidimensional [1] interactive representations. Initially, they became popular as the main tools in the early teaching of programming, with environments such as Scratch [2] and App Inventor [4], which enable students to develop simple applications, games, animations, stories and more. Commercial tools like Lego Mindstorms Ev3 [25], building on the original foundations of Mindstorms [3], offered a flow-based visual language for software-programmed electromechanical components. Formally, all visual languages build on the theoretical foundation of programming and deliver a set of elements and constructs originating from the programming universe, although with a friendlier model and a graphical depiction. Sometimes the adoption of visual systems serves mainly learning purposes, being a stepping stone towards text-based programming systems. But in all cases, whether for learning for professional development, it is necessary to reveal the fundamental aspects of the underlying languages. Visual languages remain formally languages, with all lexical, syntactic and semantic aspects. So, their use is always improved when the deeper understanding of such disciplines is promoted or enabled during visual program construction. A. Motivation: The Syntax is the Message Through the knowledge of a language grammar and its syntactic structures, whether a natural or a programming one, more effective and expressive linguistic productions can be created, leading to an overall better understanding of the language itself. Particularly, according to [9], the study of language structures expands people’s universal language comprehension, and hence facilitates subsequent learning processes for different languages. We know that novices face significant difficulties with syntax when forming programs in traditional text-based programming languages [22], [23]. The overhead of learning syntactic details, on top of the inherent challenging nature of programming, can easily discourage students and increase the likelihood of quitting. Fig. 1: Syntax-directed editing in Code-Chips with blocks, enabling specialization of program elements based on their syntactic category, choosing grammar productions from dropdown lists (the grammatic production steps for this exampe are shown in the yellow text-box). 2022 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC) | 978-1-6654-4214-5/22/$31.00 ©2022 IEEE | DOI: 10.1109/VL/HCC53370.2022.9833103