Excel team considering Python as scripting language: asking for feedback

594 points by smortaz ↗ HN
Folks, Microsoft is officially considering providing Python support in Excel (finally). If you are interested in this, please visit their uservoice page and let them know what you think. Thank you!

https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/10549005-python-as-an-excel-scripting-language

279 comments

[ 4.2 ms ] story [ 242 ms ] thread
Clickable Link:

https://excel.uservoice.com/forums/304921-excel-for-windows-...

[disclaimer+bias: on Python team @ msft & would love to see this happen!]

So what's the strategy here re: security? I assume it'd be a fairly stripped-down version of Python ... or will you just design the UI to say "you probably shouldn't execute files from people you don't know" etc?
I’d rather full fat Python but heavily sandboxed with some form of firewall. “Do you want to allow 2018_Stock_Report_Q1.xlsp to connect to api.erp.corp.mycompany.com?”. Codesigning with my something under my corp CA, manage permissions via Group Policy and let users, on a per-endpoint or per-permission basis, authorise things like filesystem access, network connections, etc.
From a security point of view how is embedding python different from embedding Visual Basic? This is not my area of expertise so I’m genuinely curious.
Potentially different. .NET allows signed binaries / libs / a fully signed execution context, Python has nothing equivalent AFAIK.
Excel VBA is not .Net though. It's plain old VB code in text files inside the .xlsx, and you just have to trust it (or not).
Aaah. Then probably about the same, yea :) Maybe less of a nightmare around dependencies than the pip world...?
> @ msft

Well, I guess that explains why you care about Office in 2017.

That and the fact that the vast majority of companies use Office...
Which is also why it is surprising that Microsoft has spent so little time on office in 20 years. Outside of changing the colors regularly, there has been very few new significant functionalities between Office 2003 and Office 2016. And opening the VBA IDE is a nasty reminder.

I'd argue large companies are still running Windows because of Office. The cost of retraining people, redesigning all of these user processes and converting all those documents would be massive. Whereas most new corporate applications in the last 5 years have been mostly web based.

So I am surprised Microsoft under-invest in what is they main strategic lock-in in the juicy enterprise market.

Between 2003 and 2016 they took some massive desktop applications and put versions of them on the web and mobile...
If you think about it, only 20% if employees can use office at a medium to high level anyways - a lot less people to retrain. The rest are "I click this button then do this thing"
> very few new significant functionalities between Office 2003 and Office 2016

The first release to feature the Ribbon, arguably one of the all-time major changes in Office, was 2007. That took quite a bit for most users to get used to.

An Office suite is not where you add experimental features for the hell of it. People use it to get the job done in so many different scenarios, any change will significantly impact entire industries.

Office programs are the "lawyers" and "accountants" of the software world: their work has been more or less the same since they existed, and any major change to them is a basically societal upheaval, so their approach will always be naturally conservative.

Reshuffling buttons when they added ribbon is what I would classify as "changing the color", not really a new functionality.

There are many things lawyers, bankers, consultants and accountants would need that Office doesn't do. Linking a spreadsheet to a powerpoint document is a nightmare right now. Linking spreadsheets between them too. There should be a way to express a UDF as a spreadsheet so that people who can't code could create their own UDF. I love Apple's Number canvas approach, where a sheet is not a grid but a canvas on which you can add grids or charts, and they overflow with a scrollbar. Etc.

There are lots of new functionalities they could add that would make people's life better. Instead these products barely evolved in 20 years. Click the "fx" button in excel 2016 and you will get the same non resizable dialog box with a tiny listbox and a search box that doesn't search anything than in Office XP.

So, would this imply numpy and scipy support in Python for Excel? How about support for Excel worksheets within Jupyter notebooks?
That's for the Excel team to decide. My personal hope is that they'll offer as a base:

* Python 3

* Numpy, SciPy, Pandas, Matplotlib, Altair, ...

* Pythonic bindings for Excel APIs (sheets, etc etc)

* VSCode's Python Editor + Debugger built in

* Some sort of conda based env/pkg mgmt

* Right-click, "Open in Jupyter" (data/code)

* <your wish here>

Yeah, matplotlib, scipy and numpy are kinda no-brainers there.
Please not matplotlib ... are we really stuck with matplotlib forever ..?
If you've got better suggestions I'm all ears. I've found it pretty great for debugging and being able to understand data in a rapid manner.
ggplot2. Simply better in every way. Hell, even base R is better than matplotlib. Full disclosure: I hate matplotlib so very, very much.
Transparent access to Excel tables as Pandas Dataframes would be so, so very awesome.

I mean, MS implemented these really nice Tables in excel, but then left us no way to easily query them with something like SQL.

Someone posted a link to a really nice 3rd part addin on the reddit thread, on mobile so can't find the link unfortunately but was very well done. Shame on Microsoft for half-assing Excel for the last decade.
I agree, SQL in Excel would be awesome, Index Match everywhere is a right pain to maintain - to replicate foreign keys. Its amazing what you can do with Sumifs and Countifs, but SQl is better. VBA is OK but NO search across modules makes it such a pain just to find your code, I wish VBA had better support for UDFs so that they can appear the same to users, as built in functions with tooltips. MS have done a really bad job of incorporating Power Pivot, it’s confusing and doesn’t feel like a natural part of Excel. I don’t like Pivot Tables they are too Dynamic and a pain too format.
No, watch them pump out some horribly supported python library .
Interestingly, the survey doesn't seem to consider education as a use-case of this - has your team considered that aspect? Spreadsheets are the most common way that school students are introduced to programming, and the only 'programming' that a lot of teachers (and others) do. There are heaps of reasons for this, but any even moderate programming (beyond very simple operations) in a spreadsheet sucks. Something like this (if it's easy out of the box) could revolutionise programming education (and data education for that matter).

Are there plans to get this working with the Excel web-app, or just the desktop version? I'm just having a daydream about Excel, Juypter notebooks, and OneNote Class notebooks...

That's a very good point! I hope you provided that input :).

Our team provides a free service for anyone to run Jupyter Notebooks on Azure. It's currently a big hit with the Edu crowd. We're seeing lots & lots of universities upload & teach courses on it. eg:

http://notebooks.azure.com/richie

There's also an Intro to Python notebook on the front page.

Hopefully the Excel team will consider Jupyter integration, esp for the web-app version! You're right that it's a killer combo. Check out xlwing's video on using Excel+Jupyter - it's brilliant.

I think we will see and are already seeing a move away from using spreadsheets in Education, there are simply much better solutions out there now. Jupyter notebooks being one which allow reading and writing to Excel files. The interface of these is far superior for educational purposes than a spreadsheet. I've already dropped Excel for this reason.
Dear Excel team,

Take a look at the top three results for "excel python" on bing.com for some great ideas on how to incorporate python into excel.

---

1.) https://www.python-excel.org

2.) https://www.pyxll.com/

3.) https://www.xlwings.org/

There is also pyspread as a full spreadsheet implementation using and for Python: https://manns.github.io/pyspread/
> Pyspread expects Python expressions in its grid cells, which makes a spreadsheet specific language obsolete. Each cell returns a Python object that can be accessed from other cells. These objects can represent anything including lists or matrices.

Huh, on the one hand sounds like a such a simple way to deal with it that I can have trouble imagining a more elegant approach.

On the other hand, does it still respect the ways that Excel updates cells? Sicne that kind of requires immutability I think.

Haha, I love the little jab at Microsoft's NIH syndrome by suggesting bing search results - seems though that by looking at Python they're slowly getting over that.
So when I google how to do something in Python I will have to comb through solutions specific to v2, v3 and now also Excel? ;)

Aside from that it sounds like a cool idea.

(comment deleted)
An absolute no-brainer. Python is the new BASIC - very popular with people who have to program to do their work but aren't programmers. It's an excellent choice for a spreadsheet.
>aren't programmers

Also extremely popular with people who are programmers and need to do things.

Sorry, this is a frustration of mine lately. Python is a fantastic introductory language. It's also a fantastic general purpose language.

Newbies get turned off of it because it feels too easy, and they know that "real" programming is supposed to be hard.

I disagree.

Python is great for scripting and for small projects, but I believe strong, static typing is an essential feature for large scale projects. I wouldn't want to use Python for anything that's predicted to end up with more than a couple thousand lines of code.

Python 3 supports optional type annotations that you can check with something like flake8.
Most people writing VBA code for excel are only informal programmers. For example, I never took a CS course in my life but learned VBA and programming on the job. Since then I've learned python and other languages but when I'm doing a home project or something I always come back to python. It's just so easy. I was working on a macro the other day in Excel, it took me a couple hours to get it all working but I'm pretty confident that if I could've coded in python I could've banged it out in 20 minutes or less.

Edit: I suppose my point got a little lost. What I mean is that I highly doubt much Excel code is a "big project." It may feel that way when you crawl through some of the hideous VBA coding I've done but much of this is due to the inexperience of the coder and the realities of VBA. Give me python + 4 or 5 libraries and I could recode anything I've ever made in VBA in 1000 lines or less.

Unfortunately, there are several companies and hundreds of divisions of companies run entirely out of excel spreadsheets.
And integration with Python will be an enormous help for them.
Next up, get rid of Access
No one is proposing that we get rid of spreadsheets.

I understand, though: you hate VBA. And by extension, Access. But Excel, with or without Python, doesn't mean it can suddenly be used as a relational database. But you knew that.

So, what should replace Access?

Actually, a number of people are proposing this for certain applications. It is also reasonably likely to happen, at very least the spreadsheet is being challenged which will put pressure on spreadsheet vendors and most definitely cut into their marketshare. Adding Python support to Excel seems to be an attempt to resist this.
Given that there are literally thousands of huge projects using Python at massive scale and hundreds of kLOC, it's clearly not essential.
"50 million cigarette smokers can't be wrong!"
An appeal to popularity is not really a logical fallacy if someone is arguing that something is (effectively) unpopular.
Depends if you define popular by most used or most liked.

Most used: everyone pays taxes. Paying taxes is popular!

A more practical example is javascript. I write some javascript, not because I like it (I hate it), but because that's the only way to make things happen in a browser. Javascript is popular. Does it mean it is liked / a good language?

(comment deleted)
If the statement is "there are no cigarette smokers", then "there are 50 million" is a reasonable counterpoint.
Code written in a statically typed language requires less testing. How is that not essential?
Code written in dynamically typed language requires less code, which often means less surface area for failure, and less tests.
> often means

No it does not, neither in theory nor in practice. Also, "less code" depends primarily on the language structure and not on whether the language is dynamically typed or not. (Haskell, for example, is more terse than Python.)

>No it does not, neither in theory nor in practice.

I've yet to come across something that was fewer loc in C++/java than in python.

That said, this is true even if I use pytype.

That's a fine personal opinion but I'll add my vote to Python being a wonderful choice for large programs.
Instagram would disagree with you. Seriously, Python is an absolute pleasure for managing large web projects and the lack of static typing has never been an issue for my company (spend the time writing tests instead!)
>(spend the time writing tests instead!)

Every sufficiently large test suite will contain an ad-hoc, informally-specified, bug-ridden, slow implementation of half of a proper type system.

What's the point in testing types if the tests that check it works pass?
No, the claim is that the tests that "check it works" are really testing the types (as an ad-hoc type checker) and wouldn't need to be written if a sufficiently strict static type system were used instead.
Every sufficiently large statically-typed application will contain an ad-hoc, informally-specified, bug-ridden, verbose implementation of half of a decent dynamic language.

(I too enjoy a good pseudo-Greenspun)

More seriously something I've been pondering a lot recently watching the old pendulum swing back towards an enthusiasm for explicit typing is this:

* The advantages of static type systems are obvious and easy to articulate. * The disadvantages of static type systems are subtle and difficult to argue.

I started my career as a professional programmer when the pendulum was moving in the other direction. Essays by Paul Graham on Lisp and Python. The marvellous PJ Eby piece quoted above and Peter Norvig's "Design Patterns are artifacts of language flaws".

I just feel dynamic languages fit my brain better but maybe that's my own form of Stockholm Syndrome. Maybe I need to try a decent type system rather than the brain-damaged descendents of Java...

I think I've never really got the point of a good type system until I started using Elm and then wandered into the rest of the ML world, learning the so called "Type-Driven Development" method.

After some time doing that a Java project came up, so I grabbed Lombok, Vavr and started writing Java as if it was just another ML (immutability first, paying attention to side effects and so on) and the whole thing made sense. More sense than all those years of OOP teachings. The code was easy to debug, easy to reason about, easy to change. And it was Java. And that just stunned me for life.

Then of course, I started using TypeScript for React development and giggled like a little girl every time I had to refactor something, for I KNEW that it was very unlikely I'd have to stare at the debugger for long periods of time in a wild goose chase like I often had to with plain JS.

But the trick was to learn the way of doing things in the languages that really guide you towards that path.

I can definitely recommend that you try Elm if you're into frontend development, or something like F# if you want native. As far as docs go, the Elm guide and fsharpforfunandprofit.com are both great; the latter I can recommend regardless of your language choice for making typed functional programming make sense. I can also recommend the book Type-Driven Development with Idris, which has also been an invaluable resource to really understand that way of doing things.

Yes let's waste our companies time and money by writing tests for things the compiler could guarantee for free!
Not for free. You have to think and write types, maybe add some code to cast values between them or implement the same function twice for two different type signatures. Sometimes it still gains time, sometimes it doesn't.

Anyway, I doubt that a VBA replacement would need types. The use case is small scripts.

Python is strongly typed. You still have to think about the types. Except now you have to think about them every time you work with the code, not just the first time.
I work with Python and Ruby (some Elixir.) They are strongly typed in the same way. I hardly think about types. The code just works. The only scenario in which I have to stop and think is when I get some input, for example some JSON. Is that value I have to add to this counter a string or an integer? I can cast it to integer and that's it. To be fair, sometimes an integer gets where there should be a string and boom. Still, I prefer that to having to write types again as I used to when working with C and Java. I fix the code and I don't write tests to check the types of function arguments. Maybe I could accept some type inference, but no more string, int, generics, etc.
(comment deleted)
You have to think about the types for some small pieces of your code where those types matter. That's what hints are for. Python lets you, through type hints, only care about the typing in those small cases where it actually matters, and ignore them the rest of the time.
Most of it is caught as incidentals of tests you have to write either way.

There's room for both paradigms - it's kinda silly to argue strict superiority of either because there's just no empirical evidence that having static typing or not drastically changes bug count.

If you take a look at some of the studies out there that do exist (which there are, admittedly, few, and it's a fundamentally tough thing to measure), e.g. [0], it usually tends to be the case the both typed and untyped languages show up in the realm of "least likely to produce bugs"

[0] http://web.cs.ucdavis.edu/~filkov/papers/lang_github.pdf

Ah yes spend that valuable engineer time writing type validation tests a compiler could do instead of new features.

Put me with Op. I'll use Python for prototypes and small tools but get past that and I want a statically typed language. Not just for validation but also refactoring.

That's one thing I don't understand. The argument I hear against static typing is that it's too much work to write all this type metadata. But if you have to make up the lack of compiler checks with lots of tests for things that wouldn't require tests in a static language, we are not saving any work.
That's because you're not testing things that wouldn't require tests in a static language.

You're testing things that need testing either way, and incidentally also testing the types.

No, you're testing types and verifying the implementation details of the language. It's rare that a test for logic "incidentally" tests the type system. Usually both the logic and type checks are tested. It's just obfuscated because the bulk of the test is for checking the types and it's easy to look past that.
Yes, it doesn't test the "type system" (whatever that even means).

However, it tests values for correctness. Values have types. So if you are testing whether something has the correct value, you are also testing implicitly that it has the correct type, because for the values to match, the types must also match.

I love Python but I also don’t mind static types. Maybe I will realize some day what this argument is really about, but I expected that day to come by now.
I'd rather not write a bunch of tests that are really acting as a static type checker or, worse, testing the Python equivalent of compiler, linker and assembler output.

That's what the vast majority of testing is when it isn't simply testing mock code implementations.

Python is strongly typed, and Python 3 annotations with tools like MyPy brings static type checks.
Have you used MyPy? I'm currently looking to adopt it, but the feedback I've been getting is that it's a lot more painful to use than Typescript (which imho sets the gold standard of "optional typing").
I haven't used typescript, but I have used MyPy (Or, more accurately, pytype), and its absolutely a joy to work with. I've also used closure (the JS type system that isn't TypeScript) and I prefer pytype, fwiw.

My only complaint about Pytype is that there's no `Char` type at compile time (ie `for x in "a string"` -> Iterable[Char] instead of Iterable[str] during typechecking). But alas.

Unfortunately, MyPy doesn't work well with libraries or third party packages and treats external objects as `ANY` type. You can work around this with stubs but it's not fun writing type annotations for third party objects / functions. typeshed exists for the standard library and various popular third party libraries[1] to solve this very problem.

[1] https://github.com/python/typeshed

I used to think that but I can't recall the last time the compiler saved me when augmenting or refactoring someone else's code - the IDE beats it to the punch every time - and static typing is not substitute for a good test suite.

On the flip side, i use interfaces and dependency injection constantly in java to work around static typing. In python, i write probably ~20% the amount of code because i never use interfaces, wiring logic or convert types.

Try Cython, the benefits of both, IMO.
At last! hehe I was wondering why no-one mentioned Cython. Did I miss the part where everyone learned why it's not a good idea? For me it's the best of both C and Python worlds.

Write a Python program. Compile it as a Cython program. (Already faster, with no changes.) Add C types to the speed-critical parts. (Up to many 100s of times faster than Python)

Last time I saw the Bank of America python codebase, it had ~6 million lines of code, was worked on by about 4,000 developers, and ran some core, performance critical functionality.

Python programming is an aesthetic that needs learning. Many of the worst written, and least maintainable python codebases I've seen are by programmers/teams coming from "proper" languages and don't think they have to learn how to write idiomatic python.

(comment deleted)
Bzzzt - not really. Quartz in BoA, and Athena in JP Morgan (both built by the same folks) essentially takes Python, connects it to a bucketload of C++ and Java that makes up the bulk of the banks services, adds on a GUI layer, a pretty crappy object storage layer (shudders at Hydra...) and a half-baked object persistence layer that was always so slow. Sure, a lot of Python scripts get written for those platforms, but the heavy lifting -- pricing, trading, order books, risk systems, market data, connectivity all ends up being C++/Java, maybe in a Python overcoat.
Wait that "Quartz" monstrosity is still around?
A bit dated now, but still a great read about a Python project done by Java developers: http://dirtsimple.org/2004/12/python-is-not-java.html

"So, the sad thing is that these poor folks worked much, much harder than they needed to, in order to produce much more code than they needed to write, that then performs much more slowly than the equivalent idiomatic Python would."

> A bit dated now, but still a great read about a Python project done by Java developers: http://dirtsimple.org/2004/12/python-is-not-java.html

I included a link to this blog-post in the "letter of intent" (don't know the exact English term) that I sent to my potential employer just before my first interview for a professional (Python) programmer job, back in 2005. I got the job. Good times.

Yeah, I've seen that story played out so many times.

Best example I've seen was from a couple of Java devs transitioning to python, they re-wrote a system 3 times: 1st time: 35k loc 2nd time: 10k 3rd: 2k

The third rewrite was also significantly faster than the first two :)

And it appears to be a recruiter goldmine, the staff turnover is significantly high (so I am told). A codebase of this size with no static type checking is not going to be fun.
Sitting on 90K lines of Python here. It’s a breeze. Rarely see an error, and when I do, it’s from a third-party API failing to do its job properly (which is then successfully caught to avoid it causing problems). I’m interested in and use other stacks (mostly Elixir), but I don’t have any complaints about the language itself after 10 years.
> strong, static typing is an essential feature for large scale projects

This is empirically false.

There are (of course!) good reasons to consider static typing. But, in my experience, use of static typing has never been a first-order predictor of business or technology success. It's quite possible to build considerable value with, for example, a large Python 2.x code base.

A fun, and tangentially related, talk: https://www.destroyallsoftware.com/talks/ideology

All of it is possible, but specific features help in making better software cost less in time and money.

For example, nullability annotations reduce nil pointer exceptions.

Static typing removes the need to make certain typing unit tests, makes refactors easier to do in large code bases, makes it easier for compilers to generate faster code and so on. Think of them as compiler level linters.

Anyway, python has a static gradual typing mechanism. You should try it out :D

That reminds me of Kapital [1] - a valuation and risk analysis system written in Smalltalk at JPMorgan, begun in the early '90s and as far as i know still going; 14,000 classes, 400,000 methods, hojillions of dollars of profit, twenty years in service, zero types:

http://www.esug.org/data/ESUG2004/ValueOfSmalltalk.pdf

> 14,000 classes..., zero types

In my view, classes are types. (Well, maybe I'm just spoiled by C++.)

In C++, classes do indeed define types. Templated classes define whole families of types. But in Smalltalk, classes do not define types.

I understand the word "type" to mean a property of a variable which restricts the range of values it can hold, and the set of methods which can be invoked on it. Smalltalk doesn't have any way to do either of those things, so it has no types.

But don't objects that belong to a class also effectively have similar restrictions imposed on them? (Otherwise, why have classes at all?)
It's true that a class with a set of methods defines a contract with its collaborators about what calls they can make (or what messages they can send, in Smalltalk terms), that is a lot like a type. Smalltalk calls this a "protocol". But they aren't enforced by the compiler; you can still send a message to an object that it won't be able to understand. What happens in that case is that a method called doesNotUnderstand gets called; a class can implement that to try to do something useful (you could implement a proxy this way, for example), but the default implementation throws an exception. I think that a genuine type would prevent the message being sent in the first place - the could would be rejected by the compiler, and would never get a chance to run.

Interestingly, it seems that this was planned for Smalltalk, but never implemented; a 1981 article about the design of Smalltalk [1] says:

"Also, message protocols have not been formalized. The organization provides for protocols, but it is currently only a matter of style for protocols to be consistent from one class to another. This can be remedied easily by providing proper protocol objects that can be consistently shared. This will then allow formal typing of variables by protocol without losing the advantages of polymorphism."

[1] https://www.cs.virginia.edu/~evans/cs655/readings/smalltalk....

That's not "empirically false", it's just not empirically true. Static typing is a big boon to software development, and I use Python in my day job.
The OP said "I believe" so obviously we can neither empirically prove or disprove the statement. We can say with absolute certainty that static typing is not required for large codebases, because there are large codebases that are not statically typed.
Are there large codebases that are not statically typed? Yes? Then empirically it is false.

> big boon

But they argued ‘essential’. You’ve watered that down to nice-to-have.

People will tell you that instagram uses python or yelp or other big name projects use python. Certainly, type checking is not Essential to a large project the same way utensils are not essential when you eat. You can just use your hands to shove all the food into your mouth.
As an Indian, I'm not sure what I'm supposed to make of your analogy...
Perhaps you can infer that someone who thinks eating with their hands is uncivilized will have equally ignorant opinions about computing.
And what you are inferring is incorrect. I never said eating with your hands is uncivilized. You inferred it in your request for someone else to infer something.
Oh, stop backtracking. If I were you, I'd take the metaphor further and explain why eating with utensils is more hygienic. Type safety, food safety, ... You could write some flavorful prose (ha!).
Wait, was the underlying message not supposed to be "everyone should conform to my world view"?
That was not the underlying message. The underlying message is: I have my world view, I am offering it, you can agree, disagree or conform. The choice is yours. I would never force anyone to conform. Where in my post did I say that?
You latched onto the word "conform" when the word "should" was more important. You implied that type systems are better in the same way that utensils are better. If that wasn't your intention, your analogy was extremely confusing.
(comment deleted)
It's controversial. It could be good or bad, depending on your culture and opinions.
Well, there are rules to using utensils, and eating some types of food using them would seem uncivilized if not plain ridiculous. (Eating without hands, though, is surely uncivilized in the eyes of most people.)
I agree and I would add to that that many users of these scripting tools in Office are novice, and dynamic typing makes the language non self-discoverable. Static typing lets the IDE give a lot more feedback on invalid syntax, what can be done from there, etc. So I think this is a disservice we make them.
Saying dynamic languages are for novices hints more at you being one than anything else.

Not everyone likes IDEs (Emacs and VIM are still by far superior to many) and not everyone wants to deal with all the extra code and boilerplate and ad-hoc data classes that comes with static typing, to name a few.

Dynamic languages have faster iteration times and from experience that can yield higher quality software. They're easier to fit in the functional paradigm, better to model data transformations, and a bunch of other goodies.

You can't judge something without taking into account the context in which its used. And for scripting something like Excel dynamic is clearly superior.

I am not saying dynamic languages are for novice. I am saying people who will be using office's scripting are more often than not programming novices (like they are with VBA).

You may like plain text editor but for someone who doesn't know how to program, typing a variable then dot, and having a drop down of what is available from there, with an embedded documentation and direct IDE feedback on what is correct or incorrect syntax immediately after typing every character is super useful. RTFM isn't novice friendly.

Sorry I misread your first comment.

Its still possible for dynamic languages to have auto-completion. There's way more information available at runtime than at compile-time.

Besides, IDEs tend to have the entire world in most autocompletions, which is not useful either.

There would be no IDE here, you'll probably still write code from within Excel and advanced users will use separate source files to leverage their editor of choice.

The novices you mention will not want to leave Excel. A dynamic runtime with reflection is all you need to give a friendly experience. That doesn't prevent type hints, inference or autocompletion.

This is to script spreadsheets, not build the next Netflix.

I would hate a typed language in there. Besides most static typing systems are ridiculously weak and introduce more headaches than they actually solve.

> Besides most static typing systems are ridiculously weak

E.g. Go (and I still love Go, but it's pretty weak...)

>This is to script spreadsheets, not build the next Netflix

With some of the spreadsheets I've seen, the next Netflix might just come out of it.

Just kidding, but only a bit. I've been at factories where if VBA stopped working, I literally don't know if we could have produced product that day.

>"Python is great for scripting and for small projects but ..."

You mean like Dropbox, Evernote, Ansible, OpenStack etc.

Or Google...
You would actually be hard pressed to find ANY major codebase that isn't using at least one dynamically typed language in at least some significant capacity.
Or at least a compiler to catch foot shooting (I used to agree 100% but elixir sort of changed my mind)
> but I believe strong, static typing is an essential feature for large scale projects

Python is strongly typed and has an available static typechecker, so, even if this is true, it doesn't rule out Python for this use case.

You should have a little bit more experience with Python and you would see how huge systems can be written in it with no problem. It needs a bit more discipline, but above 100k lines software written in any other language would need the same discipline also. (I'm working with 100kloc codebase right now and seen almost 300kloc. That was messy because mostly juniors wrote it :D but still bearable and profitable.)
(comment deleted)
I bet thats why so many AI, Backends, ML, and IoT projects are written in Python

because it has no long term potential

Yup, it teaches algorithms very effectively with low boilerplate; personally it's my favorite way of expressing dictionaries/hashtables and other data structures. Generators and iterators are super powerful concepts that I didn't learn in college and wish I did earlier.

It also allows a developer to manipulate individual bits, which is pretty amazing for security research or other cases when you want to get low level but don't want to get in the weeds with C.

It's actually surprising the Excel team isn't considering TypeScript. TS is a modern language that they control, gives them an out for eventual browser compatibility, and they've already built great tooling (better than the visual studio tooling for python)
> eventual browser compatibility

You'd be hardpressed to reinvent excel in a browser. Sheets is a big, advanced web app but it doesn't even come close.

(comment deleted)
Wow!! Sheetjs looks cool! What kinds of math libraries do you support inlieu of Scipy /numpy. I am looking to mostly do some Exploratory Data Analysis
Python is extremely permissive and flexible, even for a dynamic language - a trait that makes it easy to learn and easy to throw something together quickly. But when building software at scale, we need restrictions. For example: static types, immutability, pure functions, total functions, algebraic laws. It is restrictions such as these that give us the power to reason about code and the ability to compose it at scale. Beginner's do not understand how one can gain power from restriction. Skilled programmers do and most would not recommend Python for large-scale general purpose programming.
I know plenty of skilled programmers who would recommend Python for projects at any scale, and just as many who do it every day.

No true scottsman etc.

It's also a fantastic general purpose language.

Why do you find it so fantastic? What stands out for you?

Python was my first real programming language, but I don't see anything very attractive about it now - save the libraries.

Honestly I can't imagine having to use anything else now. I look at every other language and it seems like a giant step back, syntactically.
(comment deleted)
Although, certain consumers (the financial industry comes to mind) might have so many massive, old, linked, and undocumented VBA-enabled spreadsheets that they would probably prefer VBA to at least be supported on a legacy basis for ever and ever.
Converting and updating those is going to generate a lot of contractor opportunities.
Javascript would be another example of language that many people has been exposed to.

I would even say it would fit better, not because the language is better, but because indentation wouldn't go in the way for quick & dirty one-offs.

You can already do this with xlrd and xlwt.
Excel spreadsheets are cool because if you update data somewhere, it'll update all the formulas and products elsewhere.

How do you get that kind of "watch" behavior with `xlrd` and `xlwt`? You don't, you have to re-run a script. Sucks.

Try XLWings
Right. XLWings looks like a cool tool.

But the point I'm making is that: It's still a good thing for Excel to be integrating more tightly with python. It'll help all of those non-developer normies get the magic of coding.

They're really dropping the ball by not using powershell
Don't do it!
Why?
The people that are going to use this aren't programmers. They are going to hate that the code has to be indented properly or it is considered an error.
Imagine all of those simple tasks that you could do in seconds with a python script. Export to csv in UTF-8 with double quoted fields. Loop through cells

  for row in rows:
     do some cool stuff
Pull data from a REST API using requests rather than some VBA hack. I'm getting over excited already. Edit data for your ERP and then post it back to the API and update the db... This is exactly what finance/data people want. Write custom functions (with numpy maths!)! No more nested If's. This will keep Excel as the premium spreadsheet app. I love it
I already find myself reaching for Google Sheets quite frequently just to do this. I'd love to be able to use Python instead of JavaScript.
Just do it! We 've been waiting for decades for a replacement of visual basic.
python isn't the bestest thing in the world but it's still a massive win for them, and a massive win for excel users. VBA had too many shortcomings and led to loads of scalability problems even for medium size apps.
To its defense VBA litterally hasn't been updated in 20 years. It's hard to hold a 90s language to the 2010s standards.
Fair enough. Although the jury is still out about it's value in the 90s too :p
here's my feedback: embed sqlite in it and you're done. Nobody needs any more servers, you can literally replace a hundred thousand dollar "big data" center and team of PhD data scientists with a business school dropout. And you will get prettier, more actionable results.
Can everyone read this and vote this up in the survey? This is the real LPT.
I am 90% certain that MS has abandoned its EEE strategy from the nineties.

But the scars from that era are so vivid in my mind, that I feel the need of a confirmation.

What do you want confirmation of?

That MS is now a gentle, caring beast? Large organizations are not like that, they are money making machines that adopt strategies to maximise profit. EEE is no longer such a strategy, though it worked very well for a long time.

Will MS ever go EEE again? In a heartbeat if they felt it would maximise profits.

Does that seem likely in the short to medium term? No, the industry is different now, and they have to play nice.

Look at "R" programming language, or look at "JavaScript" (-> TypeScript).

They still do the EEE strategy. Fool me once...

(comment deleted)
I've probably mentioned this before on another news article. Not like it really matters. Python is nice as a beginner scripting language since it's (to my own judgement) the most easily readable language to its function set.

When working with software like office, you are going to have a lot of users that don't exactly spend their days programming, or studying syntax. Excel is a little different in their own regard. The functions system has a lot of depth to it, and makes sense to a cell system, but for some it can be a but overwhelming in terms of how its written, since everything has to be written exactly as a function. I guess you also have generic office macros, haven't used them since high school.

In saying that, could this somehow be a reason why the office team have decided on a python interpreter, instead of say JavaScript or Microsoft's work on Typescript. Because python is easy to write, fast to learn, therefore users or even really employees in large data management positions don't have to worry about their time input?

As long as the range object works in the same way, I don't care. Would be nice to have proper objects instead of having to use interfaces. It would also make a nice sandbox for beginners to learn python.
I'm actually more concerned with good tools for working with code than the language, but Python would be an improvement over VBA, and conceptually allow them to use Python tooling they've developed for other uses in Office.
Might be worth reminding everyone of a dead Microsoft project called VSTA, which was basically a live .net IDE embedded in Office. Effectively a mini visual studio inside any office application, where you can write any .net language. This would have allowed people to script in VB.net, C# or F#. Microsoft killed the project before it shipped (but licensed VSTA as a scripting tool for third party apps for a while). It's a pitty. I think this would have been a better solution than python.
Good point that the tooling would've been awesome. However, I don't think .net would have spawned the rich ecosystem of Python pkgs that we enjoy today. And /that/ is a huge part of the whole Python value prop. From astronomy to finance to bioinformatics to ML & everything in between, there's a pkg for that. We even did sponsored a port of numpy+scipy to .Net (via Anaconda). At the end of the day, there were just too many corner cases & too many pkgs to port for it to make sense.
Glad to hear that the Excel team is finally listening to your requests on this one. It's been a long time coming. Too bad they weren't interested during the TC days. If it does happen, it would be great if you could get the Cloud Numerics effort rebooted as well. There might still be a few people from our old team at NERD capable of resurrecting it.
I know it's heretical amongst the Finance types... but one of the few reasons to use Sheets over Excel is for its scripting abilities. This will remove that advantage.
This would be awesome! I've built some tools using VBA and found it to be the most painfully unpleasant programming language I've ever used. Python is by contrast the most pleasant!
This would be great but it's a bit surprising given the move to add support for R in SQL server, Power BI, etc...
This will be >>> better than using JS as a scripting language in Google Sheets.
They should never do this because many people spent lots of time learning existing Excel scripting and they won't like it. Fortunately the user feedback will likely be very negative, so will stop this is it's tracks./s

Henry Ford: "If I asked customers what they wanted, they would have said faster horses"

Steve Jobs: "A lot of times, people don't know what they want until you show it to them"

Seriously. Just build it and and make it great. When you can show that you can do amazing things with it, release it. The downvoters will also then adopt it, if you made it great.