Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Microsoft Programming

With New User-Defined Functions, Microsoft Excel is Now Turing Complete (visualstudiomagazine.com) 109

Visual Studio Magazine reports: Microsoft, which calls its Excel spreadsheet a programming language, reports that an effort called LAMBDA to make it even more of a programming language is paying off, recently being deemed Turing complete. Being Turing complete is the litmus test of a full-fledged programming language, marking the ability to imitate a Turing machine. According to one definition, that means, "A programming language is Turing complete if you can implement any possible algorithm with it."

And that's exactly what LAMBDA can now do. "You can now, in principle, write any computation in the Excel formula language," said Microsoft researchers in a Jan. 25 blog post.

To get there, researchers at the Calc Intelligence project addressed two shortcomings to the LAMBDA project, which is conducted in coordination with the Excel team and which was first announced early last month. They are:

- The Excel formula language supported only scalar values like numbers, strings and Booleans

- It didn't let users define new functions....

"Moreover, even if it takes greater skill and knowledge to author a lambda, it takes no extra skill to call it," researchers said. "LAMBDA allows skilled authors to extend Excel with application-domain-specific functions that appear seamlessly part of Excel to their colleagues, who simply call them.

"It will be interesting to see how users continue to experiment with and apply not only LAMBDA but also data types and dynamic arrays. We believe these new functional programming features will transform how people make decisions with Excel."

And there is certainly a large audience of both programmers and coders, as Microsoft claims "Excel formulas are written by an order of magnitude more users than all the C, C++, C#, Java, and Python programmers in the world combined."

Towards the end the article points out that right now to actually use the new feature, "you have to be a member of the Insiders: Beta program."
This discussion has been archived. No new comments can be posted.

With New User-Defined Functions, Microsoft Excel is Now Turing Complete

Comments Filter:
  • by Qbertino ( 265505 ) <moiraNO@SPAMmodparlor.com> on Saturday January 30, 2021 @09:58PM (#61010892)

    As a developer I certainly make fun of my PO and PMs even doing their laundry in excel, but I am also quite amazed at what people build with it. Entire medium sized corporations have self - made excel based ERP systems going, with email /outlook being something of a manually run enterprise message bus going with it.

    I somewhat get that if handled well this can be a very viable way of doing things. And it also can be quite fault tolerant. You can pass a new piece of software built in an excel sheet around via an internal email list (quite safe) and even the front desk can run it with their basic office training. It forces departments to communicate and programming in excel is a premium training in functional programming for regular non - devs.

    AFAICT excel has been Turing complete for decades now, at least when combined with VBA. But what do I know?... I'll continue to make quibs about it and stick to the only thing that's even more platform independant: textfiles, SED, awk and scripting. :-).

    • by The Evil Atheist ( 2484676 ) on Saturday January 30, 2021 @10:37PM (#61010972)

      And it also can be quite fault tolerant.

      If you count "slow as fuck" as not a fault, or running out of columns for your makeshift COVID-19 tracking database, not a fault :)

      • Then there was the time it automagically turned gene labels into calendar dates ruining something like a quarter of the dataset used for some very high profile Nature or Cell papers.

      • by CaptQuark ( 2706165 ) on Sunday January 31, 2021 @01:49AM (#61011350)

        or running out of columns for your makeshift COVID-19 tracking database, not a fault :)

        The reason it ran out of rows in because some genius saved the file in the older Excel 97-2003 .XLS format which had a row limit. Guess what? Saving the spreadsheet as a .CSV file will loose all the formulas too.

        Fault tolerant does not mean idiot proof.

        ---

        • Fault tolerant does not mean idiot proof.

          Except it should. It should have warned about the limitation of the format.

          One could argue Excel shouldn't be marketed as a general purpose programming tool for all situations, but of course, part of the blame goes to "IT courses" that teach it that way.

        • Fault tolerant does not mean idiot proof.

          As I always say, you can only make a system idiot-proof for a given subset of idiots.

        • Excel 2019 still has a row limit. 1048576 is bigger than 65536, but when you have 3,796,088 positive cases, and 68,606,924 total tests conducted, it still isn't suitable for excel.

          • Super hidden excel function

            Excel has the ability to add another sheet to the workbook
            - 2^20 rows (times) 2^14 columns
            - 2^15 characters per cell

            But: "Sheets in a workbook: Limited by available memory"

            Also true for Excel as real world implementation -> know your specs/limits (signed vs. unsigned int .. is a long standing security issue)

            https://support.microsoft.com/... [microsoft.com]

            • So to improve this situation, my modest proposal would be that when reporting COVID data with hundreds of thousands of patients, they should use one worksheet per patient. Right?

              • by burni2 ( 1643061 )

                Your answer suggests that you are experiencing a form of digital dementia.

                Doing it in Excel efficiently is almost like in the old days with pen, paper and registers. What we did in the Old Days:

                Sort entries by the first letter of their names and separating to different folders and assign ranges of those letters and extend to the second or third letter, to address the fact that certain combinations would be present more than others.

                We were also able to create an ID and when the ID reached a certain limit we

        • And *thats* why excel will become skynet in the end.

        • The user error here was not saving it's on the wrong format. The error was using an excel spreadsheet instead of RDMS.

      • by burni2 ( 1643061 )

        Slow as fuck?

        - that is to debate and as in any platform depends hugely on the skill of the programmer, it cannot compete to the highest degree with "real" programs but then the question starts to be asked: do you need a lambo for city travel with your wife+2 x kids or does a C-Max style van do the same job - especially when a third one is arriving?

        Also have you seen real programmed applications perform worse and slower than Excel-Solutions -> I have.

        You also need to look at the implementation speed and t

    • Sed,awk, and shell scripting, you say? Youâ(TM)re gonna love this new language an uber-geek named $LarryWall &created()
      • Sed,awk, and shell scripting, you say? Youâ(TM)re gonna love this new language an uber-geek named $LarryWall &created()

        Right, it's the superset of sed,awk,bash, but perhaps only a few diehards will refuse to adopt it.

      • by robsku ( 1381635 )

        It's great all right, I use it pretty much for anything that's not doable with shell script alone (or too complicated for it).

    • by ceoyoyo ( 59147 ) on Saturday January 30, 2021 @11:40PM (#61011138)

      There was a study (I saved the paper somewhere) that looked at the excel spreadsheets a good fraction of the fortune 500 used for financial decision making. The conclusion was that the spreadsheets had so many errors that the resulting decisions were essentially random.

      Implementing complex logic in a spreadsheet is not a good idea because they're difficult to debug. They're good for entering and displaying tabular data, and some simple, easily verified calculations, but that's it.

      • If you happen to find that paper, I'd be curious to see it.
        I've noticed Excel spreadsheets, or rather formulas someone wrote in Excel, tend to have a very high ratio of bugs that were unknown to the users.

        I suppose that would tend to be true of any tool that non-programmers use for programming. The intended audience is people who aren't trained programmers, so of course they will make a lot of mistakes when they write programs. It seems, though, that Excel encourages undetected errors. It makes it easier

        • You can type whitespace and indentation into cell formula. It's just that people tend to do it in one-liner.
          • A parens balancing tool! A parens balancing tool! My kingdom for a parens balancing tool!

            Having to jam in complex formula that are gigantic, because you have to repeat chunks of code over and over rather than have a little function, yields impenetrable problems when adding such a formula and it's a whisker off to the syntax acceptor.

          • And how exactly do you format/type a multi line formula into a one line text area? Especially when hitting RETURN quits the edit mode? Just curious ... and how do you "read it for correctness" ?? Mouse hovering over the cell, to see pop it up in a formatted tool tip?

            • It's either CTRL-Enter or Shift-Enter

            • And how exactly do you format/type a multi line formula into a one line text area? Especially when hitting RETURN quits the edit mode? Just curious ... and how do you "read it for correctness" ?? Mouse hovering over the cell, to see pop it up in a formatted tool tip?

              At the very right hand end of the forumla bar is a little downward pointing chevron. When you click it, you can multiple lines in your formula area!

              • Oh,
                that is a nice hint :D
                (Lucky I do not need to use Excel)

                I wonder how many ppl know this and/or noticed this. Thanx for the info!!

        • by ceoyoyo ( 59147 )

          This is not the paper I was thinking of, but a quick Google turns up this one that seems to be more of a review:
          https://arxiv.org/pdf/1602.026... [arxiv.org]

          I just scanned the abstract, so not saying it is or isn't a great paper but:

          Research on spreadsheet errors is substantial, compelling, and unanimous. It has three simple conclusions.
          The first is that spreadsheet errors are rare on a per-cell basis, but in large programs, at least one incorrect bottom-line value is very likely to be present. The second is that error

      • If you ever went to one of several open sheets and hit undo, and had it jumo to another sheet and undo the more recent thing there, you can see a problem.

        Presumably they think all open sheets are part of an interlocking whole to keep in sync. Or maybe the programmers are lazy. Either way, undo should undo what's on that sheet, not some other sheet (and especially not in another open workbook) that has a more recent undoable.

        • The undo stack interlocking issue is because excel formula can reference cells in ANOTHER FILE. So multiple spreadsheets opened at the same time are treated together like multiple components of the same project. In Excel, XSS is not a bug. It is a feature.

          So there comes another bug as feature: one can't open multiple excel files that have the same file name. By this one can do dynamic linking by keeping multiple versions of the "library" spreadsheets each in their own folder. Then the main "application"

        • Presumably they think all open sheets are part of an interlocking whole to keep in sync. Or maybe the programmers are lazy.

          Yes to both. Here's a really neat trick to annoy someone. Have them open a blank spreadsheet, as if they're starting new. Now open an existing spreadsheet. Congratulations, you now have one spreadsheet because the blank, new one was overwritten by the existing one. If you wanted to use the blank one to copy data into it, you now have to open a second, blank spreadsheet.

    • by burni2 ( 1643061 )

      Extending Excel beyond ..
      Actually you can extend Excel into the SED, AWKward domain also.

      Just install Cygwin and putty, run the ssh-server in Cygwin

      Run putty's pLink and scp from Excel/shell + wscript.shell interface.

      You can use Excel worksheet-magic to create complex commands and then just send them to your cygwin instance and get the result back via scp.

      You can also automagically let scripts be created, some years ago I have started to use the excel shapes to not just draw flow charts but - with some glue

    • by AmiMoJo ( 196126 )

      Excel is one of the major barriers to adoption of open formats like ODF. VBA scripting is proprietary and doesn't work in any other application, and formulas don't always translate properly either.

      ODF needs to support a standardized scripting language, and all the formulas and graphics can be built out of it so that apps can add any feature they want but the resulting spreadsheet will still work in any other app.

      • by robsku ( 1381635 )

        Can the language itself be "proprietary", so that if someone wrote a clean room implementation of VBScript, would it really break some copyright or patent laws? How does that work specifically? Not saying it doesn't, just want to understand....

        • by AmiMoJo ( 196126 )

          Rather than re-implementing VBScript it would probably be better to translate it to some other language. I don't know how bad VBScript is in terms of odd behaviours that are difficult to replicate.

    • by antdude ( 79039 )

      Laundry in Excel? I'd like to know how!

      • by burni2 ( 1643061 )

        You use the win-api to connect to a virtual or real serial port or a HID-USB-Device (ÂC HID-Implementation etc..) and start the washing machine using EXCEL.

    • "but I am also quite amazed at what people build with it."

      Yes, losing thousands of Covid records because people insist on misusing it as a database is amazing.

    • AFAICT excel has been Turing complete for decades now, at least when combined with VBA. But what do I know?

      VBA is Turing complete, always has been. The point here is that excel functions and formulas themselves are not Turing complete without ever having to come across an embedded scripting language.

  • by ebonum ( 830686 ) on Saturday January 30, 2021 @10:02PM (#61010898)

    With a name like LAMBDA, I'm hoping the programing language for Excel will be Lisp! Coming from a company like Microsoft, I fear it will turn out to be visual basic.

    • Re:What Language? (Score:4, Interesting)

      by hey! ( 33014 ) on Saturday January 30, 2021 @11:24PM (#61011100) Homepage Journal

      As a historical note, Turing himself proved that lambda calculus is Turing complete. That may have something to do with the naming.

    • ... be visual basic.

      It's Lambda(), an Excel function which defines an anonymous function that can name its argument and itself become named. It means VBA for Excel and administrator permissions are no longer required to create a user-defined function.

      One of the problems with spreadsheets is an algorithm must be repeated for every data point: That is, no re-useable code. The provision of user-defined functions, ends that.

      ... and dynamic arrays.

      This data type exists only in Office 365: All those old-timers using Excel 2007-2019 and maybe, Office

    • x86 assembly language. Enterprising Russian developers have been using not just Excel spreadsheets but in fact the entire Office suite for years if not decades to run applications that encrypt all of your files for you, send your credit card details for processing in Romania, and back up your banking passwords to a server in Nizhny Novgorod in case you forget them.
    • by x0n ( 120596 )

      With a name like LAMBDA, I'm hoping the programing language for Excel will be Lisp! Coming from a company like Microsoft, I fear it will turn out to be visual basic.

      Yes, coming from the company who created C# and TypeScript. It's surely to be absolute garbage. /s

  • PowerPoint is Turing-complete since at least 2017. https://www.youtube.com/watch?... [youtube.com]
  • We're likely to see viruses far beyond the "excel macros" we've seen in the past.

  • . . . NetBSD?

  • Oh, sorry, that's the Turing test. Not Turing completeness.
  • Emacs can.

    It is at the same time mind boggling and insanely stupid. A full X Server written in lisp that runs under EMACS!

  • Please don't try to turn it into a programming language.
  • Excel's formulas have always been a simple example of functional programming. Events (changed cell values) trigger computations within cells that "subscribe to" those events, by referencing the cells. Maybe this lambda (appropriately named) language will turn it into something more robust. And we hope it doesn't result in yet another honey pot for virus writers!

    • You can't do while loops in Excel formulae (as of Excel 2019), though you can sometimes approximate it using tables, and you can of course do them in VBA.

      • You can't do while loops in Excel formulae (as of Excel 2019), though you can sometimes approximate it using tables, and you can of course do them in VBA.

        Just watch out for Danny. He ran over our lambda a very long time ago because of a drop table attached to his stupid VB scripts and network data base hooks. Mary who owned the Lambda was in tears when she tried to order more wool.

        Seriously though, we still have the difficulties with old VB code from back before Windows was capable of being a secure multiuser environment whether on the intranet or the internet. Things have gotten better over time but the chaos created by having to run interfaces built by ind

  • Last summer, I joked with some colleagues that I was glad Excel wasn't Turing-complete. Then I googled and found out that actually it was. [felienne.com]

    So what's new? And what, if anything, did the fellows back in 2013 do wrong?

  • Emacs beat Excel by 45 years in the Turing complete department. But it's still cool that Microsoft is striving to make software more complicated and harder to use.

  • ... I'll let myself out.

  • Great, we now made Excel macro viruses that much stronger and more complex. Slow clap.
  • by AlexHilbertRyan ( 7255798 ) on Sunday January 31, 2021 @01:06AM (#61011286)
    Brilliant name, very searchable.
  • There are plenty of DB options, nosql, sql etc, but there appears to be very very spreadsheets. Any ideas why ?
    • ... to be very [few] spreadsheets

      I noticed that too. It's a mature technology with little variation, so I guess it's not interesting to the open-sourceware crowd.

      Plus, spreadsheet use tends to evolve into database use (mostly data) or CAS/programming use (mostly math).

      • Exactly given its 40+ yrs since visicalc its very interesting how few attempts of any kind exist.
      • We have Libre Office.

        Is there anything you think Libre Office does wrong that you would want to change? I don't mean missing features which you could contribute to the project.

        Generally where Libre Office is wrong for your use case, rather than lacking sufficient features; the answer is "don't use a spreadsheet".

    • It just fits and works the purpose.

      Guys you really need to understand how evolution works.

      Survival of the fittest doesn't mean best, it means the most fitting with an adequate effort.

    • Because the early spread cheat companies either got bought up, or driven into bancrupsy, or both.

      • I am aware of what happened, im asking why nobody jumped in after that and why the market both commerical and oss has become so small.
  • Hackers salivate

  • I'm pretty sure it was Turing complete already. Compare its capability with Konrad Zuse's Z3 which could only do arithmetic but by looping the program tape it becomes Turing compete.
  • by bspus ( 3656995 )

    I thought excel supported writing your own functions in VBA since almost forever!
    How was it not turing complete all this time?

  • Well I for one welcome our Turing Complete corporate overlords!

  • HTML+CSS3 is Turing complete!
    So, surely, Excel was too!

  • Excel has always been Turing Complete, which is usually thought of as a theoretical concept. One could compute ANYTHING that a Turing machine could, but not easily or efficiently. But ease and efficiency are not germane to the concept. With the added functionality a skilled programmer can write code to compute whatever a Turing machine can without going to extremes. This announcement is bo-o-o-o-gus.
  • A better metric is if the EFF calls it Free as in speech.

  • Excel, like many MS products, is a Frankenstein monster which aims to reinvent the wheel hundreds of times.

  • The more they add bells and whistle, the more painful the lack of basic features is. (not to discuss "code" maintainability ;-) ).

We are Microsoft. Unix is irrelevant. Openness is futile. Prepare to be assimilated.

Working...