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 that enables programmers to use different nominal, structural, and combination types to encode the relevant features of the problem domain flexibly.

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.

Bosque could be extremely useful in cloud-based development projects whose architectures depend on microservices, serverless functions, and RESTful APIs. It could enable zero-cost loading for quick startup, ultralow overhead tracing, and runtime with minimal performance variability.

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.

Initial experiments indicate that it can empower several next-generation experiences, such as API auto-marshaling, improved fuzzing, symbolic testing, and realtime compilation with stable GC support.

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

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

I am a professional technology and business research analyst with more than a decade of experience in the field. My main areas of expertise include software technologies, business strategies, competitive analysis, and staying up-to-date with market trends.

I hold a Master's degree in computer science from GGSIPU University. If you'd like to learn more about my latest projects and insights, please don't hesitate to reach out to me via email at [email protected].

View all articles
Leave a reply

1 comment
  • premkumar says:

    i want to learn program creat in the coding