Live data from Hacker News

Excel Adds JavaScript and Power BI Support

dev.office.com

61–70 of 108 posts

Re: Excel Adds JavaScript and Power BI Support

#61
post #2

But no Python support as they promised. So sad.

One issue with embedding Python is that it's difficult to sandbox - to securely limit what the embedded runtime, and hence (potentially malicious) custom functions, can do: > [The Python developers'] standard answer to "How do I sandbox Python code?" has been "Use a subprocess and the OS provided process sandboxing facilities" for quite some time. [1] JavaScript, OTOH, is designed to support secure in-process sandbox…

Good point. Another architectural difference between the languages is that Javascript is a [relatively] small language with a long history of working with external API's [i.e. the browser]. On the other hand, Python has extensive standard libraries that would require alignment with Excel. For example, how does csv.reader integrate? It looks like a can of "do the obvious thing" worms and a mountain of unexpected results and documentation.

Mostly, I think it comes down to Python being designed as a systems language rather than a scripting language. Integrating Python would seem to mean either a weak security model or a special (subset) version of Python. Neither is really going to meet the fat part of the Bell Curve...people who just want to get things done in Excel. Applying a 'browser abstraction' to Excel is probably better than applying an 'OS abstraction'. Anyway, JS has been a part of .NET and VS since JScript. Python, not so much.

Re: Excel Adds JavaScript and Power BI Support

#62
post #31

VBA is well obsolete by now. I was really hoping they'd add C# or python to Excel. Yes you can use VSTO to write modules but that isn't the same - you can't send a spreadsheet with C# embedded like you can with VBA. As a result I'm using Python and Jupyter notebooks now, not as friendly as Excel but at least its modern and there are lots of libraries out there to make the platform super powerful.

I know Python was in consideration some time ago.

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

Re: Excel Adds JavaScript and Power BI Support

#63
post #47

A bit surprised that there's no TypeScript support, especially considering how verbose metadata you have to write as a result[1]. That whole thing could be made much simpler with some TS and JSDoc, eg. /** * adds 42 to the input number * @param a the first number to be added * @param b the second number to be added */ function ADD42(a: number, b: number): number { return a + b + 42; } [1] https://docs.microsoft.com/e…

Presumably there will be type definition files available at some point. That way the solution can be maximally general: JS for people who can't use TS for whatever reason (maybe because they're a legacy Excel shop that can't introduce new technologies), TypeScript for everyone else.

Re: Excel Adds JavaScript and Power BI Support

#64
post #47

A bit surprised that there's no TypeScript support, especially considering how verbose metadata you have to write as a result[1]. That whole thing could be made much simpler with some TS and JSDoc, eg. /** * adds 42 to the input number * @param a the first number to be added * @param b the second number to be added */ function ADD42(a: number, b: number): number { return a + b + 42; } [1] https://docs.microsoft.com/e…

Because... this is no support for TypeScript in native JS runtimes?

It would add to complexity if you introduce a compilation step before executing them in JS runtime, especially when you are targeting multiple platforms.

Re: Excel Adds JavaScript and Power BI Support

#68

Microsoft has been doing great work in opening up their software the past couple years. For anyone interested in this, I suggest taking some time to read through Microsoft's Office Platform docs [0]. Quite a lot is possible. The plugin API is really clean and you can create javascript plugins for any office product, where you basically run a "website" in a frame within the office product, and the code in the "website…

So my question is how this integrates with their online version of Excel? For example: I build some custom JS based functions in Excel and used them all over my spreadsheet then I upload it to OneDrive and trying to open it in online Excel form, will it work? That is key for someone like me who creates sheet offline but then wants to consume the data via online version.

Afaik the API is the same, if anything the online version gets updates earlier than installed counterparts. So yeah, it should work from the web too.

There might be additional checks if you package your solution as a proper add-in (it might have to be enabled by an O365 admin).

Re: Excel Adds JavaScript and Power BI Support

#69

Earlier quoted context omitted.

I get the appeal of "DAE hate JS" on Reddit where everyone upvotes you, but it seems out of place on a forum of professionals because JS is not much different than other dynamically-typed languages. I'd say it's better than Python which doesn't have async-by-default nor idiomatic closures. But "puke" is a bit childish.

I'd kind of assume everyone on HN has made their minds up about languages and I'm not qualified to change the opinions of any of them or even really try to be informative. So the puke is just for the (70% at a guess?) people who would agree that this is a bad choice. Since I work with both python and javascript in exactly this dirty moving data around for analysts space (but haven't for long), I'll qualify a bit. The…

JavaScript has every feature you listed, plus a ton.

I'll give you the batteries included part, but you're missing the critical component here, which is Python's dep mgmt story is terrible. Pyenv seems cool, but it's basically NPM - which is a critical part of what they're trying to do here.

Re: Excel Adds JavaScript and Power BI Support

#70
post #22

Earlier quoted context omitted.

And if that works for the business... then where's the problem?

Well, on the one hand, it's not a problem. It's pure elitism to insist that laypeople learn Real Programming and make their spreadsheets the Right Way. Excel + JS is going to be an empowering tool. But on the other hand, it's going to be a nightmare to maintain when you layer it on top of VBA macros, and some poor soul is going to end up responsible for making it continue to limp along. Nobody will understand how it…

Your technical debt is someone else's business opportunity. This is how the IT world keeps expanding, despite increasing the degree of automation available to every process.
Post reply on HN