💾 Archived View for dioskouroi.xyz › thread › 29399862 captured on 2021-12-03 at 14:04:38. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
________________________________________________________________________________
A2 acting as standard input, and cell B2 acting as standard output.
This made me literally laugh out loud for way too long. This is the dumbest and most awesome thing I've seen in a while. I love it.
Also doesn't seem to have been modified for 5 years.
“To ensure accuracy, do not disturb the spreadsheet before it is finished recalculating.”
Sage advice indeed.
I learned it the hard way. Had an excel template which analised results from a test. It runs for 30-60 minutes depending on the amount of data. If you have another file open in excel and hope to work on it, forget it. Tried it, all data in the other spreadsheet was corrupted (results written in the wrong sheets due to other window being active). The only wise thing was to wait. This was helped by the fact that excel was using one core fully and the other 3 were thermal throtled so the laptop was unusable.
That's insane. Excel definetly didn't sound like the right tool for that job
I'm pretty sure there would be a market for a tool that transpiles Excel into literally anything else
In 2 separate companies I wrote java software that loaded .xlsx files with thousands of rows of rules written in 2 different proprietary ill-specified languages that were then interpreted by the java program.
Excel Oriented Programming is a thing.
Yes it is.
I once worked on an early era "smart" phone whose apps were written in a visual basic-like clone. We were silicon valley cool kids and thought people would love too write apps in a high level language rather than C or C++. This was pre-web, pre-javascript, pre-Android, pre-iOS. The large Japanese tech company putting the phone out was staffed by a bunch of electrical engineers whose idea of programming was a table driven state machine, so they used Excel to model the UI for the entire phone as one huge state machine, then wrote Excel basic that took that spreadsheet and generated the proprietary basic code for the device's UI. We thought they'd want to write basic code, but they wanted to code up a spreadsheet instead.
You could always embed an excel table into Word or PowerPoint.
/ducks
Well, PowerPoint has been shown to be Turing Complete:
Time to put in a PR for C2 to act as standard error.
_"Your scientists were so preoccupied with whether they could, they didn't stop to think if they should."_
The reference to Jurassic Park* is actually quite on point, given the dinosaur vba is.
*) I remember Jeff Goldblum saying something along those lines, though I imagine the quote could've come from someone else.
I think the knee jerk hatred of VBA is really odd. No other language has given more people an opportunity to create the tools they need.
Motto of many technical posts on Hacker News front page.
That is how a lot of innovation start. That can benefit the company many times the combined time of these kinds of “procrastination”.
It is also a way to give employees motivation.
How else do do figure of “what you don’t know that you know”?
This is quite clever, and probably a joke that I'm not getting, but the Excel C SDK lets you call C/C++ from Excel and vice versa. This is one of my bread and butter tools, and I like nice tools, so I wrote a C++ wrapper around the SDK. It also lets you embed C++ objects in Excel:
https://github.com/xlladdins/xll
The "blog post"[0] is an actual demo. Click "Run as spreadsheet".
This is amazing for learning.
[0]:
https://mrthefakeperson.github.io/Excel-Virtual-Machine/
The Dwarves dug too greedily and too deep. You know what they awoke in the darkness of Khazad-dûm.
Why? Because we can that's why!
It could be useful if there was a C program you would like to run, but the only tool available was Excel. Maybe strict IT admins had disabled the ability to run anything but Office, and even VBA macros were disabled. Although in that scenario it would be better if the compiler was written in C and could bootstrap itself.
I think we need a compiler written in excel!
Sheets for modules. A column for each function. A row for each line of code. I weirdly would love to see this.
That is pretty much how macros worked in Excel 4.
I once wrote an x86 assembler in Lotus 123.
_[Need for citation intensifies]_
I don't mean to put down OP but isn't it kinda straight forward since assembly is just a 1:1 correspondence with machine instructions? simply pasting the assembly program into a column then looking up each mnemonic in an association table linking each mnemonic with it's machine representation and writing the result into a new column would work. The Labels->Addresses mapping is another lookup but over the program column itself, looking up the row where the label is defined and using that as the offset from the start address of the program. An assembler is just a fancy string processor, Excel is mighty good at string processing.
What I would bet a respectable sum on is that you can't parse/process/interpret even the simplest recursive languages (e.g. arithemtic, Expr ::= Expr + Expr | NUMBER) from pure Excel. Forget expressing the algorithm, there isn't even a suitable data structure to iterate over.
Apologies, this was over 30 years ago!
IIRC it made extensive use of lookup tables, both building them and being driven by them.
It wasn't a complete implementation, but it proved the theory and scratched an itch.
That's really cool :) and makes perfect sense.
I can see what you mean about it scratching an itch. Definitely piqued my interest!
(Varying "citation needed" didn't quite convey genuine curiosity the way I thought it would.)
Yes, but can it run DOOM?
That's always the question!
Here is a video of a doom-alike in excel, explained by someone with a bird on his head. He's not clippy, but a real person with a bird on his head. [1]
Here is a video displaying a walk-through of the Excel easter egg that showed the Hall of Tortured Souls! [2]
[1]
https://www.youtube.com/watch?v=s105jek4WUI
[2]
https://www.youtube.com/watch?v=WGqD-J_pRvs
The bird moves to his hand halfway through.
Thankfully, the bird's location doesn't affect the graphical rendering power of Excel.
[fixed]
Thanks!
Excel 95 contained an Easter egg which was a doom like game.
It was 3D but it wasn’t really Doom like. It reminded me more of Magic Carpet.
There was a Windows 95 screen saver that was Doom like though.
Excel 98 had an Easter egg which was like Magic Carpet! If I recall correctly, you fly over a twisted purple and orange landscape while an obelisk emits the credits.
95 had the “Hall of Tortured Souls”—a 2.5D first-person walker—which was more Doomlike.
Oh yeah. I completely forgot about that one
There was no Excel 98.
They mean the excel included in Office `97. That's the disk I'm holding in my hand and that's the version I experienced the weird flying easter egg.
Whoops! Yes, thanks.
There was on the Mac.
The compiled Excel file can be executed by triggering iterative calculation (pressing F9 repeatedly)
I know very little Excel, but can’t you create a loop with it?
Not without dropping into VBA, at least last I looked. The cell dependency graph should form a DAG. If there is a cycle, it will break (Excel will detect this). A common way to produce a "loop" is to create a row for each iteration depending on the one above (which can actually be handy to see convergence and intermediate values). This means there's no way to do something like:
// initial A1 = 0 A2 = 100 (the limit) A3 = =A3+A1 (self referential, 0 initial) // somehow A1 = 1 A2 = 100 A3 = =A3+A1 == 1
If you could refer to previous values it might be possible, but would also force some synchronization into the process that might be problematic. Like you'd need A1 to only update after A3 has had a chance to read it, then the next, then the next.
Excel supports iterative calculations, which allows you to use circular references. If you enable it, you need to specify a maximum number of iterations excel will run on each update. I believe you can also specify a minimum delta which will cause Excel to terminate early if subsequent iterations differ by less than the delta. I suspect the reason you need to press f9 repeatedly is this project uses circular references, but running your program takes longer than the maximum number of iterations, so pushing f9 allows it to run for another set of iterations.
That makes sense, I've never made use of that. Apparently that was available as early as Excel 2007, I've just never come across it and haven't used Excel for much more than a scratchpad in years now.
Goal seek also covers various optimization / iteration scenarios.
Or solver.
Options exist for iterations and maximum change directly with circular references.
https://bettersolutions.com/excel/formulas/circular-referenc...
Adding in indirect/offset/lookups/indexes etc - I've gotten surprisingly far.
I'm also OK doing VBA _BUT_ the MAJOR downside of VBA - horrendous to share it and got worse over time for security reasons.
Excel without VBA - you can give the "program" to anyone, and almost anyone can use it (and in a pinch change it).
This sounds like we're going to learn about macro and VB viruses all over again.
Using newer Excel you also have the power of making custom named functions with LAMBDA() which can also recurse (I think the stack limit is 1024). If you combine this with the idea of columns or rows as iterations of the memory with some of the array functions like MAKEARRAY() and relative position functions like OFFSET() or INDIRECT() you can do pretty much any reasonably sized computation without needing iterative calculation enabled.
The reason being Excel is a tool designed for performing operations on tabular data not designed for general data programming. If you needed programming there was always VBA which was proper so they never wanted to muck it up. LAMBDA made its way in because people wanted reusable function compositions for their tabular data without having to enable the security PITA that is allowing full macros/VBA which can do a lot more than interact with just the data inside the spreadsheet.
Many people stop at VBA, but you can grow beyond it into full VB via .NET Office automation and AddIns, or if feeling miserable, COM in C++.
Additionally if only data transformations are required, there is the F# inspired Power Query.
vba is fine but it seems to exist halfway outside the calculation chain space that sheets and cells operate in. excel can work with it, but one has to be quite careful with function returns and parameters.
offsets and indirects also exist in that twilight zone being volatile functions.
these three combined can bring down a reasonably sized spreadsheet.
Sort of. It is possible to make a loop of mutually dependent formulas. By default this will politely assume you made a mistake and throw a warning message without calculating anything. However, if you know where to poke in the settings, you can enable recursive formulas and use that to rig loops. Ignore the sibling comments answer, VBA is not required.
Excel supports arbitrary recursive functions without macros as of this year. See the new LAMBDA feature with Excel.
This exactly what
does.
You would accomplish loops in Excel as you would in any array languages (apply operations on columns and tables of data). You can also do recursion in Excel. We used to solve boundary value problems in my computational physics class using Excel.
This is disgusting. I love it.
There was a time when we used Excel Services in SharePoint to meet some of our business user needs. I wouldn’t use Excel again, but back then it seemed to be a good trade-off between time-to-market and usability (meaning performance for most of the time).
Anyhow, we use
https://github.com/handsontable/hyperformula
to run calculations in our other components these days.
Ironically, 97% of the code is written in F#.
Interesting. I wonder the reason for this
This is totally contrived, but I want to believe that this project is a learning project that the creator started to use F# to write a compiler. Perhaps the creator is experienced with imperative programming using C and wanted to do more programming in F#
The reason to do such a thing is that implementing a compiler in a functional programming language results in very elegant functional code. There's an "Aha!" moment when you drop the imperative way of thinking and see how functional thinking can be expressive and concise, yet so very different
I could see myself doing the same thing. It's a seductive intellectual challenge, difficult but achievable, to learn functional programming and write a compiler from scratch
Well, functional languages are often considered a great choice for a compiler, but C is simpler to implement to F#, I'd imagine. The README says it has unfinished F# support too.
Then we need a powerpoint virtual machine[1].
[1]
https://www.andrew.cmu.edu/user/twildenh/PowerPointTM/Paper....
It never ceases to amaze me how Wall Street thinks every pipeline needs to flow through Excel. I couldn't believe it 20 years ago and it's even harder to believe today.
See also: brainf*k in Google Spreadsheet
https://news.ycombinator.com/item?id=14703098
cool
The always required: "Your scientists were so preoccupied with whether they could, they didn’t stop to think if they should."