You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A question that comes often is why a new language? One our goals is a language that Excel users can learn.
Programming Languages For Programmers
Most programming languages have been designed for "programmers". I put programmers is quote because there is no clear definition of it. But what is typically common in them is they have decided to call themselves programmers. Usually after learning programming for either profession, or hobby.
To build a non trivial application in Python means you have to learn Python, but also GTK/Qt, or you have to learn ncurses/TUI, or Django/HTML/CSS/JS/AWS etc.
This is what Simon Peta Jones (creator of Haskell) has to say about JS for Excel users:
When I first joined Microsoft 22 years ago, my first question was how can a functional programming researcher make an impact at Microsoft? So I soon zeroed in on Excel because Excel’s formula language is precisely a purely functional programming language. Moreover, it’s more widely used than any other programming language on the planet. [However,] Excel’s formula language, considered as a programming language, is terribly limited.
[...]
You can’t define new functions. You can only write formulas that call the existing built-in 600 functions that are part of Excel. I don’t really count writing new functions in JavaScript here because end users just can’t do that.
PHP
PHP is one of the first languages I deployed an application in, used by me, and then by others, and PHP is one of the top languages used even after 20 years because of its immediacy. Any HTML file is a valid PHP program. HTML can do quite a bit. And with some sprinkled PHP logic you can do a lot.
When you go from HTML to PHP to JS/CSS, at every step you have something working, you learn a little bit, and then you learn something new and unlock a power.
This is unlike Django/Python etc, because before you get to see a working page, you have to learn a lot. PHP with some quick way to upload PHP files to server makes a lot of programmers quite powerful. We consider PHP to be superior for this reason compared to Python/Javascript. You learn just one bit, and you have end to end deployed web app, and you learn more to do more.
PHP fails in still being too hard. It still requires HTML/CSS knowledge. The code is not maintainable unless much different practices are followed. WE want PHP like easy learning curve, and the initial code one writes to be as close to best practice code as possible.
Excel
Excel has a formula language, which is used by about 75-300M people in the world. Compare this with total of 30M or so programmers in the world.
Simon Peyton Jones, a major contributor to the Haskell functional programming language and researcher at Microsoft Research, noted that the Excel formula language may be the most popular functional programming language in use in the world.
Excel is excellent in its "ease of learn", we can believe Excel is easier to learn compared to all other programming languages as it has maybe 10 times the users compared to all other programming languages combined.
Why is Excel easy?
Excel does not have proper developer blog, but the same team that created Excel is also creating PowerFX, which has this to say:
Power Fx is expressed in a human-friendly text. It is a low-code language that makers can work with directly in an Excel-like formula bar or Visual Studio Code text window. The "low" is due to the concise and simple nature of the language, making common programming tasks easy for both makers and developers.
One writes force = mass * acceleration as a formula, in the mathematical sense, for calculating force that is always true. As mass or acceleration changes, force automatically updates to a new value. An expression describes a calculation, a formula gives that calculation a name and uses it as a recipe. This is why we refer to Power Fx as a formula language.
Consider this example:
The Fill is bound to a "formula".
There is no way to explicitly set the Fill property value at all. If the color isn’t working as expected, you need to look at this one formula to understand why is it not working. You don’t need to search through the app to find a piece of code that sets the property at an unexpected time. There is no time element, the correct formula values are always maintained.
And
What's great about this is that it is isolated from what is happening for the Fill color; these are two entirely different calculations. Instead of large monolithic procedures, Power Fx logic is typically lots of smaller formulas that are independent. That's easier to understand and enables enhancements without disturbing existing logic.
Power Fx is a declarative language, just as Excel is. The maker defines what behavior they want, but it is up to the system to determine and optimize how and when to accomplish it. To make that practical, most work is done through pure functions without side effects, making Power Fx also a functional language, again just as Excel is.
Excel Gets Lots Right But Some Things Wrong
The only main mistake they have made is limiting themselves to grid. It is a historic mistake. The underlying engine of Excel is a UI programming engine, but unfortunately the UI that is generates has artificially been limited to just grid of cells. And this is where PowerFX comes in. They realised their mistake, they have an excellent UI engine, with pure formulas, easy debuggablity etc, just a very poor editing experience.
Even PowerFX editor, in attempt to be visual editor forces you to deal with writing formulas in torturous interface. PowerFX is not at all Git friendly.
Lately they have added LAMBDA support, an ability to define your custom functions in Excel formula language itself. It should not have taken this long, and it should definitely not have takes this shape. The LAMBDAs should have been packaged into reusable packages. There should have been a NPM of LAMBDA function libraries. They should have given full blown data type definition support.
LAMDAs are only for data, you can not define UI components using lambda, only functions, and you have to manually bind LAMBDA with everything, say change Fill, row size etc. These are all mistakes.
Imagine a LAMBDA that defines UI. That has packages you can import.
Currently we are targeting only Browsers for FTD, but Excel, native iOS etc are not out of picture. Imagine if there was a language where you can define how the Excel table will look like, not just the content of the cell. LAMBDA solves content of cell controlled by a formula. PowerFX and Excel allow or will soon allow you to control the Fill with a formula. But instead of assigning each attributes one by one to different LAMBDA, what if you can designate the entire cell to a LAMBDA, that returns the entire UI spec.
FTD is LAMBDA + UI Components
PowerFX gives you a canvas where you can place elements, and connect them. FTD gives you a text file where you an import and bring in elements and connect them. In PowerFX/LAMBDA you write some code, but using a rather crappy code editor. In FTD you have a proper code editor.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
A question that comes often is why a new language? One our goals is a language that Excel users can learn.
Programming Languages For Programmers
Most programming languages have been designed for "programmers". I put programmers is quote because there is no clear definition of it. But what is typically common in them is they have decided to call themselves programmers. Usually after learning programming for either profession, or hobby.
To build a non trivial application in Python means you have to learn Python, but also GTK/Qt, or you have to learn ncurses/TUI, or Django/HTML/CSS/JS/AWS etc.
This is what Simon Peta Jones (creator of Haskell) has to say about JS for Excel users:
PHP
PHP is one of the first languages I deployed an application in, used by me, and then by others, and PHP is one of the top languages used even after 20 years because of its immediacy. Any HTML file is a valid PHP program. HTML can do quite a bit. And with some sprinkled PHP logic you can do a lot.
When you go from HTML to PHP to JS/CSS, at every step you have something working, you learn a little bit, and then you learn something new and unlock a power.
This is unlike Django/Python etc, because before you get to see a working page, you have to learn a lot. PHP with some quick way to upload PHP files to server makes a lot of programmers quite powerful. We consider PHP to be superior for this reason compared to Python/Javascript. You learn just one bit, and you have end to end deployed web app, and you learn more to do more.
PHP fails in still being too hard. It still requires HTML/CSS knowledge. The code is not maintainable unless much different practices are followed. WE want PHP like easy learning curve, and the initial code one writes to be as close to best practice code as possible.
Excel
Excel has a formula language, which is used by about 75-300M people in the world. Compare this with total of 30M or so programmers in the world.
Source: InfoQ
Excel is excellent in its "ease of learn", we can believe Excel is easier to learn compared to all other programming languages as it has maybe 10 times the users compared to all other programming languages combined.
Why is Excel easy?
Excel does not have proper developer blog, but the same team that created Excel is also creating PowerFX, which has this to say:
Source: PowerFX Overview
They are a "formula language":
Consider this example:
The
Fill
is bound to a "formula".And
Excel Gets Lots Right But Some Things Wrong
The only main mistake they have made is limiting themselves to grid. It is a historic mistake. The underlying engine of Excel is a UI programming engine, but unfortunately the UI that is generates has artificially been limited to just grid of cells. And this is where PowerFX comes in. They realised their mistake, they have an excellent UI engine, with pure formulas, easy debuggablity etc, just a very poor editing experience.
Even PowerFX editor, in attempt to be visual editor forces you to deal with writing formulas in torturous interface. PowerFX is not at all Git friendly.
Lately they have added LAMBDA support, an ability to define your custom functions in Excel formula language itself. It should not have taken this long, and it should definitely not have takes this shape. The LAMBDAs should have been packaged into reusable packages. There should have been a NPM of LAMBDA function libraries. They should have given full blown data type definition support.
LAMDAs are only for data, you can not define UI components using lambda, only functions, and you have to manually bind LAMBDA with everything, say change Fill, row size etc. These are all mistakes.
Imagine a LAMBDA that defines UI. That has packages you can import.
Currently we are targeting only Browsers for FTD, but Excel, native iOS etc are not out of picture. Imagine if there was a language where you can define how the Excel table will look like, not just the content of the cell. LAMBDA solves content of cell controlled by a formula. PowerFX and Excel allow or will soon allow you to control the Fill with a formula. But instead of assigning each attributes one by one to different LAMBDA, what if you can designate the entire cell to a LAMBDA, that returns the entire UI spec.
FTD is LAMBDA + UI Components
PowerFX gives you a canvas where you can place elements, and connect them. FTD gives you a text file where you an import and bring in elements and connect them. In PowerFX/LAMBDA you write some code, but using a rather crappy code editor. In FTD you have a proper code editor.
Beta Was this translation helpful? Give feedback.
All reactions