back to article Microsoft debuts Bosque – a new programming language with no loops, inspired by TypeScript

Microsoft Research has introduced a new open source programming language called Bosque that aspires to be simple and easy to understand by embracing algebraic operations and shunning techniques that create complexity. Bosque was inspired by the syntax and types of TypeScript and the semantics of ML and Node/JavaScript. It's …

Page:

  1. Joe W Silver badge
    Gimp

    Bocce?

    You mean like the evaporators used in moisture farming?

    1. GruntyMcPugh Silver badge

      Re: Bocce?

      Sounds like it,.. I don't think I can be bothered to learn Bosque,. .. I must have a bad motivator.

  2. Baldrickk Silver badge

    so it's...

    just another functional language? Is it really that special?

    1. hammarbtyp

      Re: so it's...

      Worse that that. Its a JAFPL (Just another .... programming laguage)

      However nice the syntax is, unless it can prove to have a specific application which it can do better than the present incumbent, it will just be one of those academic exercises with no real world usage

    2. Charlie Clark Silver badge

      Re: so it's...

      Erlang and Haskell want their headlines back! And doesn't MS already have a functional language with F?

      1. richardcox13

        Re: so it's...

        > And doesn't MS already have a functional language with F?

        F#.

        And it is a hybrid functional language (so does support mutable state) and also built on ML, This sounds much more hard core...

        Of course saying "no mutable state" missed the point of the real world being mutable – the cupcake I just ate has changed and I can't eat it again. But, for much data processing working on a basis of transforming data into a new state only actually needs to mutate (the persisted) data at the final step and thus is far easier to scale out processing.

        1. Anonymous Coward
          Anonymous Coward

          Re: so it's...

          You're not keeping up with the times, are you? Introducing this immutable concept called Bosquit, ehh, Brexit: You can eat your cupcake and have it. Schrödinger's cat haunting Bosquy forest.

        2. tejon

          Re: so it's...

          "No mutable state" doesn't necessarily miss that point. In the Haskell paradigm, eating your cupcake simply created a new universe containing no cupcake. Don't worry about the old universe, the garbage collector takes care of that.

          (I'm not even joking, the IO monad's definition involves a value of type RealWorld.)

          1. Handle123456

            Re: so it's...

            The Clean language even has an explicit World type and interactive programs are functions of type World -> World. The world is unique though, the compiler will not let you fork the world in two. :-)

            https://cloogle.org/doc/#CleanRep.2.2_6.htm;jump=_Toc311798037

      2. jelabarre59 Silver badge

        Re: so it's...

        Erlang and Haskell want their headlines back! And doesn't MS already have a functional language with F?

        No, Microsoft only has DISfunctional languages.

      3. Bill Stewart

        Re: so it's...

        This is solving the problem of Haskell being too abstract and readable.

    3. Warm Braw Silver badge

      Re: so it's...

      It seems to have some similarities in concept to APL.

      The big drawback with APL is you need a special keyboard (or stickers) and golfball (for your IBM 2741). Now that we're not constrained by character sets and have touch screens, I'd have thought it could make a comeback - it certainly looks more elegant than the C-derived syntax of Bosque.

      1. AMBxx Silver badge

        Re: so it's...

        Could it be the SmallTalk of the functional world? Pure approach, useful for teaching, but limited in the real world?

      2. Anonymous Coward
        Anonymous Coward

        Re: so it's...

        Agree. The current versions of APL (e. g., Dyalog) have somewhat lost their way in trying to be everything to everyone, but your observation is generally correct.

        1. Tom 7 Silver badge

          Re: so it's...

          I used to love APL - the only language where I wrote the comments first and still didnt have a clue what the code did 10 minutes after I wrote it. But you could write some really really small programs that did amazing things.

      3. Anonymous Coward
        Anonymous Coward

        Re: so it's...

        J is APL without the special keyboard.

    4. druck Silver badge

      Re: so it's...

      ...just something else to confuse comp sci students with, instead of teaching them something that might actually be useful in their future careers.

      1. JDX Gold badge

        Re: so it's...

        You're confusing a computer science degree with a computer programming vocational course.

        1. Kabukiwookie Silver badge

          Re: so it's...

          No, unfortunately this is what most CS degrees have morphed into.

          What do you think drives Java uptake and the Devops way of working?

    5. ratfox Silver badge

      But is it really functional?

      I also immediately assumed that avoiding for loops meant it was functional, but the description page does not mention the F-word, which is a rather odd omission.

      ...Can you use it to code a shrubbery?

      1. SNAFUology

        avoiding For loops....... & AI

        any programming language I used from a Microsoft interface had problems indicating errors - always saying it was a 'For Next' error instead of something else - perhaps better error checking.

        But then If AI were writing code it may be reasonable to have no loops present as it could facilitate faster writing, reading and analysis / errorchecking

  3. Peter Prof Fox

    Wrong end of the telescope

    So no object instances then. Sorry, but trying to simplify validation, a task that can be automated, forgets that we've got machines to do that. The difficult bit of coding needs to allow for complexity as the world we're working in is complex. There are of course so many things that can go wrong, which is why structured programming helps turn a soup of code into modules with, err, structure to contain our many egregious errors.

    I'm just off to rebuild Notre Dame, using only Lego 'cos that system means I can't heap bricks up randomly and I'm sure having to work around the limitations of Lego will be a pain worth having. Or not.

    1. STOP_FORTH Silver badge
      Happy

      Re: Wrong end of the telescope

      Playmobil, please. Otherwise a very good analogy. I do like it when Internet analogies don't involve cars.

      1. TRT Silver badge

        Re: Wrong end of the telescope

        I quite like the coding analogy to the Cathedral model, and trying to build it using Bricks. I wonder if that was a reference to Brick Lane, it being somewhat of a bazaar?

      2. Tom 7 Silver badge

        Re: Wrong end of the telescope

        I'm just disappointed internet analogies done involve flying cars yet.

    2. Crypto Monad

      Re: Wrong end of the telescope

      > trying to simplify validation, a task that can be automated

      Can it? In the general case, you can't even prove whether a program halts or not.

      1. Anonymous Coward
        Anonymous Coward

        Re: Wrong end of the telescope

        And Bosque addresses this problem how?

        1. TRT Silver badge

          Re: Wrong end of the telescope

          With a massive blaster. I wonder if the pre-cursor to the language was Cradossk?

      2. sitta_europea

        Re: Wrong end of the telescope

        "... In the general case, you can't even prove whether a program halts or not."

        I wondered if someone was going to get all historical on us.

        Well done, sir.

    3. Charles 9 Silver badge

      Re: Wrong end of the telescope

      "There are of course so many things that can go wrong, which is why structured programming helps turn a soup of code into modules with, err, structure to contain our many egregious errors."

      But what happens when the structure itself introduces things like gestfaults where each model claims to be clean but once they're strung together everything goes wrong for mysterious reasons?

      1. Mr Benny

        Re: Wrong end of the telescope

        What the hell is a gestfault?

        Anyway, if things go wrong when modules are plugged together then thats a fault of the design, not the language. Functional languages don't magically make program design any simpler, in fact if anything the opposite is true for anything other than small mathematical problems. Functional doesn't get rid of loops, it just turns them into recursion which simply confuses the design for systems that are not by nature recursive and if a language doesn't naturally map onto the problem space its trying to solve then its not a good solution to the problem.

        1. Anonymous Coward
          Anonymous Coward

          Re: Wrong end of the telescope

          "What the hell is a gestfault?"

          I am assuming that it is a collision between Gestalt and Fault !!!???

          therefore

          "A fault or 'set' of faults that are greater than the individual smaller faults that have combined when all the modules of code etc are 'working' together."

          1. Charles 9 Silver badge

            Re: Wrong end of the telescope

            That's exactly it and one reason unit testing can never find ALL the faults. The individual units themselves may test all clean, but once you put them all together the interactivity between them produces faults that would never be seen in any individual unit. A fault that's greater than the sum of its units; thus a gestalt fault or "gestfault".

  4. bombastic bob Silver badge
    Meh

    the worst of all worlds...

    "Presently, Bosque relies on an interpreter written in TypeScript, run on Node.js"

    Doesn't that pretty much say it all? (I hear a loud 'Eeewwww')

    How long before Micro-shaft starts CRAMMING it at us like:

    a) Windows 10 and "the Store"

    b) ".Net"

    c) C-pound

    d) Silverlight

    e) 'the Metro' and UWP (in general)

    f) A DevStudio that requires EXCESSIVE mousie-clickie in a "property sheet" instead of the old-style tabbed dialog boxen (with easiy discovered hot keys) that you used to see in the dialog editor and class wizard of earlier VC++ IDEs...

    etc.

    And how is this better than Python for doing that sort of thing?

    And what's wrong with a loop?

    and don't EVEN get me started about un-typed data storage and garbage collection... which from what I can tell, seem to be unspoken 'features'.

    1. Anonymous Coward
      Anonymous Coward

      Re: the worst of all worlds...

      I've been practising my identification of logical fallacies

      And I think that's strawmanning

      1. Updraft102

        Re: the worst of all worlds...

        Slippery slope. I don't see where Bob is misrepresenting what this thing is so that he can tear it down.

    2. Headley_Grange Silver badge

      What's Wrong With a Loop?

      When I was a student I was in an industrial placement and tasked with writing a programme to control some kit on an IEEE bus and print the output on the brand new and magical HP Plotter (more watchable than Game of Thrones). The language was the lovely HP Basic (no sarcasm there) and I set off and wrote the programme. It worked OK - then the rest of the lab spent their lunch hours ripping it to shreds for being "unstructured". I took this pretty seriously, so spent some time getting rid of all the Gotos and "bad" loops, etc. until it met their view of what a properly structured programme should look like. It still worked in the end, but I don't think it was much better. My analogy for the GoTo is it's a bit like Jaunting: you can either spend ages driving round the one-way system but if you could Jaunt like the Tomorrow People then surely you would.

      1. Paul Crawford Silver badge

        Re: What's Wrong With a Loop?

        The problem with "goto" is not its effectiveness - hell that is exactly how flow control happens in the generated assembler/object code - but in another human reading it and upon seeing a jump destination being able to work out how many ways one gets there.

        For some very small functions with a local jump (please, PLEASE, don't bring up setjump/longjump here!) it might be fine as a simple way, for example, to break out of nested loops. But on a larger scale the program's intentions become unintelligible.

        Mind you, there are other constructs that are also a bit dodgy, for C you can return out of a function at any point, not always clear logic there. But $DEITY forbid you find yourself working on old FORTRAN where you can have multiple entry points to a subroutine!

        1. Charlie Clark Silver badge

          Re: What's Wrong With a Loop?

          But on a larger scale the program's intentions become unintelligible.

          Right, but in the example mentioned it seemed a reasonable choice to get that job done as opposed as to trying to crowbar a different approach into the language.

          1. Anonymous Coward
            Anonymous Coward

            Re: What's Wrong With a Loop?

            Is it? OR perhaps there's a simpler solution you overlooked? Was there reason to believe the complexity you had to negotiate was a necessary complexity?

          2. doublelayer Silver badge

            Re: What's Wrong With a Loop?

            It was also possible that their thought process went like "If they think this is good style, they might use a bunch of gotos in the next project, which could be much larger". Depending on whether you were going to be there for a while, they either thought "They will really hate it once this catches up to them and they have to recode something big in the future" or the more pragmatic "We will really hate it if we see this on something bigger". They could then decide that you could get experience writing in a clearer style with this relatively small project to get you used to a better way.

        2. sw guy
          Pirate

          Re: What's Wrong With a Loop?

          I did not remember the multiple entry in a subroutine, by I remember there was a feature allowing multiple return points *outside* subroutine:

          - Define a parameter as a label using ad'hoc syntax

          - Use a variant of return to say combine return + goto Nth label within parameter list

          1. jeffdyer

            Re: What's Wrong With a Loop?

            I don't remember multiple entry points either, but I stopped programming in FORTRAN in 1990 I guess.

            1. Anonymous Coward
              Anonymous Coward

              Re: What's Wrong With a Loop?

              I still remember writing a Hadamard transform subroutine in the late-'70s/early-'80s that had two entry points. The code that performed the transform was the same for the forward and inverse transforms. Only the scale factor you applied at the end was different--all the extra entry point did was calculate the correct scale factor. Seemed better than dealing with two pieces of code that differed in only a single line.

        3. Headley_Grange Silver badge

          Re: What's Wrong With a Loop?

          @Paul - I agree with you that reviewing/editing/fixing "unstructured" code is a pain, especially in the old days when there were no tools, just the tiny screen of a 9826. However, the main benefit that came out of the re-work I was heckled into doing was that I was able to pull out a general purpose subroutine for driving the plotter which could be used by others in the lab - whether directly from test gear or by putting user-generated data into a defined format. It became an ongoing lunchtime project with user change requests regularly submitted for things like auto-scaling, colour options, annotation, etc. and I think that the plotter sub became larger than the control software which spawned it. I took it back to poly. when the placement finished and it was still in use a couple of years later when I left.

          1. Andrew Commons

            Re: What's Wrong With a Loop?

            @Headley_Grange

            HP Calculators and plotters...memories. The desktop calculaters in the early 1970s were programmable. The programs occupied register space starting with the high registers and coming down. The program could reference those registers which led to the interesting, and immediately grasped, option of modifying itself. Take the square root of R15 and see what happens next. Now hook a plotter up.... What we learnt from that was that those early plotters were tough. :)

            1. Headley_Grange Silver badge

              Re: What's Wrong With a Loop?

              @Andrew: I think I've posted this before - but I grew up with HP test gear and computers. They were indestructible and the best. My HP11C calculator was probably the first "very expensive and hard to justify" thing I bought and it still works. It doesn't get much use now, although the iPhone app which emulates it does.

              When I bought my first laptop I saw an HP model and just bought it cos it was obviously going to be the best thing in the whole shop. What a fool. What a disappointment. What a lesson. Whatever happened to HP?

              Those plotters though.

              1. Fatman
                WTF?

                Re: Whatever happened to HP?

                Let's try this:

                Mark

                Carly

                Leo

                Any more???

                1. Headley_Grange Silver badge

                  Re: Whatever happened to HP?

                  Fair point. Both H and P were still on the board during the times of my original post. And it looks like Carly was in charge when I bought the HP laptop. She owes me £600.

Page:

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2020