BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Microsoft Introduces Bosque, a Programming Language for Writing Easy-to-Reason-about Code

Microsoft Introduces Bosque, a Programming Language for Writing Easy-to-Reason-about Code

This item in japanese

Bookmarks

Microsoft has recently introduced the Bosque programming language, an investigative language design research project "for writing code that is simple, obvious, and easy-to-reason-about for both humans and machines." According to Microsoft, "the goal is improved developer productivity, increased software quality, and enabling a range of new compiler and tooling experiences." The language derives from a combination of TypeScript inspired syntax and types, plus ML and Node/JavaScript inspired semantics. It is the latest addition to the list of programming languages developed by Microsoft, which includes popular languages like TypeScript, C#, and F#.

Bosque is an illustration of a programming paradigm called "regularized programming", which is introduced by Mark Marron, principal research software development engineer at Microsoft. Regularized programming is an effort to build on the success of the structured programming model which rose to prominence in the 1970s. The structured programming model aims at improving the clarity and quality of computer programs, while also reducing the development time through the use of selection, repetition, block constructs, and subroutines.

In his paper introducing regularized programming, Marron states that the rise of structured programming and abstract data types "represented a move away from a programming model that reflected incidental features of the underlying hardware architecture and toward a model that emphasized programmer intent more directly. This shift simultaneously made it easier and less error-prone for a developer to convert their mental model of a system into code, and led to a golden age of compiler and IDE tooling development." According to him, "these programming methodologies simplified the reasoning of a program by eliminating substantial sources of accidental complexity." In his paper, he lists a few additional sources of complexity not dealt with by the structured programming model and describes how regularized programming, demonstrated via Bosque, seeks to eliminate these with the goal of advances in software quality, programmer productivity, and compilers/tooling.

The paper lists five major sources of complexity, based on developer interviews, personal experience with analysis/runtime/compiler development, and empirical studies. These sources are mutable state and frames, loops, recursion, and invariants, indeterminate behaviour (sort stability, map/dictionary enumeration order, etc.), data invariant violations, and equality and aliasing. According to Marron, these are the causes behind various bug families, they increase the effort required to implement functionality in a program, and greatly complicate automatic reasoning about a program. Bosque handles these problems via multiple language features such as the use of immutable data, eliminating loops and restricting recursion, fully determinizing the language semantics, introducing algebraic bulk data operators, etc.

The language has caught the attention of the community, with people discussing the language features, syntax, and its purpose on forums like Reddit, HackerNews, and Twitter. A user arrow7000 questioned Marron on HackerNews about the purpose of the language and how it was intended to be better in comparison with existing languages. According to Marron, Bosque is planned to be used as a proof of concept to explore language design choices, with the aspirational goals of enabling automated developer tools like compilers and verifiers.

Bosque's GitHub page mentions that the project is in an early state and invites academic collaboration and community participation. It states that the functionality is limited, acknowledges the presence of bugs, and hence the recommendation is to use it for experimentation in side projects and not for any production work. Also, since the main focus of the project is core language design. there is limited support for compilation/development and no support for packaging, deployment, lifecycle management, etc.

For more information, you can check out Bosque's GitHub page.

Rate this Article

Adoption
Style

BT