The open-sourced GitHub repo was created on the 3rd of Mar, 2019, and published on Microsoft.com on the 15th of April, 2019.

The Bosque programming language is an experiment in regularized design for a machine-assisted rapid and reliable software development.

The first publication of the language was done Mark Marron writes that The Bosque programming language is designed for writing code that is simple, obvious, and easy to reason about for both humans and machines. The key design features of the language provide ways to avoid accidental complexity in the development and coding process. The goal is improved developer productivity, increased software quality, and enabling a range of new compilers and developer tooling experiences.

The Bosque language derives from a combination of TypeScript inspired syntax and types plus ML and Node/JavaScriptinspired semantics. 

You can find a test compiler in the repository that consists of a Typescript code you can use to compile Bosque (.bsq) code.

Some examples:

Add two numbers:

function add2(x: Int, y: Int): Int {
    return x + y;
}

add2(2, 3) //5

All odd check using rest parameters and lambda:

function allOdd(...args: List<Int>): Bool {
    return args->all(fn(x) => x % 2 == 1);
}

allOdd(1, 3, 4) //false

Noneable access on the optional argument:

function tryGetProperty(r?: {f: Int, k: Int}): Int? {
    return r?.f;
}

tryGetProperty({f=2, k=1}) //2
tryGetProperty()           //none


Features:

  • All values in the Bosque language are immutable.
  • Typed strings provide named arguments along with rest and spread operators.
  • Bulk Algebraic Data Operations in Bosque start with support for bulk reads and updates to data values.
  • Errors and Checks in Bosque provide first-class support for expressing a full range of invariants, sanity-checks, and diagnostic assertions.

You can find more features about Bosque language here.


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *