Content area

Abstract

Context: Syntax is fundamental to any programming language: syntax defines valid programs. In the 1970s, computer scientists rigorously and empirically studied programming languages to guide and inform language design. Since then, language design has been artistic, driven by the aesthetic concerns and intuitions of language architects. Despite recent studies on small sets of selected language features, we lack a comprehensive, quantitative, empirical analysis of how modern, real-world source code exercises the syntax of its programming language. Objective: This study aims to understand how programming language syntax is employed in actual development and explore their potential applications based on the results of syntax usage analysis. Method: We present our results on the first such study on Java, a modern, mature, and widely-used programming language. Our corpus contains over 5000 open-source Java projects, totalling 150 million source lines of code (SLoC). We study both independent (i.e. applications of a single syntax rule) and dependent (i.e. applications of multiple syntax rules) rule usage, and quantify their impact over time and project size. Results: Our study provides detailed quantitative information and yields insight, particularly (i) confirming the conventional wisdom that the usage of syntax rules is Zipfian; (ii) showing that the adoption of new rules and their impact on the usage of pre-existing rules vary significantly over time; and (iii) showing that rule usage is highly contextual. Conclusions: Our findings suggest potential applications across language design, code suggestion and completion, automatic syntactic sugaring, and language restriction.

Details

10000008
Title
Understanding the syntactic rule usage in java
Publication title
Volume
123
First page
160
Publication year
2017
Publication date
Jan 2017
Publisher
Elsevier Sequoia S.A.
Place of publication
New York
Country of publication
Switzerland
ISSN
01641212
e-ISSN
18731228
CODEN
JSSODM
Source type
Scholarly Journal
Language of publication
English
Document type
Feature
ProQuest document ID
1843009660
Document URL
https://www.proquest.com/scholarly-journals/understanding-syntactic-rule-usage-java/docview/1843009660/se-2?accountid=208611
Copyright
Copyright Elsevier Sequoia S.A. Jan 2017
Last updated
2023-11-28
Database
ProQuest One Academic