Bosque Programming Language - Learn the Basics

Posted in

Bosque Programming Language -  Learn the Basics
vinaykhatri

Vinay Khatri
Last updated on April 19, 2024

    Microsoft a tech giant has bought a new player in the field of Programming languages, yes it Just has released a new programming language called Bosque. It’s said that it is inspired by the syntax of TypeScript, The semantics of Machine Learning and Node.js. Microsoft has released a GitHub repository for the Bosque in which they have provided some function examples which seems that the Bosque is designed to focus on the functional programming language more than the paradigm of Structured programming.

    Bosque Programming Language

    Microsoft has released it as an open-source programming language and the first publication of the language was done Mark Marron on 15 th April 2019 on the official website of Microsoft. In the overview, 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”. Marron referred Bosque as “regularized programming” and believes that this will provide more productivity in the developer community, increase the quality of software and enable a second golden age of developments in compilers and developer tools.

    Features

    • It Avoids Accidental Complexity
    • Improve developer productivity
    • Increase software quality
    • Enable a range of new compilers and developer tooling experiences

    Examples from GitHub repo

    Add 2 numbers:

    function add2(x: Int, y: Int): Int {
        return x + y;
    }
    
    add2(2, 3) //5

    Sign (with optional argument):

    function sign(x?: Int): Int {
    
        var! y;
        if(x == none || x == 0) {
            y = 0;
        }
        else {
            y = (x > 0) ? 1 : -1;
        }
        return y;
    }

    There are many other code snippets on GitHub repo Currently, Bosque is focused on the core language designed which make it limited support with compilation and development. Though yet it is built for Windows only which demand some pre-requirements such as The LTS version of node.js for Windows(x64) and Typescript (install with:  npm I typescript -g). The Microsoft new Visual Studio Code IDE will come with the pre-support for the Bosque language and give .bsq extension to the Bosque files.

    Some more details about Bosque Features

    • It supports a simple and non-opinionated type system that allows developers to use a range of structural, nominal, and combination types to best convey their intent and flexibly encode the relevant features of the problem domain.
    • It focuses more on functional programming with scopes and uses braces to hold the block of code.
    • Works on static Data type as in the examples it can be seen that use Int to declare the datatype.
    • It shows a similar structure to C++ and C language
    • It comes with immutable values which have its own advantages and disadvantages, the major advantage comes when it makes it side intervein free.
    • It supports the thread of argument in which you can pass a number of arguments at function call.
    • It comes with the Bulk Algebraic Data Operation it means that Bosque can read and updates of the data value in bulk.

    Conclusion

    Yet Bosque is in its development process there are many documents to come regarding it. The Hype is getting by this language is because of its creator’s company Microsoft. The GitHub repo has a section for Bosque Tutorial but there is nothing, it is to release yet.

    Microsoft already have many popular languages such as C#, F#, TypeScript etc. let’s see how far Bosque go in the overview of Bosque Maron has said that it is inspired by the semantic of machine learning and maybe Bosque is a part of Machine learning projects of Microsoft. For more details of Bosque, you can visit the GitHub repo.

    People are also reading:

    Leave a Comment on this Post

    0 Comments