All That You Need to Know About Microsoft's New Programming Language: Bosque
Tags: bosque, microsoft
Published: 2019-04-20 23:38:43

---
title: All That You Need to Know About Microsoft's New Programming Language: Bosque
published: true
description: 
tags: Bosque, Microsoft
cover_image: https://media0.giphy.com/media/13r9tgg7ZisiT6/giphy.webp
---

## What is Bosque?

From [Bosque GitHub repo](https://github.com/Microsoft/BosqueLanguage):

> The Bosque programming language is a Microsoft Research project that is investigating language designs for writing code that is simple, obvious, and easy to reason about for both humans and machines

### Lemme add a couple of points

* Bosque is typed and functional.
* Heavily affected by JavaScript, TypeScript, and ML.
* More of a **research product** than a profitable product.
* An open source project licensed under MIT (**very non-Microsoft'ish** 😁).

### When was it invented?

The [GitHub repo](https://github.com/Microsoft/BosqueLanguage) was created on 3rd of Mar, 2019, and [published on Microsoft.com](https://www.microsoft.com/en-us/research/project/bosque-programming-language/) on 15th of April, 2019.

### What's the implementation of the language?

Currently, the language is implemented on **TypeScript** which runs on Node.js.

## So, what does it bring new into the table?

### Maybe a new era of programming

![new-era](https://media2.giphy.com/media/xT8qBsqre4ULlw5c7C/giphy.gif?cid=790b76115cbba9e131414549493bed9d)

The author of Bosque, Mark Marron, introduces a new programming model called **Regularized Programming**.

[In his research paper](https://www.microsoft.com/en-us/research/uploads/prod/2019/04/beyond_structured_report_v2.pdf), he mentions how [structured programming](https://en.wikipedia.org/wiki/Structured_programming) (that we knew since 1970) might cause "accidental complexity"!

> We believe that, just as structured programming did years ago, this regularized programming model will lead to massively improved developer productivity, increased software quality, and enable a second golden age of developments in compilers and developer tooling.

### How Regularized Programming Differs from Structured Programming

You can simply say that: "Regularized Programming = **Structured Programming v2.0**".

That's how Marron tells us in his white paper, that regularized programming is built on structured programming... but, it aims to **eliminate sources of complexity**.

In other words, fewer bugs in your code!

The sources of complexity he mentions are:

* Loops, Recursion, and Invariants: I assume you already know those 😆
* Mutable State and Frames: mutable vs immutable objects are always confusing.
* Indeterminate Behaviors, like: uninitialized variables.
* Data Invariant Violations: accessing/modifying data using index in arrays and such.
* Equality and Aliasing: by value, by reference variable passing.

### Code sample

Instead of doing the usual iterative loop in C, e.g: 

Multiply all array elements by 2.

```c
int a[5] = {1, 2, 3, 4, 5};
int b[5];
for(int i=0; i<5; i++)
    b[i] = a[i]*2;
```

Bosque **avoids the whole idea about looping and accessing array directly from the memory** by doing:

```javascript
var a = List[Int]@{1, 2, 3, 4, 5};
var b = a.map[Int](fn(x) => x*2);
```

### It's all academic for now

Now, don't jump to use this in your company or workplace 😆

Cuz, the whole thing is academic and **meant for R&D** for the next programming languages generation.

Quoting from the project repo:

> we do not recommend the use of the Bosque language for any production work and instead encourage experimentation only with small/experimental side projects at this point in time.

### Fun fact

People are already questioning the async model for this programming language 😂

![async-model](https://thepracticaldev.s3.amazonaws.com/i/w0vqomqsprfrzz6l7oz0.png)

### Bonus fun fact

> [OP](https://developers.slashdot.org/comments.pl?sid=13802960&cid=58460406): There will likely be job offers in the next few weeks asking for a couple years of experience with this new programming language.

> Re: And there will be people applying with 5 years experience already too :P

![minions](https://media.giphy.com/media/ZqlvCTNHpqrio/giphy.gif)

### What do you think

Do we really need a new programming language with a whole new paradigm? 
Would it be really useful to have Bosque?