
Bosque Programming Language - bsg75
https://github.com/microsoft/BosqueLanguage/blob/master/README.md
======
rossng
The language doesn't seem like the interesting part here. Bosque appears
mainly to be a vehicle for exploring a different way of thinking about
compiler IR. From the MSR site[1]:

> In the Bosque project we ask the question of what happens if the IR is
> designed explicitly to support the rich needs of automated code reasoning,
> IDE tooling, etc. With this novel IR first perspective we are exploring a
> new way to think about and build a language intermediate representation and
> tools that utilize it. Our initial experiments show that this empowers a
> range of next-generation experiences including symbolic-testing, enhanced
> fuzzing, soft-realtime compilation with stable GC support, API auto-
> marshaling, and more!

[1] [https://www.microsoft.com/en-us/research/project/bosque-
prog...](https://www.microsoft.com/en-us/research/project/bosque-programming-
language/)

~~~
dunk010
I know that Microsoft are all about grabbing as much developer mindshare as
possible these days, but does nobody remember Steve Yegge and is Grok system
at Google? It's basically this, just ten years ago. Having the IR not throw
away anything so that the tooling can have a richer interaction. I guess the
best way to be successful is to bury your sources.

~~~
goto11
The Roslyn C# compiler also doesn't throw anything away - you can recreate the
source from the AST, completely with white-space and comments. This is
necessary to support safe refactorings, so I don't think this is a novel idea.
IntelliJ must have supported something like this for ages.

Bosque sounds like something beyond Roslyn, but it is not clear to me what.

------
devinj
The snark and meanness in this HN thread is totally uncalled for and why
people don't publish code. I can't believe this thread is on the front page
together with
[https://news.ycombinator.com/item?id=23157783](https://news.ycombinator.com/item?id=23157783)
. Go read that, especially the ending comments on open source.

> I made this thing that I thought was cool and I gave it away, and what I got
> back were occasionally friendly people who nicely requested things from me,
> but more often angry users who demanded things of me, and rarely anyone
> saying thanks.

~~~
zenexer
The issue here is the link; it doesn't do a great job of explaining _why_
Bosque is breakthrough. A bold claim like that needs evidence.

What's special here? From glancing at the code snippets--which is really all
we have in the way of evidence on that page--I see an interesting language
concept, but it's not entirely here how that relates to the initial claim.

There are definitely some interesting elements, though. It looks like it
borrows a lot from TypeScript and C#, then attempts to make the resulting
syntax a bit stricter with various forms of contracts. I think the goal is to
make stronger guarantees at compile-time and promote better design practices.
That, in turn, can result in faster applications because the compiler can make
more assumptions.

If that is the goal, it needs to be explained more clearly in the readme
before receiving widespread publicity, and there needs to be text explaining
how each feature achieves that goal. A big part of developing a new
programming languages is selling it: you have to convince a lot of opinionated
people that it's worth their time and energy to invest in learning your
technology.

Ideally, these arguments would be written during the design process before
implementation even begins, so I don't think it's unreasonable to expect that
they be available in the readme.

This might be a better link for the HN post: [https://www.microsoft.com/en-
us/research/project/bosque-prog...](https://www.microsoft.com/en-
us/research/project/bosque-programming-language/)

~~~
exdsq
Stronger assumptions at compile time allows for higher quality code,
invariants are amazing.

~~~
Barrin92
>Stronger assumptions at compile time allows for higher quality code

this depends very heavily on your definition of higher quality code. I really
hate this new trend in language discussions of declaring subjective benefits
to be objective.

Stronger compile-time assumptions, by definition, reduce the scope of runtime
dynamism, which, for many people is an important feature of say dynamic
languages.

Stronger assumptions at compile time are part of a trend of attempting to
verify programs formally ahead of time, which is not the only way to produce
robust software, but seems to be increasingly treated as such.

~~~
exdsq
What can you do with runtime dynamism that I can’t do with a language using a
strong type system with dependant types? You need to know _something_ about
the dynamic data else you can’t do anything with it and that starts to suggest
there’s a structure you can declare, right?

And what methods do you think are as capable as formal verification? What I
mean by that includes formal specification, property based testing, theorem
provers etc.

Edit: This reads argumentative but that’s not what I wanted, I’m genuinely
interested.

------
stared
> is a _breakthrough_ research project

[citation needed]

In all seriousness, each time when I see a project self-describing itself as a
breakthrough, it is a red flag. No matter if it is programming, mathematics,
arts, or anything. (Of course, unless used ironically.)

Either, it is a huge ego and a total lack of self-skepticism (vide Stephen
Wolfram's recent Theory of Everything) or fiddling of the marketing
department.

~~~
norswap
Cool. Could you maybe just read ahead and evaluate the claim for yourself and
then post a comment about that if you end up agreeing/disagreeing with it?

~~~
ken
I read through the whole readme. I can’t figure out which part of this they
think is the “breakthrough”.

------
nonsince
At this point any new systems language aiming at productivity has to prove
itself not just superior to C++, but superior to Rust, without being
significantly worse in any aspect. It’s already suspicious by virtue of having
a hand-wavy "Int" type (what size/signedness is that?) and it appears to be
object-oriented (so we have to rely on compiler optimisations to remove
dynamic dispatch) and garbage-collected (so by default any non-trivial type is
heap-allocated). These are just ways in which it is worse than Rust as far as
performance goes, since "ergonomics"/"productivity" is so subjective. It seems
to improve on C++ only by taking the most common C++ patterns and building
them into the language so the language doesn’t have to be so immensely
complicated, while also improving the syntax. That’s simply not enough for a
modern language to be competitive.

~~~
curryhoward
> It’s already suspicious by virtue of having a hand-wavy "Int" type (what
> size/signedness is that?) and it appears to be object-oriented (so we have
> to rely on compiler optimisations to remove dynamic dispatch) and garbage-
> collected (so by default any non-trivial type is heap-allocated). These are
> just ways in which it is worse than Rust as far as performance goes, since
> "ergonomics"/"productivity" is so subjective.

While I agree that this language doesn't seem to be differentiated enough to
compete, I disagree with your apparent premise that new languages need to be
as fast as Rust. I personally would welcome a new language that gives me full-
spectrum dependent types with great tooling and moderate performance. There
are many aspects to programming languages beyond raw speed.

The world has enough cookie cutter procedural and OOP languages. I'd love to
see a new language from a different paradigm succeed.

~~~
jleahy
For ‘moderate performance’ surely JVM based languages are what you’re looking
for? There’s great tooling and a very low barrier to creating new languages.

Creating a new systems programming language like C++, Rust or Zig is by
contrast a lot more effort and means having significantly worse support for
debugging and IDEs unless you put a lot of effort in (generating good DWARF
debug data for a new language is hugely complex).

~~~
curryhoward
> For ‘moderate performance’ surely JVM based languages are what you’re
> looking for? There’s great tooling and a very low barrier to creating new
> languages.

Not sure I understand what you're suggesting. I was asking for a language with
dependent types (or anything that isn't just another procedural/OOP language).
Such a language could use any runtime, whether it be the JVM or anything else.

~~~
throwaway17_17
I’m working on a language that will hopefully meet both of your criteria, so
at least you can take encouragement that you are not alone.

I’m working on a language based around the recent work of Pfenning, Reed, and
Pruiksma (Adjoint Logic) and Krishnaswami’s Dependent/Linear research (both of
which go back to Nick Benton’s ‘94 work). It is definitely not OOP, it is a
compositional language (a lot like the concatenative language family) and is
rooted in explicit parallel and sequential composition. With one of the
adjoint logics being the type theory implementation of Intuitionistic Logic
(Martin-Lof Dependent Type Theory).

There are people working on things all over the non-OOP and the advanced
static types spectrums, don’t loss faith in progress yet. I have plans to
release the 0.1 website and ‘compiler’ before July 1. Of course it is going to
be a bumpy road, but I’m having a great time working this project.

------
mrkmarron
Hi, project owner here, great to see this on HN and always happy to hear from
folks here and on the GitHub repo.

We also have a webinar with Q&A scheduled for Thursday morning
([https://note.microsoft.com/MSR-Webinar-Programming-
Languages...](https://note.microsoft.com/MSR-Webinar-Programming-Languages-
Bosque-Registration-Live.html)) which may be of interest as well.

~~~
sachinjoseph
The use use of '=' here scares me:

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

The language already supports '=' operator for assignment of variables in the
current scope, so should you use the same operator for denoting value
assignment formal parameters in a function call? This can lead to a lot of
confusion between variables in the scope and formal parameter names in a
function that is called from the current scope.

~~~
tomp
Python, one of the most popular languages, uses this syntax, so I'm guessing
the vast majority of people don't find it scary (I certainly don't).

------
throwaway_pdp09
Yeah, but what is it?

> The Bosque programming language is a breakthrough research project from
> Microsoft Research.

Tells me nothing useful about it.

> Bosque simultaneously supports a high productivity development experience
> expected by modern cloud developers, coming from say a TypeScript/Node
> stack,

It's a web language then?

> while also providing a resource efficient and predictable runtime with a
> performance profile similar to a native C++ application

Or a back-end dev language?

Come on, _what is it for?_

~~~
norswap
Does a language really have to aim for a specific use case?

~~~
thrower123
It would be good for its own sake to provide some motivation for why you'd
bother using it over the dozen established alternatives with mature ecosystems
and tooling.

~~~
TomMarius
It's a language research project.

> In the Bosque project we ask the question of what happens if the IR is
> designed explicitly to support the rich needs of automated code reasoning,
> IDE tooling, etc. With this novel IR first perspective we are exploring a
> new way to think about and build a language intermediate representation and
> tools that utilize it. Our initial experiments show that this empowers a
> range of next-generation experiences including symbolic-testing, enhanced
> fuzzing, soft-realtime compilation with stable GC support, API auto-
> marshaling, and more!

~~~
throwaway_pdp09
Then tell us this. In fact stick it somewhere obvious.

Also please talk straight, please don't mention "next-generation experiences",
that's just marketing nothingspeak to HN techies.

"enhanced fuzzing" \- as opposed to what?

"soft-realtime compilation" \- meaning...?

"stable GC support" \- oh thank god for that, finally GC is reliable and can
be used in production. thankyou thankyou thankyou for banishing GC
instability.

~~~
steveklabnik
> Then tell us this. In fact stick it somewhere obvious.

The first sentence of this page:

> The Bosque programming language is a breakthrough research project from
> Microsoft Research.

"Microsoft Research" is in italics, even.

~~~
throwaway_pdp09
And I quoted exactly that line. In my first post.

~~~
TomMarius
Why are you asking unrelated questions then? The goal is not to motivate you
to use it, especially not you who seem to be uninterested in both the goals
and the ways the team has proposed. On the other hand I like the direction -
but I am not going to use it on a daily basis either, maybe in a few years.

~~~
throwaway_pdp09
The base question was, _what is it for?_ That is the ultimate purpose of this
language. That's not an 'unrelated' question.

> The goal is not to motivate you to use it, especially not you who seem to be
> uninterested in both the goals and the ways the team has proposed

I knew neither the goals or nor the ways of this team. Tell me and as a guy
interested in languages, I will be interested.

> I like the direction

So what is the direction?

All I'm asking for is information on this project, clearly given and not
wrapped up in idiot marketing drivel ("stable GC support" FFS)

------
wizeman
> As a result of these design choices there is always a single unique and
> canonical result for any Bosque program. This means that developers will
> never see intermittent production failures or flaky unit-tests!

So Bosque programs are not allowed to receive input from the outside world?

> When an error occurs in deployed mode the runtime simply aborts, resets, and
> re-runs the execution in debug mode to compute the precise error!

Again, no interaction with the outside world? Or are all inputs recorded
during the entire execution?

It doesn't seem like this could work as specified in many real-world
scenarios...

EDIT:

> This compiles recursive functions into a CPS form that uses constant stack
> space, eliminating any possible Out-of-Stack issues

So recursion cannot depend on input from the outside world?

Either 1. I'm missing something, 2. Bosque programs indeed cannot receive
input from the outside world, or 3. these claims seem a bit exaggerated...

~~~
timon999
The Bosque paper says the following:

> JavaScript took an interesting step by decoupling the core compute language
> in the JS specification from the IO and event loop which are provided by the
> host [...]. We take the same approach of decoupling the core compute
> language, BOSQUE, from the host runtime which is responsible for managing
> environmental interaction.

So it seems that Bosque doesn't do IO directly, but instead specifies how a
given input is mapped to some output.

~~~
wizeman
From what you're quoting and from what you're saying, it seems that Bosque
(the core compute language) can indeed receive input from the outside world,
even though it comes from the runtime (which Bosque considers the outside
world).

Which means that some of the claims I quoted don't seem entirely accurate, and
the other one only seems possible if the input (and possibly some state) is
recorded...

------
keyle
I like it already. But the page has a mix of statements ending with ';' and
not. Which is it? Pick one and stick to it ;), it triggers my ocd more than
naming interfaces 'concepts' and classes 'entity' for what seems like the heck
of it. It does look swiftish and ceesharpy. But hey, if I can get something
that looks like that, compile down to a small binary as fast as C++, I'll call
your interface 'concepts' all day.

~~~
throwaway_pdp09
I agree about the arbitrary renaming just to make the language syntactically a
bit distinct from other languages, while messing around the user. It really is
not a big issue but the fact they chose to make it an issue at all by picking
a new name for an existing concept is worrying.

------
mpoteat
This is pretty cool. This project has a long way to go before it's mature, but
as someone who uses Typescript every day professionally, the promise of the
ease and safety of Typescript coupled with the speed of C++ is really
compelling.

~~~
pjmlp
You can already play with something like that, Static TypeScript, used on
MakeCode for targeting embedded devices.

[https://www.microsoft.com/en-
us/research/publication/static-...](https://www.microsoft.com/en-
us/research/publication/static-typescript/)

Microsoft MakeCode: from C++ to TypeScript and Blockly (and Back)

[https://www.youtube.com/watch?v=tGhhV2kfJ-w](https://www.youtube.com/watch?v=tGhhV2kfJ-w)

[https://www.microsoft.com/en-us/makecode](https://www.microsoft.com/en-
us/makecode)

~~~
52-6F-62
This is cool, thanks for sharing. I'm rather in the same boat as OP.

------
still_grokking
Looks like Stainless Scala, mixed with Rust, and given a C++ syntax.

This mix looks interesting as such.

But of course Wadler's law applies: Why THIS syntax? Looks like a blast-from-
the-past, bloatty and complex. Modern languages go mostly for some more
lightweight look-and-feel. Usually more "pythonic". This would be imo also
here the better idea.

~~~
HelloNurse
A lot of punctuation, most of it painful:

    
    
      * arrow and double arrow
      * arrow and double colon
      * apparently random semicolons
    

Not all syntax choices are bad (for example, consistently declaring types
after things with a colon as a separator), but certainly not coherent and
elegant enough to compete with Python, C/C++/Java, Lisp, etc.

------
francasso
This is another PL I won't try (not that the authors should care).

I'm still waiting for a good "system programming language" that

\- has compile time execution that can call a compiler API to allow compile
time code generation

\- full compile time reflection, optional runtime reflection

\- doesn't have any kind shape or form of automatic memory management

\- has decent discriminated unions

\- is not much more opinionated than C on how I should live my life

\- operator overloading: define at least common operators (+, *, -, etc...)
for user types. Sometimes I like the idea to be able to define infix/postfix
functions in general while also assigning a priority and an associativity
(totally possible with a hand made parser), but I think that could easily lead
to a mess if miss-used by the community.

Zig is spot on for some of those. JB's Jai on others. For the rest it looks
like there aren't many people that are bothered by the things I'm bothered
with.

~~~
diegoperini
Take a look at Jai. It's not released yet and doesn't cover all your bullet
points but it promises speed and getting out of your way, especially if you
are a game programmer who loves build pipelines and data oriented design.

[https://inductive.no/jai/](https://inductive.no/jai/)

------
xixixao
I gotta say you lost me at args->allof

It’s 2020, if you’re really serious about building a new language, shouldn’t
you at least pick a reasonable naming case convention? (allOf, AllOf, all_of,
all-of would all work)

(Not talking about the fact that allOf doesn’t seem very consistent with other
languages...)

~~~
TylerE
all-of should not work unless your syntax for basic arithmetic is something
heinous.

~~~
munro
Or you're Lisp

~~~
cygx
Or The Language Formerly Known as Perl6 [1], where it won't cause much
friction as variable names ordinarily start with a sigil.

[1]
[https://docs.raku.org/syntax/identifiers#Ordinary_identifier...](https://docs.raku.org/syntax/identifiers#Ordinary_identifiers)

------
chunsj
At first site, it seems like a Swift clone. However, there surely be some
reasons that I cannot catch.

~~~
tomp
preconditions, looks like they try to "prove" them by using Z3 theorem checker

------
nnoitra
This is laughable - pretty much a buzzword soup.

Whenever I see "this language/tool does A and B well", it turns out it can
neither do A nor B well enough.

>The Bosque programming language is a breakthrough research project from
Microsoft Research.

Breakthrough according to who?

------
tluyben2
How does the verification work? I see the Z3 prover in there; is there more
detail on how that works with this language?

~~~
mrkmarron
The design of the language is done in a manner that allows us to translate the
code (and all conditions) into very friendly SMTLib code -- that we don't need
to add a lot of additional checks like frame rules or havocs and where the set
of theories (and their combinations) are well behaved.

We have some info on this in the research papers section and documents but are
planning on a full paper focused on how this is done (particularly in the
presence of union types, dynamic records/tuples, etc.)

------
realharo
Is the type system at least as rich (or richer) than TypeScript's?

Can I do stuff like `Partial<T>`, `Omit<T, K>` intersection types, etc? Is
structural typing the "default"?

------
dleslie
I don't believe one can claim to have created a systems language if it doesn't
have trivial or seamless integration with the system's C ABI.

~~~
dleslie
Ha, downvoted.

Show me a successful "systems language" without such C ABI compatibility.

------
IshKebab
The first feature says all values are immutable, but then the very next one
mutates a variable. What?

------
bloaf
I wonder if the bones of this language came out of the work Microsoft put into
Sing# 15 years ago.

------
unnouinceput
_cross eyes to the syntax...._ confused:

-is this a crossover between C and Pascal?

------
gigatexal
Hyperbole aside perhaps we should tinker with the language first thereby
walking a mile in the creator’s shores before passing judgment that its a
terrible language.

------
k0t0n0
I don't wanna type function to define a function.

------
anthk
Why did you name your language on "woods"?

~~~
nwatson
In English "bosque" is a specific type of forest/woods ...
[https://en.m.wikipedia.org/wiki/Bosque](https://en.m.wikipedia.org/wiki/Bosque),
could be named for that too. (Bosque is a generic "woods" in
Spanish/Portuguese.)

------
mcdermott
I stopped reading at "from Microsoft Research."...

------
Areading314
Why would someone use this over Kotlin? Seems like Jetbrains has a big head
start over this project without much difference in stated objectives

------
cryptonector

      typedef Letter = /^\w$/;
      typedef Digit = /^\d$/;
    

Shades of Perl5. Paging jwz!

