Microsoft aims for simplicity with Bosque programming language

The new, open-source programming language is designed for writing code that is simple and obvious for both humans and machines

Microsoft has launched a new open-source project to develop the Bosque programming language. The purpose of the Bosque language project is to build a functional programming language that avoids “accidental complexity” in the development process.

Design goals for the Bosque language include improved developer productivity, better software quality, and enablement of a range of new compilers and tool experiences. The new language is positioned as an experiment in regularized design for a machine-assisted, rapid, and reliable software development lifecycle.

A key goal is elimination of accidental complexity. Bosque code is supposed to be simple and easy to comprehend for both machines and humans. But Bosque remains very much in development at this point; proponents do not recommend using Bosque for any production work. Developers are encouraged to experiment with it.

Some features and design choices made for Bosque include the following:

  • All values are immutable, with Bosque adopting a functional model with immutable data. Understanding the effect of a statement of block of code is simplified when it is side-effect free, Bosque documentation states. Functional languages have benefited from simplifications to program development, sophisticated tools, and compiler optimizations enabled by this model.
  • Functional programming is fused with block scopes and {…} braces by allowing multiple assignments to updatable variables var!.
  • Functions are first-class values and types.
  • Lambda constructors combine code definition for the lambda body with a variable copy semantics for closure captured variables on lambda creation.
  • A simple, non-opinionated type system allows for use of a range of structural, combination, and nominal types to convey intent and encode relevant features of the problem domain.
  • Typed strings provide a mechanism for lifting known structure about the contents of a string into the type in a manner that is meaningful to people and used by the type checker.
  • Parameters can be threaded through ref argument passing. An alternative to multi-return values, this simplifies scenarios where a variable is passed to a method that may use and update it. Permitting the update in the parameter eliminates the extra return value management that would be required. This feature is not yet implemented.
  • Named arguments are provided, as are rest and spread operators. These can perform data manipulation as part of invocations and constructor operations.
  • First-class support is offered for expressing a range of invariants, sanity checks, and diagnostic assertions.
  • Bulk algebraic data operations in Bosque begin with bulk reads and updates to data values. Operators produced help focus code on overall intent and let developers perform algebraic reasoning on data structure operations. Algebraic operations are provided for data types, tuples, records, and nominal types, as well as for operations including projection, multi-update, and merge.
  • With an iterative processing capability, structured loops are traded for high-level iterative processing constructs. Removing the boilerplate of writing the same loops eliminates classes of errors including bound computations; intent is made intent clear.

Bosque becomes the latest language project at Microsoft, which has produced languages including C#, an object-oriented language; F#, a functional language; and TypeScript, a typed superset of JavaScript. The software giant has had a good degree of success in developing languages that gain popularity. C#, for example, ranked fifth and TypeScript 12th in the most recent RedMonk language rankings, which are based on discussions in Stack Overflow and code usage in GitHub. 

You can find Bosque documentation, examples, and a reference implementation on GitHub. Tutorials are in the works. 

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

More about GitHubMicrosoft

Show Comments
[]