Bosque: Microsoft’s New Programming Language Without Loops

  • Bosque language aims to improve software quality and enhance programmers’ productivity.
  • It gets rid of sources of complexity like mutable state, reference equality, and loops.
  • It is inspired by TypeScript and JavaScript programming languages.

Structured Programming and Abstract Data Types became popular in the 1970s and since then we have been using them in almost all programming languages. These methodologies allowed programmers to focus on the intent and core behavior of their code without worrying about hardware architecture. Soon this led to a golden era of compilers and Integrated Development Environment.

In order to further enhance productivity, improve software quality, and enable several new compilers and developer tooling experiences, engineers at Microsoft recently came up with a new programming language named Bosque.

Bosque is designed to write simple and easy-to-reason code for both machines and humans. It offers a number of ways to avoid ‘accidental complexity’ in the coding and development process.

Regularized Programming

The flow control in a structured programming model is managed by conditions, subroutines, and loops. The new programming language, on the other hand, gets rid of sources of complexity like mutable state, reference equality, and loops. That’s why developers have described this paradigm as ‘regularized programming’.

Bosque is derived from a combination of TypeScript inspired syntax and type plus ML and JavaScript/Node inspired semantics. It supports a non-opinionated type system which enables programmers to use different nominal, structural and combination types to flexibly encode the relevant features of the problem domain.

Reference: Microsoft | Moving Beyond Structured Programming

The language doesn’t use ‘while’, ‘do while’ and ‘for’ loops and has a completely different approach when it comes to applying conditions. Mark Marron, a computer scientist at Microsoft, introduced the concept of ‘Functors’ to replace structured loops while increasing the software quality.

Bosque Programming Language without loopsFunctors with Symbolic Transformers

Bosque provides specialized bulk algebraic data operations and integrated support for none (or optional data) processing. It also supports the pipeline for collection processing, and if and match as expressions.

There is less need for a large set of statement combinators due to the rich set of expression primitives in Bosque. The language provides an assert (enabled only for debug builds) and check (enabled for all builds) as first class features, in addition to post/pre conditions and class invariants. Also, there isn’t any looping construct in Bosque.

Read: NASA’s 10 Coding Rules for Writing Safety Critical Program

What’s Next?

This new language is still in the development phase and if you want to test it, the code is available on GitHub.

Bosque is subject to revision, there are several bugs and missing functionality, and the performance can still be improved a lot. Marron and his team will focus on more advanced developer tooling experiences, such as automatically setting bounds for memory usage over time and verifying apps free of runtime errors without additional efforts.

Written by
Varun Kumar

Varun Kumar is an experienced science and technology journalist interested in machines, AI, and space exploration. He received a Master's degree in computer science from Indraprastha University. To find out what his latest project is, feel free to directly email him at [email protected] 

View all articles
Leave a reply